Skip to content

Latest commit

 

History

History
72 lines (46 loc) · 3.22 KB

File metadata and controls

72 lines (46 loc) · 3.22 KB

Changelog

2.0.0 — 2025-06-25

Repository configuration overhaul: single config object, optional read/write table split for views.

Breaking Changes

  • Repository constructor — 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 });
  • RepositoryOptions removedlogging and executor live on RepositoryConfig alongside tableName.

Features

  • mutableTableName — read from a view (tableName) while inserting, updating, and deleting against a base table. Omit it to use tableName for all operations.

    new Repository({
      tableName: "inventory__v_items",
      mutableTableName: "inventory_items",
      executor,
    });

Internal

  • Publish workflow uses actions/setup-node so NPM_TOKEN auth applies correctly in CI.

Full changelog: https://github.com/sqlkit-dev/sqlkit/compare/1.0.19...HEAD

1.0.19 — 2025-06-25

Fix npm package entry points so TypeScript consumers resolve dist/ types instead of unpublished src/ sources.

Fixes

  • main / types / module / exports — point at dist/index.* (removed broken publishConfig + src/index.ts dev entries that were published as-is in 1.0.18).
  • files — tarball no longer includes src/index.ts; only dist/ is shipped.
  • prepublishOnly — runs build before every npm publish.

1.0.18 — 2025-06-25

PostgreSQL-focused release with a richer repository API, clearer npm packaging, and a contributor-friendly monorepo layout.

Features

  • findOne() — fetch a single row by where condition, or pass a full query payload (columns, order, joins) with limit: 1 applied automatically; returns null when nothing matches.
  • Column selection on find() and paginate() — pass columns: ['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 — omit where to count all rows in the table.
  • operationName in repository logging — optional label on find, update, and delete log output for easier tracing in development.

Fixes

  • 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.
  • PostgresAdapter errors — database errors are thrown as SQLKITException with the original driver error attached as cause for easier debugging.

Internal

  • Repo restructured as a Bun workspaces monorepo: library in packages/sqlkit, local apps/playground for trying the API against PostgreSQL, docker compose for a test database, and CI switched to Bun.
  • Documentation and package metadata updated to describe sqlkit as a PostgreSQL query builder; pg is 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