UNPKG

@nerdware/ddb-single-table

Version:

A schema-based DynamoDB modeling tool, high-level API, and type-generator built to supercharge single-table designs!⚡

19 lines 1.33 kB
import type { TableInstance, EnsureTableIsActiveParameters } from "./types/index.js"; import type { TableKeysSchemaType } from "../Schema/types/index.js"; /** * This method of the `Table` class is used to check if a DynamoDB table is active and * ready for use. * * The function checks the DDB table's status using the Table instance's `describeTable` * method. If the method returns a `ResourceNotFoundException`, the table does not exist. * If the table does not exist and `createIfNotExists` is set to `true`, the function * creates the table using the Table instance's `createTable` method — this function then * continues the process of waiting for the table to become active. * * Regardless of whether the table initially existed or not, if it is not active, the * function tries to connect to it again after `frequency` number of seconds have passed * until either the table is active, or `maxRetries` number of attempts have been made, * or `timeout` number of seconds have passed. */ export declare const ensureTableIsActive: <const TableKeysSchema extends TableKeysSchemaType>(this: TableInstance<TableKeysSchema>, { timeout: timeoutSeconds, frequency: frequencySeconds, maxRetries, createIfNotExists, }?: EnsureTableIsActiveParameters) => Promise<void>; //# sourceMappingURL=ensureTableIsActive.d.ts.map