npm / kysely
kysely
What changed in kysely 0.28 to 0.29, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
26 breaking7 security3 deprecations26 new APIs and options2 performance4 behavior and defaults1 tooling33 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initkysely 0.2974 changes
Breaking changes 23
PGlite 0.5.15+ commits that roll back aborted transactions now throw AbortedTransactionError, matching PostgreSQL behavior.
at() no longer accepts a second type argument for the output type; use
$castTo<T>()to override it.key() no longer accepts a second type argument for the output type; use
$castTo<T>()to override it.Executed migrations with an invalid timestamp now fail with "corrupted migrations" instead of being sorted arbitrarily.
Commits that PostgreSQL turns into rollbacks now throw AbortedTransactionError; controlled transactions are marked rolled back and release their connection, so a subsequent rollback().execute() safely succeeds without another rollback.
The library no longer ships CommonJS files; use a Node.js version supporting
require(esm)or dynamic imports.Removed; use
DatabaseIntrospector.getTablesinstead.The second
queryIdargument has been replaced withoptions?: AbortableQueryOptions.ES Modules files have moved from
/dist/esm/to/dist/.Removed after a long deprecation; use
DropTableNodeParamsinstead.Removed after a long deprecation.
Removed after a long deprecation; use
InsertQueryNode.orActioninstead.Migration exports have been removed from the root entry point; import them from
kysely/migrationinstead.Migration APIs are exposed from this entry point; importing migration exports from the root package now produces a compilation-time error.
Replaces the removed
MssqlDialectConfig.Tedious.resetConnectionOnReleaseconfiguration key.Replaces the removed
MssqlDialectConfig.Tarn.options.validateConnectionsconfiguration key.Adds a compile-time helper that removes selected table descriptions from the database type for following queries.
Adds a compile-time helper that narrows the database type for following queries to the selected tables, reducing compilation complexity and time.
Removed after a long deprecation; use
PrimaryKeyConstraintNodeinstead.Removed; dialects that used it need to use
QueryResult.numAffectedRowsinstead.Removed after a long deprecation; use
sql.litinstead.Removed after a long deprecation; use
sql.valinstead.The minimum supported TypeScript version is now 5.4; versions 5.3 and older produce a compilation error.
Security 2
MSSQL now escapes keys passed to jsonBuildObject.
MSSQL now escapes JSON in jsonBuildObject.
Deprecations 3
Create and add index
columnandcolumnsfunctions now accept expressions; theirexpressionfunctions are deprecated.The create and add index
expressionfunctions are deprecated; use theircolumnandcolumnsfunctions, which now allow expressions.Deprecated in favor of
$pickTables,$omitTablesand$extendTables.
New APIs and options 24
Adds
addIndextoCreateTableBuilderfor MySQL.Adds PostgreSQL alter type query support.
Adds an optional Postgres dialect control client for out-of-pool connections used for database-side query aborts.
Adds MSSQL
datetime2data type support.Adds support for
IF EXISTSwhen dropping a column in PostgreSQL and MSSQL.Adds
elseReftoeb.case().Adds a helper to extend the tables available in the database type.
Allows overriding the file import function.
Introspection now supports PostgreSQL and MySQL foreign tables.
Selects how an in-flight query is aborted: ignore it, cancel it on the database side, or kill the database session.
Adds the ability to disable transactions in migration methods.
Allows passing transactions to Migrator.
Adds a
shouldParse(value, path)option to control which values are parsed as JSON and which remain strings, using JSON paths.Adds a dialect for PGlite.
Adds a helper type for a compile-time readonly Kysely instance; write operations and executing SQL through the instance produce compilation errors.
Adds a plugin that changes equality and inequality comparisons with a null right-hand argument to
isandis not.Supports dropping multiple types and cascade.
Pass an abort signal to execute methods and similar APIs to abort or time out queries and ignore their results.
Adds an adapter flag; when false, a centralized connection mutex is used.
Adds support for dropping temporary tables using the
temporary()modifier.Adds
thenReftoeb.case.MySQL unique constraints now allow expressions.
Adds
whenRef(lhs, op, rhs)toeb.case.Adds
with(name, query).
Behavior and default changes 3
Supports narrowing by deep object keys.
Supports nested narrowing and discriminated unions.
The type widened from
ReadonlyArray<ColumnNode>toReadonlyArray<OperationNode>.
Tooling 1
The TypeScript build target is now
es2023.
Fixes and other changes 18
Inline
key()/at()JSON path references now infer correctly instead of inferringunknown.The migrator reads the latest recorded timestamp under the migration lock and records each new migration at max(now, latest + 1ms), preventing clock jumps from creating out-of-order timestamps.
Fixed crashes on
for ... ofandjson_agg/to_jsontables in subqueries.PostgreSQL clients whose rollback fails are discarded instead of returned to the pool for reuse.
Commit, rollback, and savepoint commands wait for ongoing queries and streams to finish, preventing commands from racing with them.
Transaction handles now share completion state.
A failed begin now releases the transaction connection.
A failed rollback releases the connection and marks the transaction as rolled back.
The client is released if it is destroyed while acquiring a connection.
The where clause in doUpdateSet now allows immutable columns.
Fixes infinite type-check recursion.
PostgreSQL passwords are now passed to the control client.
Returning clauses in SQLite delete queries no longer appear after order by and limit.
Fixed PostgreSQL and MSSQL migrations not running exclusively when disableTransactions is true.
Fixes mishandling of branded types.
Fixed a regression in piping plugins' result transformations.
Wraps object keys in quotes when parsing JSON results.
Explicit undefined is now allowed in Updateable when exactOptionalPropertyTypes is enabled.
kysely 0.2828 changes
Breaking changes 3
Commit, rollback, and savepoint commands wait for ongoing queries and streams to finish; active streams must be closed or exhausted before awaiting these commands.
PostgreSQL and MSSQL migrations use session-level locks, including when disableTransactions is true. PostgreSQL migrations through PgBouncer transaction pooling need a direct connection, session pooling, or custom migration locking.
Prevents re-use of a finished transaction outside its callback.
Security 5
JSON path key access is further hardened against SQL injections and exfiltrations.
Kysely: JSON-path traversal injection via unsanitized path-leg metacharacters in
JSONPathBuilder.key()/.at()Kysely has a MySQL SQL Injection via Backslash Escape Bypass in non-type-safe usage of JSON path keys.
Kysely has a MySQL SQL Injection via Insufficient Backslash Escaping in
sql.lit(string)usage or similar methods that append string literal values into the compiled SQL stringsFixes an injection vulnerability in eb.ref(col, '->$').key(key).
New APIs and options 2
Adds NonDehydrateable<T> to opt out of dehydration in JSON functions and helpers, preserving numeric-string column types.
Added as a type export.
Performance 2
Table metadata parsing is optimized.
Result processing in the PostgreSQL introspector is no longer unnecessarily slow.
Behavior and default changes 1
The where predicate now allows immutable columns and uses column select types, including for columns that cannot be updated.
Fixes and other changes 15
The migrator records timestamps in increasing order across clock jumps and rejects executed migrations with invalid timestamps.
SQLite DELETE queries now output RETURNING before ORDER BY and LIMIT.
FilterObject allows any defined value when the query context has no tables (TB is never).
Allows non-objects when a table has no required columns.
Ensures the ON COMMIT clause is output when using .as(query) in CREATE TABLE queries.
Adds sideEffects: false to the root package.json, preventing bigger bundles in various bundlers.
Updates types for mysql2 support.
Fixes generated SQLite update queries so returning comes before order by.
Fixed compilation errors when composite.
Fixed attempts to create a custom migration schema when it already exists, which failed on dialects that don't support
if not exists.Fixed compilation errors when
composite: true.Fixed compilation errors when composite for PostgreSQL and SQLite.
Fixed compilation errors when composite.
withSchema now applies to delete query using clauses.
withSchema no longer adds a schema to for update, share, key share, or no key share table clauses, avoiding database errors.