Setu-TS
    Preparing search index...

    Function createDatabaseInboxStore

    • Builds the inbox store bridge as a RegistryFactory, for the messaging plugin's inbox.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 IInboxStore 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 inbox 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 an InboxStoreUnavailableError.

      Parameters

      Returns RegistryFactory<IInboxStore>

      A factory the messaging plugin resolves in onInit

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

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

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

      0.9.0