Synclets logoSynclets

createPgliteSynclet

The createPgliteSynclet function creates a Synclet with PGlite-backed connectors.

createPgliteSynclet<Depth>(options: PgliteSyncletOptions<Depth>): Promise<Synclet<Depth, PgliteDataConnector<Depth>, PgliteMetaConnector<Depth>>>
TypeDescription
optionsPgliteSyncletOptions<Depth>

Configuration including depth, pglite instance, and optional table/column names.

returnsPromise<Synclet<Depth, PgliteDataConnector<Depth>, PgliteMetaConnector<Depth>>>

A Promise that resolves to the Synclet.

This is the recommended approach for creating a PGlite Synclet, providing a simplified API that creates both the DataConnector and MetaConnector internally. The function uses the same PGlite database instance for both connectors and allows customization of all table and column names.

When table/column options are not provided, the connectors use defaults: data table 'data' with columns 'address' and 'atom', and meta table 'meta' with columns 'address' and 'timestamp'. All table structures are created automatically on first use.

Since

v0.0.0