class BigtableAdapter
implements IDatabaseAdapter
Since 0.2.0

The Bigtable adapter.

Constructed by DatabasePlugin for the 'bigtable' arm, and also constructible directly by an application for the 'custom' arm.

Examples

Example 1

import { DatabasePlugin } from '@setu-ts/database-plugin';

app.register(DatabasePlugin({
  type: 'bigtable',
  options: {
    projectId: 'my-project',
    instance: 'app-instance',
    tables: {
      Order: {
        table: 'orders',
        rowKey: { fields: ['tenantId', 'orderId'] },
        columnFamily: 'o',
      },
    },
  },
}));

Constructors

BigtableAdapter()

Creates the adapter and validates its configuration.

The validation is the point: a blank instance id is otherwise a bare gRPC failure on the first request rather than a named configuration error at construction — the guard family M52c's and M52d's reviews added for D1 and Durable Objects.

Parameters

The 'bigtable' arm options

optional
loader: BigtableClientLoader

An explicit client loader, overriding the inject-or-lazy choice options would otherwise make. Supply one to wrap a differently-pinned SDK module around createLazyBigtableLoader's adaptation; the loader's owned flag decides whether BigtableAdapter.disconnect closes the client it produced.

Properties

Bigtable exposes no portable transaction-isolation selector.

Methods

Opens a single-row deferred-write transaction.

connect(): Promise<void>

Resolves the client and the instance handle.

No RPC is issued. A missing table or instance already answers 5 NOT_FOUND quoting the full resource path (measured), so a probe would buy no diagnostic — while instance.getTables() is a table-ADMIN call a data-plane service account commonly cannot make, so probing would refuse a working configuration.

Returns a data source for the named entity's table. @inheritdoc

disconnect(): Promise<void>

Releases the client.

Only a client this adapter CREATED is closed: closing an injected one would tear down gRPC channels the application still owns.

isReady(): boolean

Reports whether the adapter is connected. @inheritdoc

rawQuery<T>(
_sql: string,
_params?: unknown[]
): Promise<T[]>

Refuses the raw query by name.

Bigtable has no query language reachable through query(sql, params) — its data plane is ReadRows, MutateRow and CheckAndMutateRow. An application reaching for GoogleSQL uses the injected client directly.

It rejects, never throws synchronously.