Changelog - 2026-11-06
PGliteCRUDRepository, a repository on PGlite without all five generics
New FeatureIn 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.
PGliteCRUDRepositorycomes from@venizia/ignis-connectors/postgres, besideDefaultCRUDRepository, and the typeTPGliteDataSourcefrom@venizia/ignis-connectors/postgres/pglite. The repository sits in the main entry so the PGlite entry stays light: it loads no kernel. The value isDefaultCRUDRepositoryat runtime, so@repository({ model, dataSource }), dependency injection and every method work unchanged. - The datasource is typed as PGlite.
this.dataSource.getClient()is aPGlite. Apg.Pooldatasource, a datasource of another engine and a value that is not a datasource are type errors. - The
pg.Pooldefault is untouched.DefaultCRUDRepository<typeof table>still typesgetClient()asPool, 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
| File | Package |
|---|---|
src/relational/postgres/repositories/core/pglite.ts | connectors |
src/relational/postgres/drivers/pglite.ts | connectors |