pub struct TableService { /* private fields */ }Expand description
Implements a client for the BigQuery API.
§Example
async fn sample(
) -> anyhow::Result<()> {
let client = TableService::builder().build().await?;
let response = client.get_table()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}§Service Description
TableService provides methods for managing BigQuery tables and table-like entities such as views and snapshots.
§Configuration
To configure TableService use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://bigquery.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured with Private Google Access with VPC Service Controls) may want to override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
TableService holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap TableService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl TableService
impl TableService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for TableService.
let client = TableService::builder().build().await?;Sourcepub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: TableService + 'static,
pub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: TableService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn get_table(&self) -> GetTable
pub fn get_table(&self) -> GetTable
Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.
§IAM Permissions
Requires the bigquery.tables.get permission on the table.
§Example
use google_cloud_bigquery_v2::Result;
async fn sample(
client: &TableService
) -> Result<()> {
let response = client.get_table()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn insert_table(&self) -> InsertTable
pub fn insert_table(&self) -> InsertTable
Creates a new, empty table in the dataset.
§IAM Permissions
Requires the bigquery.tables.create permission on the dataset.
§Example
use google_cloud_bigquery_v2::Result;
async fn sample(
client: &TableService
) -> Result<()> {
let response = client.insert_table()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn patch_table(&self) -> PatchTable
pub fn patch_table(&self) -> PatchTable
Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports RFC5789 patch semantics.
§IAM Permissions
Requires the following IAM permission(s) on the table:
bigquery.tables.updatebigquery.tables.get
§Example
use google_cloud_bigquery_v2::Result;
async fn sample(
client: &TableService
) -> Result<()> {
let response = client.patch_table()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_table(&self) -> UpdateTable
pub fn update_table(&self) -> UpdateTable
Updates information in an existing table. The update method replaces the entire Table resource, whereas the patch method only replaces fields that are provided in the submitted Table resource.
§IAM Permissions
Requires the bigquery.tables.update permission on the table.
§Example
use google_cloud_bigquery_v2::Result;
async fn sample(
client: &TableService
) -> Result<()> {
let response = client.update_table()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_table(&self) -> DeleteTable
pub fn delete_table(&self) -> DeleteTable
Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.
§IAM Permissions
Requires the bigquery.tables.delete permission on the table.
§Example
use google_cloud_bigquery_v2::Result;
async fn sample(
client: &TableService
) -> Result<()> {
client.delete_table()
/* set fields */
.send().await?;
Ok(())
}Sourcepub fn list_tables(&self) -> ListTables
pub fn list_tables(&self) -> ListTables
Lists all tables in the specified dataset. Requires the READER dataset role.
§IAM Permissions
Requires the bigquery.tables.list permission on the dataset.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_bigquery_v2::Result;
async fn sample(
client: &TableService
) -> Result<()> {
let mut list = client.list_tables()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Trait Implementations§
Source§impl Clone for TableService
impl Clone for TableService
Source§fn clone(&self) -> TableService
fn clone(&self) -> TableService
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TableService
impl !UnwindSafe for TableService
impl Freeze for TableService
impl Send for TableService
impl Sync for TableService
impl Unpin for TableService
impl UnsafeUnpin for TableService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request