GCP.BigQueryConnection reference
Connection
Section titled “Connection”Source:
src/GCP/BigQueryConnection/Connection.ts
A BigQuery Connection to an external data source.
Connections have no resource labels. Alchemy stamps ownership into the
description ([alchemy alchemy-stack=… alchemy-stage=… alchemy-id=…])
so list / pnpm nuke:gcp can find them.
When no connection type is set, Alchemy creates a Cloud resource
connection (cloudResource: {}) — the cheapest type, with no extra
Cloud SQL / Spanner / AWS resources. connectionId, location,
kmsKeyName, and the connection type are immutable.
Connection: Creating a Connection
Section titled “Connection: Creating a Connection”Generated Cloud resource connection
const gcs = yield* GCP.BigQueryConnection.Connection("Gcs", {});Named Cloud resource connection
const gcs = yield* GCP.BigQueryConnection.Connection("Gcs", { connectionId: "app-gcs", location: "us-central1", friendlyName: "GCS access", description: "delegates to Cloud Storage", cloudResource: {},});Connection: Spark
Section titled “Connection: Spark”const spark = yield* GCP.BigQueryConnection.Connection("Spark", { spark: {},});Connection: Cloud SQL
Section titled “Connection: Cloud SQL”Cloud SQL connections need a live instance, database, and password — skip them in cheap tests.
const sql = yield* GCP.BigQueryConnection.Connection("Sql", { location: "US", cloudSql: { instanceId: "my-project:us-central1:app-sql", database: "app", type: "POSTGRES", credential: { username: "app", password: "secret" }, },});GetConnection
Section titled “GetConnection”Source:
src/GCP/BigQueryConnection/GetConnection.ts
Runtime binding for BigQuery Connection connections.get.
Bind this operation to a Connection in a Function/Action init
phase. Provide GetConnectionHttp.
GetConnection: Reading a Connection
Section titled “GetConnection: Reading a Connection”const getConnection = yield* GCP.BigQueryConnection.GetConnection(gcs);const live = yield* getConnection();GetConnectionHttp
Section titled “GetConnectionHttp”Source:
src/GCP/BigQueryConnection/GetConnectionHttp.tsKind: Layer · Provides:GCP.BigQueryConnection.GetConnection
HTTP implementation of GetConnection.