Kysely

Frameworks & Libraries

A type-safe SQL query builder for TypeScript with no runtime schema.

Latest v0.29.5 · by KyselyWebsitekysely-org/kysely

Release activity

Release activity — 11 releases across 10 days since Apr 10, 2026. Each cell is one day; darker means more releases that day. Nothing is recorded before Apr 10, 2026. Older weeks are hidden at this screen width.
MayJunJulAug
SundayNo releases on Apr 26, 20261 release on May 3, 2026No releases on May 10, 2026No releases on May 17, 2026No releases on May 24, 2026No releases on May 31, 2026No releases on Jun 7, 2026No releases on Jun 14, 2026No releases on Jun 21, 2026No releases on Jun 28, 20261 release on Jul 5, 2026No releases on Jul 12, 2026No releases on Jul 19, 20261 release on Jul 26, 2026No releases on Aug 2, 2026No releases on Aug 9, 2026
MondayNo releases on Apr 27, 2026No releases on May 4, 2026No releases on May 11, 2026No releases on May 18, 2026No releases on May 25, 2026No releases on Jun 1, 2026No releases on Jun 8, 2026No releases on Jun 15, 2026No releases on Jun 22, 2026No releases on Jun 29, 2026No releases on Jul 6, 2026No releases on Jul 13, 2026No releases on Jul 20, 2026No releases on Jul 27, 2026No releases on Aug 3, 20261 release on Aug 10, 2026
TuesdayNo releases on Apr 28, 2026No releases on May 5, 2026No releases on May 12, 2026No releases on May 19, 2026No releases on May 26, 2026No releases on Jun 2, 2026No releases on Jun 9, 2026No releases on Jun 16, 2026No releases on Jun 23, 2026No releases on Jun 30, 2026No releases on Jul 7, 2026No releases on Jul 14, 2026No releases on Jul 21, 2026No releases on Jul 28, 2026No releases on Aug 4, 2026No releases on Aug 11, 2026
WednesdayNo releases on Apr 29, 2026No releases on May 6, 2026No releases on May 13, 2026No releases on May 20, 2026No releases on May 27, 2026No releases on Jun 3, 2026No releases on Jun 10, 2026No releases on Jun 17, 2026No releases on Jun 24, 2026No releases on Jul 1, 2026No releases on Jul 8, 2026No releases on Jul 15, 2026No releases on Jul 22, 2026No releases on Jul 29, 2026No releases on Aug 5, 2026
ThursdayNo releases on Apr 30, 2026No releases on May 7, 2026No releases on May 14, 2026No releases on May 21, 2026No releases on May 28, 2026No releases on Jun 4, 2026No releases on Jun 11, 2026No releases on Jun 18, 2026No releases on Jun 25, 2026No releases on Jul 2, 2026No releases on Jul 9, 2026No releases on Jul 16, 2026No releases on Jul 23, 2026No releases on Jul 30, 2026No releases on Aug 6, 2026
FridayNo releases on May 1, 20261 release on May 8, 2026No releases on May 15, 2026No releases on May 22, 2026No releases on May 29, 2026No releases on Jun 5, 2026No releases on Jun 12, 2026No releases on Jun 19, 2026No releases on Jun 26, 2026No releases on Jul 3, 2026No releases on Jul 10, 20261 release on Jul 17, 2026No releases on Jul 24, 2026No releases on Jul 31, 2026No releases on Aug 7, 2026
SaturdayNo releases on May 2, 2026No releases on May 9, 20262 releases on May 16, 2026No releases on May 23, 2026No releases on May 30, 2026No releases on Jun 6, 2026No releases on Jun 13, 2026No releases on Jun 20, 2026No releases on Jun 27, 2026No releases on Jul 4, 2026No releases on Jul 11, 2026No releases on Jul 18, 20261 release on Jul 25, 2026No releases on Aug 1, 2026No releases on Aug 8, 2026

11 releases since Apr 10, 2026, busiest day 2

Changelog

v0.29.5

0.29.5

