Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Connecting Rust and BigQuery with ADBC

Instructions

Prerequisites

  1. Install Rust

  2. Install dbc

  3. Install Google Cloud CLI

  4. Create a Google account or be able to log in to an existing one

Set up BigQuery

  1. Log into the Google Cloud Console and create project or locate an existing project and record the project ID for use in a later step

  2. Run this command in your terminal to log in with the Google Cloud CLI:

    gcloud auth application-default login

Connect to BigQuery

  1. Install the BigQuery ADBC driver:

    dbc install bigquery
  2. Customize src/main.rs as needed

    • Change the database arguments in opts
      • Change the value of the adbc.bigquery.sql.project_id argument to match the project ID you recorded in the earlier step
      • Change the value of adbc.bigquery.sql.dataset_id, or keep it to use the public Shakespeare dataset
    • If you changed the dataset, also change the SQL SELECT statement in statement.set_sql_query()
  3. Run the Rust program:

    cargo run