Repository configuration overhaul: single config object, optional read/write table split for views.
-
Repositoryconstructor — pass one config object instead of positional arguments.// Before (1.x) new Repository("users", executor, { logging: true }); // After (2.x) new Repository({ tableName: "users", executor, logging: true });
-
RepositoryOptionsremoved —loggingandexecutorlive onRepositoryConfigalongsidetableName.
-
mutableTableName— read from a view (tableName) while inserting, updating, and deleting against a base table. Omit it to usetableNamefor all operations.new Repository({ tableName: "inventory__v_items", mutableTableName: "inventory_items", executor, });
- Publish workflow uses
actions/setup-nodesoNPM_TOKENauth applies correctly in CI.
Full changelog: https://github.com/sqlkit-dev/sqlkit/compare/1.0.19...HEAD
Fix npm package entry points so TypeScript consumers resolve dist/ types instead of unpublished src/ sources.
main/types/module/exports— point atdist/index.*(removed brokenpublishConfig+src/index.tsdev entries that were published as-is in 1.0.18).files— tarball no longer includessrc/index.ts; onlydist/is shipped.prepublishOnly— runsbuildbefore everynpm publish.
PostgreSQL-focused release with a richer repository API, clearer npm packaging, and a contributor-friendly monorepo layout.
findOne()— fetch a single row by where condition, or pass a full query payload (columns, order, joins) withlimit: 1applied automatically; returnsnullwhen nothing matches.- Column selection on
find()andpaginate()— passcolumns: ['id', 'email']to limit selected fields instead of always returning*. - Flexible
insert()— accept one object or an array in a single call; bulk inserts still use one round-trip. - Optional
count()filter — omitwhereto count all rows in the table. operationNamein repository logging — optional label onfind,update, anddeletelog output for easier tracing in development.
- Quoted table identifiers — generated SQL now wraps table names in double quotes (
"users") everywhere (SELECT, INSERT, UPDATE, DELETE, JOIN, schema DDL, and foreign keys), so mixed-case table names behave correctly in PostgreSQL. PostgresAdaptererrors — database errors are thrown asSQLKITExceptionwith the original driver error attached ascausefor easier debugging.
- Repo restructured as a Bun workspaces monorepo: library in
packages/sqlkit, localapps/playgroundfor trying the API against PostgreSQL,docker composefor a test database, and CI switched to Bun. - Documentation and package metadata updated to describe sqlkit as a PostgreSQL query builder;
pgis listed as a peer dependency. - Contributor docs (
README.md,CLAUDE.md) updated for the new layout.
Full changelog: https://github.com/sqlkit-dev/sqlkit/compare/1.0.12...HEAD