db/db_pglite.ts

PGlite driver adapter for Db.

Provides create_pglite_db() to construct a Db backed by @electric-sql/pglite. Only imports PGlite types — the actual package is dynamically imported by callers (e.g., create_db) that construct the PGlite instance.

Declarations
#

view source

create_pglite_db
#

db/db_pglite.ts view source

(pglite: PGlite): DbDriverResult

Create a Db backed by a PGlite instance.

Delegates transactions to PGlite's native transaction() method and returns a close callback bound to pglite.close().

pglite

an already-constructed PGlite instance

type PGlite

returns

DbDriverResult

Depends on
#

Imported by
#