Skip to content
All changes

Feature

PGliteCRUDRepository, a repository on PGlite without all five generics

@venizia/ignis-connectors

Changelog - 2026-11-06 ​

PGliteCRUDRepository, a repository on PGlite without all five generics ​

New Feature

In one line. class NoteRepository extends PGliteCRUDRepository<typeof noteTable> {} accepts a PGlite datasource in new NoteRepository(dataSource). DefaultCRUDRepository<typeof noteTable> refuses one with TS2345, because its last generic defaults to the pg.Pool datasource, so a PGlite repository had to spell out all five generics.

What changed ​

  • A new export. PGliteCRUDRepository comes from @venizia/ignis-connectors/postgres, beside DefaultCRUDRepository, and the type TPGliteDataSource from @venizia/ignis-connectors/postgres/pglite. The repository sits in the main entry so the PGlite entry stays light: it loads no kernel. The value is DefaultCRUDRepository at runtime, so @repository({ model, dataSource }), dependency injection and every method work unchanged.
  • The datasource is typed as PGlite. this.dataSource.getClient() is a PGlite. A pg.Pool datasource, a datasource of another engine and a value that is not a datasource are type errors.
  • The pg.Pool default is untouched. DefaultCRUDRepository<typeof table> still types getClient() as Pool, and still refuses a PGlite datasource.
  • The type has the same name. PGliteCRUDRepository<typeof table> also works as a type for a variable or a parameter.
typescript
import { PGliteCRUDRepository } from '@venizia/ignis-connectors/postgres';

@repository({ model: Note, dataSource: PGliteDataSource })
export class NoteRepository extends PGliteCRUDRepository<typeof noteTable> {}

Who is affected ​

  • Apps with a repository on PGlite that wrote all five generics. They can switch to PGliteCRUDRepository.
  • Everyone else. No action needed.

Details ​

FilePackage
src/relational/postgres/repositories/core/pglite.tsconnectors
src/relational/postgres/drivers/pglite.tsconnectors