Skip to main content
Version: Old ArrowSquid docs

Store Interface

Store is a generic interface exposed by DataHandlerContext.store to the batch handler that defines an interface for persisting data. Its concrete type is inferred from the Database argument of the run() method:

run<Store>(db: Database<Store>, handler: (ctx: DataHandlerContext<Store, F extends FieldSelection>) => Promise<void>): void

The Database interface only defines the logic of how the processor persists the processor status and the store. Squid SDK supports Database implementations for TypeORM-compatible databases (TypeormDatabase) and for file-based datasets (the file-store packages). The interface allows implementation of adapters for custom data sinks. Support for more databases and analytics store will be added in the future.