Optionaloptions: DatabaseIdempotencyStoreOptions
The idempotency entity and the database connection
A factory the idempotency plugin resolves in onInit
import { createDatabaseIdempotencyStore, DatabasePlugin } from '@setu-ts/database-plugin';
import { IdempotencyPlugin } from '@setu-ts/idempotency-plugin';
const app = createApplication({
plugins: [
DatabasePlugin({ type: 'memory' }),
IdempotencyPlugin({ transactional: { store: createDatabaseIdempotencyStore() } }),
],
});
Builds the tier-C idempotency store bridge as a
RegistryFactory, for the idempotency plugin'stransactional.storeoption.The factory resolves
CAPABILITIES.DATABASE(ordatabase.<name>) from the registry it is handed — typed asIDatabaseService, the token's documented interface — and returns anITransactionalIdempotencyStoreover it. The idempotency plugin resolves it inonInit, soDatabasePluginmay be registered before or after, and runsverify()there.Per backend. Memory, Prisma, Drizzle (with the idempotency table in
drizzleTables), D1, a MongoDB replica set and DynamoDB are supported.verify()refuses Cosmos DB, Bigtable, a standalone MongoDB and a missing or unreadable entity, each by name with aTransactionalStoreUnavailableError.