Module client

Module client 

Source
Expand description

The main module of this crate.

§Example

To build a Client you just need an Authenticator. For example, if you want to use a service account:

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // 1. Load the desired secret (here, a service account key)
    let sa_key = yup_oauth2::read_service_account_key("clientsecret.json")
        .await?;

    // 2. Create an Authenticator
    let auth = yup_oauth2::ServiceAccountAuthenticator::builder(sa_key)
        .build()
        .await?;

    // 3. Create a Client
    let mut client = bigquery_storage::Client::new(auth).await?;

    Ok(())
}

Structs§

Client
The main object of this crate.
ReadSession
A practical wrapper around a BigQuery Storage read session. Do not create it manually, use Client::read_session_builder instead.
ReadSessionBuilder
A builder for ReadSession. When in doubt about what a field does, please refer to CreateReadSessionRequest and the official API documentation.
Table
A fully qualified BigQuery table. This requires a project_id, a dataset_id and a table_id. Only alphanumerical and underscores are allowed for dataset_id and table_id.