class DynamoAdapter
implements IDatabaseAdapter
Since 0.1.0

The DynamoDB adapter — a key-value store backend served through the portable data-access contract.

Examples

Example 1

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

app.register(DatabasePlugin({
  type: 'dynamodb',
  options: { region: 'us-east-1' },
}));

Constructors

DynamoAdapter(options: DynamoAdapterOptions)

Creates the adapter.

Parameters

The 'dynamodb' arm options; region is required unless client is supplied

Properties

DynamoDB exposes no portable transaction-isolation selector.

Methods

Opens a deferred transaction: an empty buffer shared by every data source created from the returned handle. Commit flushes the buffer as one TransactWriteItems call; rollback discards it and sends nothing.

connect(): Promise<void>

Establishes the adapter's client, resolving the injected or lazy loader.

Nothing is retained until the loader resolves: a failure leaves #client null, so a later connect() retries instead of returning silently behind a permanently-unusable adapter (the Mongo #establish ordering lesson).

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

disconnect(): Promise<void>

Destroys the client the adapter constructed and releases it. An injected client is released without destroy(): it belongs to the application, which may reuse it.

isReady(): boolean

Reports whether the adapter resolved a client. @inheritdoc

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

Refuses the raw SQL query by name — DynamoDB has no SQL — rather than emulating it (the silent-divergence defect M70j closed). The error names the adapter and points at the client for native commands.

It rejects, never throws synchronously.