class BigtableTransactionScopeError
extends Error
Since 0.2.0

Thrown when a Bigtable transaction is asked to write a second row.

Bigtable's only atomicity unit is the single row: a multi-row batch is atomic per entry and not as a whole. A handle that accepted several row keys would therefore promise an atomicity the platform does not offer, so the refusal happens at the write that crosses the bound rather than at commit, naming both rows — the CosmosTransactionScopeError precedent.

Examples

Example 1

import { BigtableTransactionScopeError } from '@setu-ts/database-plugin';
try {
  await uow.getRepository('User').create({ id: 'u1' });
  await uow.getRepository('User').create({ id: 'u2' });
} catch (err) {
  if (err instanceof BigtableTransactionScopeError) {
    console.error(err.message);
  }
}

Constructors

BigtableTransactionScopeError(message: string)

Creates the error.

Parameters
message: string

The full diagnostic, safe to log, naming what was crossed

Properties

readonly
name: string

Discriminant for consumers that cannot use instanceof across realms.

Usage

import { BigtableTransactionScopeError } from "database-plugin/src/index.ts";