Skip to content

Releases: sqlkit-dev/sqlkit

2.0.0

Choose a tag to compare

@kingRayhan kingRayhan released this 25 Jun 07:59

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: 1.0.19...HEAD

1.0.18

Choose a tag to compare

@kingRayhan kingRayhan released this 25 Jun 06:26

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: 1.0.12...HEAD

1.0.12

Choose a tag to compare

@kingRayhan kingRayhan released this 09 Jun 20:02

Full Changelog: 1.0.1...1.0.12

v1.0.0

Choose a tag to compare

@kingRayhan kingRayhan released this 15 Apr 18:14
Refactor select query builder to ensure join select clause is only in…