Skip to content

GCP.BigQueryConnection reference

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.

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: {},
});
const spark = yield* GCP.BigQueryConnection.Connection("Spark", {
spark: {},
});

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" },
},
});

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.

const getConnection = yield* GCP.BigQueryConnection.GetConnection(gcs);
const live = yield* getConnection();

Source: src/GCP/BigQueryConnection/GetConnectionHttp.ts Kind: Layer · Provides: GCP.BigQueryConnection.GetConnection

HTTP implementation of GetConnection.