Fixed 2
  • Fix infinite type check recursion
  • Add missing beforeThrow calls in getInflightQueryAbortHandler

Hey 👋

A small batch of bug fixes. Please report any issues. 🤞😰🤞

TypeScript 7 is allowing for deeper computations which now cause way more instantiations and wall clock times in various scenarios. We're diving deep into our types and finding optimizations. In this version @koskimas brought some nice wins for builder vs. builder assignability checks.

We're also revamping the docs site, working on style, message and usefulness. Swing by our Discord and share your opinions/ideas. We got docs->apidocs search now. The playground is back supporting short links and will allow saving short links very soon.

🚀 Features
🐞 Bugfixes
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
What's Changed

Full Changelog: https://github.com/kysely-org/kysely/compare/v0.29.4...v0.29.5

View originalPermalink
How v0.29.5 went
v0.30.0-beta.1Pre-release

0.30.0-beta.1

Added 5
  • Add transactionMode property to Migrator accepting 'per-run', 'per-migration', or 'none' to control transaction behavior across migrations
  • Add defineMigration helper function to simplify migration writing and contract requirements
  • Add migrateTo(name, { direction: 'Up' | 'Down' }) method to Migrator to enforce migration direction
  • Support mysql2/promise in MysqlDialect in addition to the callback-based mysql2 import
  • Deny passing BLOB-like columns to SQLite JSON helpers with compile-time type errors
Changed 1
  • Per-migration transaction configuration now allows each migration to specify whether it runs in its own transaction via config: { transaction: false }
Deprecated 1
  • Deprecate disableTransactions option in favor of transactionMode property

Hey 👋

0.30 season is upon us. pnpm i kysely@next and get a sneak peak into the future!

We've got a new transactionMode: 'per-run' | 'per-migration' | 'none' property you can pass to Migrator or it's methods.

  • 'per-run' is the classic behavior you're used to where kysely wrap the entire run in a transaction when your dialect supports transactional DDL.
  • 'per-migration' enables each migration to pick whether it runs in its own transaction or not. Just expose config: { transaction: false } from the module, right next to the up/down functions.
  • 'none' means no transactions are used, which is similar to the now deprecated disableTransactions: true.
import * as fs from 'node:fs/promises'
import * as path from 'node:path'
import { FileMigrationProvider, Migrator } from 'kysely/migration'

const migrator = new Migrator({
  db,
  provider: new FileMigrationProvider({
    fs,
    migrationFolder: path.join(import.meta.dirname, 'migrations'),
  }),
  transactionMode: 'per-migration', // <-------------------------------
})

await migrator.migrateToLatest()

We've got a new defineMigration helper function that you can use to easily write your migrations and meet the contract requirements:

import { defineMigration } from 'kysely/migration'

export default defineMigration({
  up: async (db) => {
    // ...
  },

  config: { transaction: false }, // <--------------------
})

You can now use mysql2/promise, where in the past it would hang forever since we only supported the callback style of mysql2 root import.

🚀 Features
PostgreSQL 🐘 / MSSQL 🥅
MySQL 🐬
SQLite 📘
🐞 Bugfixes
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
  • disableTransactions is deprecated. Use the new transactionMode: 'none', or transactionMode: 'per-migration' with combination of config: { transaction: false }.
SQLite 📘
  • Trying to pass records with BLOB columns in JSON helpers emits compile-time errors - e.g.
    KyselyTypeError<'SQLite does not support passing `BLOB` values to `json_object`. Cast to `TEXT`.'>
    
🐤 New Contributors
What's Changed

Full Changelog: https://github.com/kysely-org/kysely/compare/4ba0bd495a4cbe11d8d58ef02537586dc4d56532...v0.30.0-beta.1

View originalPermalink
How v0.30.0-beta.1 went
v0.30.0-beta.0Pre-release

0.30.0-beta.0

Added 4
  • Add transactionMode property to Migrator supporting 'per-run', 'per-migration', and 'none' modes
  • Add defineMigration helper function for writing migrations with explicit contract requirements
  • Enable per-migration transaction configuration via config.transaction property
  • Add compile-time errors when passing BLOB columns to SQLite JSON helpers
