Setu-TS
    Preparing search index...

    Function createDatabaseIdempotencyStore

    • Builds the tier-C idempotency store bridge as a RegistryFactory, for the idempotency plugin's transactional.store option.

      The factory resolves CAPABILITIES.DATABASE (or database.<name>) from the registry it is handed — typed as IDatabaseService, the token's documented interface — and returns an ITransactionalIdempotencyStore over it. The idempotency plugin resolves it in onInit, so DatabasePlugin may be registered before or after, and runs verify() 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 a TransactionalStoreUnavailableError.

      Parameters

      Returns RegistryFactory<ITransactionalIdempotencyStore>

      A factory the idempotency plugin resolves in onInit

      When entity is empty — at the call, before any application starts

      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() } }),
      ],
      });

      0.9.0