Setu-TS
    Preparing search index...

    Function createDatabaseOutboxStore

    • Builds the outbox store bridge as a RegistryFactory, for the messaging plugin's outbox.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 IOutboxStore over it. The messaging plugin resolves it in onInit, so DatabasePlugin may be registered before or after the messaging plugin, and runs verify() there.

      Per backend. Memory, Prisma, Drizzle (with the outbox table in drizzleTables), D1, a MongoDB replica set, DynamoDB with a GSI { partitionKey: 'status', sortKey: 'position' } (projection ALL), and Cosmos with the outbox entity mapped to the business container and a partition-key path the row carries (tenantId or orderingKey) are supported. verify() refuses Bigtable, a standalone MongoDB, a DynamoDB entity without that GSI, and a missing or unreadable entity, each by name with an OutboxStoreUnavailableError.

      Parameters

      Returns RegistryFactory<IOutboxStore>

      A factory the messaging plugin resolves in onInit

      When entity is empty or database is not a legal connection name — at the call, before any application starts

      import { createDatabaseOutboxStore, DatabasePlugin } from '@setu-ts/database-plugin';
      import { MessagingPlugin } from '@setu-ts/messaging-plugin';

      const app = createApplication({
      plugins: [
      DatabasePlugin({ type: 'memory' }),
      MessagingPlugin({ outbox: { store: createDatabaseOutboxStore() } }),
      ],
      });

      0.9.0