Changed 1
  • SQLite JSON helpers now enforce compile-time type checking to prevent BLOB value usage
Deprecated 1
  • Deprecate disableTransactions in favor of transactionMode

Hey 👋

0.30 season is upon us. pnpm i kysely@next and get a sneak peak into the future!

We've got a new transactionMode: 'per-run' | 'per-migration' | 'none' property you can pass to Migrator or it's methods.

  • 'per-run' is the classic behavior you're used to where kysely wrap the entire run in a transaction when your dialect supports transactional DDL.
  • 'per-migration' enables each migration to pick whether it runs in its own transaction or not. Just expose config: { transaction: false } from the module, right next to the up/down functions.
  • 'none' means no transactions are used, which is similar to the now deprecated disableTransactions: true.
import * as fs from 'node:fs/promises'
import * as path from 'node:path'
import { FileMigrationProvider, Migrator } from 'kysely/migration'

const migrator = new Migrator({
  db,
  provider: new FileMigrationProvider({
    fs,
    migrationFolder: path.join(import.meta.dirname, 'migrations'),
  }),
  transactionMode: 'per-migration', // <-------------------------------
})

await migrator.migrateToLatest()

We've got a new defineMigration helper function that you can use to easily write your migrations and meet the contract requirements:

import { defineMigration } from 'kysely/migration'

export default defineMigration({
  up: async (db) => {
    // ...
  },

  config: { transaction: false }, // <--------------------
})
🚀 Features
PostgreSQL 🐘 / MSSQL 🥅
SQLite 📘
🐞 Bugfixes
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
  • disableTransactions is deprecated. Use the new transactionMode: 'none', or transactionMode: 'per-migration' with combination of config: { transaction: false }.
SQLite 📘
  • Trying to pass records with BLOB columns in JSON helpers emits compile-time errors - e.g.
    KyselyTypeError<'SQLite does not support passing `BLOB` values to `json_object`. Cast to `TEXT`.'>
    
🐤 New Contributors
What's Changed

Full Changelog: https://github.com/kysely-org/kysely/compare/4ba0bd495a4cbe11d8d58ef02537586dc4d56532...v0.30.0-beta.0

View originalPermalink
How v0.30.0-beta.0 went
v0.29.4

0.29.4

Fixed 2
  • Fix PostgreSQL password not being passed to control client
  • Fix SQLite returning clauses wrongly output after order by and limit in delete queries

Hey 👋

A small batch of bug fixes. Please report any issues. 🤞😰🤞

🚀 Features
🐞 Bugfixes
PostgreSQL 🐘
SQLite 📘
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
What's Changed

Full Changelog: https://github.com/kysely-org/kysely/compare/v0.29.3...v0.29.4

View originalPermalink
How v0.29.4 went
v0.29.3

0.29.3

Fixed 1
  • PostgreSQL and MSSQL migrations are not running exclusively when disableTransactions: true

Hey 👋

A small batch of bug fixes. Please report any issues. 🤞😰🤞

🚀 Features
🐞 Bugfixes
PostgreSQL 🐘 / MSSQL 🥅
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
What's Changed

Full Changelog: https://github.com/kysely-org/kysely/compare/v0.29.2...v0.29.3

View originalPermalink
How v0.29.3 went
v0.29.2

0.29.2

Fixed 1
  • $narrowType mishandling branded types

Hey 👋

A small batch of bug fixes. Please report any issues. 🤞😰🤞

🚀 Features
🐞 Bugfixes
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
What's Changed

Full Changelog: https://github.com/kysely-org/kysely/compare/v0.29.1...v0.29.2

View originalPermalink
How v0.29.2 went
v0.29.1

0.29.1

Fixed 1
  • Fix regression in piping of plugins' result transformations

Hey 👋

A small batch of bug fixes. Please report any issues. 🤞😰🤞

🚀 Features
🐞 Bugfixes
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
What's Changed

Full Changelog: https://github.com/kysely-org/kysely/compare/v0.29.0...v0.29.1

View originalPermalink
How v0.29.1 went
v0.29.0

0.29.0

Added 13
  • Add `$pickTables` and `$omitTables` compile-time helpers to narrow the database schema view for downstream queries
  • Add `ReadonlyKysely<DB>` helper type to create compile-time readonly database instances
  • Add PGliteDialect for PGlite database support
  • Add `supportsMultipleConnections` adapter flag with centralized connection mutex for single-connection adapters
  • Enhance `$narrowType` to support nested narrowing and discriminated unions
  • Add web standards driven query cancellation support with `signal` parameter and `inflightQueryAbortStrategy` option
Deprecated 1
  • Deprecate `withTables` in favor of `$pickTables`, `$omitTables`, and `$extendTables

Hey 👋

This one's a banger! 💥 💥 💥

We got $pickTables, $omitTables compile-time helpers to narrow the world view of downstream queries, cutting down on compilation complexity/time while at it!

const results = await db
  .$pickTables<'person' | 'pet'>() // <----- now `DB` is only { person: {...}, pet: {...} } for following methods.
  .selectFrom('person')
  .innerJoin('pet', 'pet.owner_id', 'person.id')
  .selectAll()
  .execute()

const results = await db
  .$omitTables<'toy'>() // <----- now `DB` doesn't have a "toy" table description for following methods.
  .selectFrom('person')
  .innerJoin('pet', 'pet.owner_id', 'person.id')
  .selectAll()
  .execute()

We got a new ReadonlyKysely<DB> helper type that turns your instance into a compile-time readonly instance!

import { Kysely } from 'kysely'
import type { ReadonlyKysely } from 'kysely/readonly'

export const db = new Kysely<Database>({...}) as never as ReadonlyKysely<Database>

db.selectFrom('person').selectAll() // no problem.
db.selectNoFrom(sql`now()`.as('now')) // no problem.

db.deleteFrom('person') // compilation error + deprecation!
db.insertInto('person').values({...}) // compilation error + deprecation!
db.mergeInto('person')...  // compilation error + deprecation!
db.updateTable('person').set('first_name', 'Timmy') // compilation error + deprecation!
sql`...`.execute(db) // compilation error!
// etc. etc.

We got a brand new PGlite dialect. With it comes a new supportsMultipleConnections adapter flag that uses a new centralized connection mutex when false - should help simplify all SQLite dialects out here!

import { PGlite } from '@electric-sql/pglite'
import { Kysely, PGliteDialect } from 'kysely'

const db = new Kysely<DB>({
  // ...
  dialect: new PGliteDialect({
    pglite: new PGlite(),
  }),
  // ...
})

We got $narrowType supporting nested narrowing and discriminated unions!

db.selectFrom('person_metadata')
  .select(['discriminatedUnionProfile']) 
  // output type inferred as:
  //
  // {
  //   discriminatedUnionProfile: {
  //     auth:
  //       | { type: 'token'; token: string }
  //       | { type: 'session'; session_id: string }
  //     tags: string[]
  //   }
  // }[]
  .$narrowType<{ discriminatedUnionProfile: { auth: { type: 'token' } } }>()
  // output type narrowed to:
  // 
  // {
  //   discriminatedUnionProfile: {
  //     auth: { type: 'token'; token: string }
  //     tags: string[]
  //   }
  // }[]
  .execute()

We got web standards driven query cancellation support. Pass an abort signal to execute* methods and similar. Pick between different inflight query abort strategies - ignore the query, cancel it on the database side or even kill the session on the database side.

  import { Kysely, PostgresDialect } from 'kysely'
  import { Client, ... } from 'pg'

  const db = new Kysely<Database>({
    dialect: new PostgresDialect({
      // ...
      controlClient: Client, // optional, for out-of-pool connections for database side query aborts.
      // ...
    })
  })

  const options = { signal: AbortSignal.timeout(3_000) } // throw abort/timeout errors and ignore query reuslts

  query.execute(options)
  query.stream(options)
  sql`...`.execute(db, options)
  db.executeQuery(compiledQuery, options)
  // etc. etc.

  query.execute({ ...options, inflightQueryAbortStrategy: 'cancel query' }) // also cancel query database side
  query.execute({ ...options, inflightQueryAbortStrategy: 'kill session' }) // also kill session database side

We got SafeNullComparisonPlugin to flip (in)equality operators to is and is not when right hand side argument is null.

import { Kysely, SafeNullComparisonPlugin } from 'kysely'

const db = new Kysely<DB>({
  // ...
  plugins: [new SafeNullComparisonPlugin()],
  // ...
})

db.selectFrom('pet')
  .where('name', '=', null) // outputs: "name" is null
  .where('owner_id', '!=', null) // outputs: "owner_id" is not null
  .selectAll()

We got a new shouldParse(value, path) option in ParseJSONResultsPlugin for granular control of what gets JSON.parse'd and what stays a string using JSON paths.

import { JSONParseResultsPlugin } from 'kysely'

db.selectFrom('person')
  .select((eb) => jsonArrayFrom(
	  eb.selectFrom('pet')
      .where('pet.owner_id', '=', 'person.id')
 	    .selectAll()
  ).as('pets'))
  .withPlugin(new JSONParseResultsPlugin({ 
    shouldParse: (_value, path) => {
      // parse only the pets array
      if (path.endsWith('."pets"')) {
        return true
      }
    
      return false
    } 
  }))
🚀 Features
PostgreSQL 🐘 / MySQL 🐬
PostgreSQL 🐘 / MSSQL 🥅
PostgreSQL 🐘
MySQL 🐬
MSSQL 🥅
PGlite 🟨
🐞 Bugfixes
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
  • Migrator, FileMigrationProvider and other migration related things are now exported from 'kysely/migration'. Importing from 'kysely' will provide an informative error message at compilation time.

    -import { Migrator, FileMigrationProvider } from 'kysely'
    +import { Migrator, FileMigrationProvider } from 'kysely/migration'
    
  • Minimum TypeScript version is now 5.4. Versions 5.3 and older will get a very aggressive compilation error.

  • The library no longer ships CommonJS files. Use a Node.js version that supports require(esm), or use dynamic imports. ES Modules files have moved from /dist/esm/ to /dist/.

  • TypeScript build target was bumped to 'es2023'.

  • sql.value and sql.literal were removed after spending a long time in deprecation. Use sql.val and sql.lit instead.

  • db.executeQuery's queryId 2nd argument has been replaced with options?: AbortableQueryOptions after spending a long time in deprecation.

  • QueryResult.numUpdatedOrDeletedRows has been removed after spending a long time in deprecation. Dialects that use it need to be updated to use QueryResult.numAffectedRows instead.

  • UniqueConstraintNode.columns widened from ReadonlyArray<ColumnNode> to ReadonlyArray<OperationNode>.

  • ExpressionBuilder.withSchema has been removed after spending a long time in deprecation.

  • DatabaseIntrospector.getMetadata has been removed after spending a long time in deprecation. Use DatabaseIntrospector.getTables instead.

  • MssqlDialectConfig.Tedious.resetConnectionOnRelease has been removed after spending a long time in deprecation. Use MssqlDialectConfig.resetConnectionsOnRelease instead.

  • MssqlDialectConfig.Tarn.options.validateConnections has been removed after spending a long time in deprecation. Use MssqlDialectConfig.validateConnections instead.

  • InsertQueryNode.ignore has been removed after spending a long time in deprecation. Use InsertQueryNode.orAction instead.

  • PrimaryConstraintNode has been removed after spending a long time in deprecation. Use PrimaryKeyConstraintNode instead.

  • DropTablexNodeParams has been removed after spending a long time in deprecation. Use DropTableNodeParams instead.

🐤 New Contributors

Full Changelog: https://github.com/kysely-org/kysely/compare/v0.28.17...v0.29.0

View originalPermalink
How v0.29.0 went
v0.28.17

0.28.17

Fixed 1
  • Further harden JSON path .key(...) and .at(...) against SQL injections and exfiltrations

Hey 👋

A small batch of bug fixes. Please report any issues. 🤞😰🤞

0.29 is right around the corner. Try the latest RC version!

🚀 Features
🐞 Bugfixes
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
What's Changed

Full Changelog: https://github.com/kysely-org/kysely/compare/v0.28.16...v0.28.17

View originalPermalink
How v0.28.17 went
v0.29.0-rc.0Pre-release

0.29.0-rc.0

Added 14
  • Add `$pickTables` and `$omitTables` compile-time helpers to narrow the table view of downstream queries
  • Add `ReadonlyKysely<DB>` helper type to turn instances into compile-time readonly instances
  • Add PGliteDialect for PGlite support
  • Add `supportsMultipleConnections` adapter flag for centralized connection mutex in single-connection adapters
  • Add support for nested narrowing and discriminated unions in `$narrowType`
  • Add web standards driven query cancellation support with abort signal and configurable inflight query abort strategies
Deprecated 1
  • Deprecate `withTables` in favor of `$pickTables`, `$omitTables`, and `$extendTables`

Hey 👋

This one's a banger! 💥 💥 💥

pnpm i kysely@next

We got $pickTables, $omitTables compile-time helpers to narrow the world view of downstream queries, cutting down on compilation complexity/time while at it!

const results = await db
  .$pickTables<'person' | 'pet'>() // <----- now `DB` is only { person: {...}, pet: {...} } for following methods.
  .selectFrom('person')
  .innerJoin('pet', 'pet.owner_id', 'person.id')
  .selectAll()
  .execute()

const results = await db
  .$omitTables<'toy'>() // <----- now `DB` doesn't have a "toy" table description for following methods.
  .selectFrom('person')
  .innerJoin('pet', 'pet.owner_id', 'person.id')
  .selectAll()
  .execute()

We got a new ReadonlyKysely<DB> helper type that turns your instance into a compile-time readonly instance!

import { Kysely } from 'kysely'
import type { ReadonlyKysely } from 'kysely/readonly'

export const db = new Kysely<Database>({...}) as never as ReadonlyKysely<Database>

db.selectFrom('person').selectAll() // no problem.
db.selectNoFrom(sql`now()`.as('now')) // no problem.

db.deleteFrom('person') // compilation error + deprecation!
db.insertInto('person').values({...}) // compilation error + deprecation!
db.mergeInto('person')...  // compilation error + deprecation!
db.updateTable('person').set('first_name', 'Timmy') // compilation error + deprecation!
sql`...`.execute(db) // compilation error!
// etc. etc.

We got a brand new PGlite dialect. With it comes a new supportsMultipleConnections adapter flag that uses a new centralized connection mutex when false - should help simplify all SQLite dialects out here!

import { PGlite } from '@electric-sql/pglite'
import { Kysely, PGliteDialect } from 'kysely'

const db = new Kysely<DB>({
  // ...
  dialect: new PGliteDialect({
    pglite: new PGlite(),
  }),
  // ...
})

We got $narrowType supporting nested narrowing and discriminated unions!

db.selectFrom('person_metadata')
  .select(['discriminatedUnionProfile']) 
  // output type inferred as:
  //
  // {
  //   discriminatedUnionProfile: {
  //     auth:
  //       | { type: 'token'; token: string }
  //       | { type: 'session'; session_id: string }
  //     tags: string[]
  //   }
  // }[]
  .$narrowType<{ discriminatedUnionProfile: { auth: { type: 'token' } } }>()
  // output type narrowed to:
  // 
  // {
  //   discriminatedUnionProfile: {
  //     auth: { type: 'token'; token: string }
  //     tags: string[]
  //   }
  // }[]
  .execute()

We got web standards driven query cancellation support. Pass an abort signal to execute* methods and similar. Pick between different inflight query abort strategies - ignore the query, cancel it on the database side or even kill the session on the database side.

  import { Kysely, PostgresDialect } from 'kysely'
  import { Client, ... } from 'pg'

  const db = new Kysely<Database>({
    dialect: new PostgresDialect({
      // ...
      controlClient: Client, // optional, for out-of-pool connections for database side query aborts.
      // ...
    })
  })

  const options = { signal: AbortSignal.timeout(3_000) } // throw abort/timeout errors and ignore query reuslts

  query.execute(options)
  query.stream(options)
  sql`...`.execute(db, options)
  db.executeQuery(compiledQuery, options)
  // etc. etc.

  query.execute({ ...options, inflightQueryAbortStrategy: 'cancel query' }) // also cancel query database side
  query.execute({ ...options, inflightQueryAbortStrategy: 'kill session' }) // also kill session database side

We got SafeNullComparisonPlugin to flip (in)equality operators to is and is not when right hand side argument is null.

import { Kysely, SafeNullComparisonPlugin } from 'kysely'

const db = new Kysely<DB>({
  // ...
  plugins: [new SafeNullComparisonPlugin()],
  // ...
})

db.selectFrom('pet')
  .where('name', '=', null) // outputs: "name" is null
  .where('owner_id', '!=', null) // outputs: "owner_id" is not null
  .selectAll()

We got a new shouldParse(value, path) option in ParseJSONResultsPlugin for granular control of what gets JSON.parse'd and what stays a string using JSON paths.

import { JSONParseResultsPlugin } from 'kysely'

db.selectFrom('person')
  .select((eb) => jsonArrayFrom(
	  eb.selectFrom('pet')
      .where('pet.owner_id', '=', 'person.id')
 	    .selectAll()
  ).as('pets'))
  .withPlugin(new JSONParseResultsPlugin({ 
    shouldParse: (_value, path) => {
      // parse only the pets array
      if (path.endsWith('.pets')) {
        return true
      }
    
      return false
    } 
  }))
🚀 Features
PostgreSQL 🐘 / MySQL 🐬
PostgreSQL 🐘 / MSSQL 🥅
PostgreSQL 🐘
MySQL 🐬
MSSQL 🥅
PGlite 🟨
🐞 Bugfixes
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
  • Migrator, FileMigrationProvider and other migration related things are now exported from 'kysely/migration'. Importing from 'kysely' will provide an informative error message at compilation time.

    -import { Migrator, FileMigrationProvider } from 'kysely'
    +import { Migrator, FileMigrationProvider } from 'kysely/migration'
    
  • Minimum TypeScript version is now 5.4. Versions 5.3 and older will get a very aggressive compilation error.

  • The library no longer ships CommonJS files. Use a Node.js version that supports require(esm), or use dynamic imports. ES Modules files have moved from /dist/esm/ to /dist/.

  • TypeScript build target was bumped to 'es2023'.

  • sql.value and sql.literal were removed after spending a long time in deprecation. Use sql.val and sql.lit instead.

  • db.executeQuery's queryId 2nd argument has been replaced with options?: AbortableQueryOptions after spending a long time in deprecation.

  • QueryResult.numUpdatedOrDeletedRows has been removed after spending a long time in deprecation. Dialects that use it need to be updated to use QueryResult.numAffectedRows instead.

  • UniqueConstraintNode.columns widened from ReadonlyArray<ColumnNode> to ReadonlyArray<OperationNode>.

🐤 New Contributors

Full Changelog: https://github.com/kysely-org/kysely/compare/v0.28.16...v0.29.0-rc.0

View originalPermalink
How v0.29.0-rc.0 went
v0.28.16

0.28.16

Fixed 1
  • FilterObject allows any defined value when query context has no tables (TB is never)

Hey 👋

A small batch of bug fixes. Please report any issues. 🤞😰🤞

0.29 is getting closer btw. 🌶️

🚀 Features
🐞 Bugfixes
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
What's Changed

Full Changelog: https://github.com/kysely-org/kysely/compare/v0.28.15...v0.28.16

View originalPermalink
How v0.28.16 went
View all

Discussion