Update dependency kysely to ^0.29.0 #964

Open
renovate-bot wants to merge 1 commit from renovate/kysely into main
Collaborator

This PR contains the following updates:

Package Change Age Confidence
kysely (source) ^0.28.0^0.29.0 age confidence

Release Notes

kysely-org/kysely (kysely)

v0.29.5: 0.29.5

Compare Source

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

v0.29.4: 0.29.4

Compare Source

Hey 👋

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

🚀 Features

🐞 Bugfixes

PostgreSQL 🐘
SQLite 📘
  • fix(sqlite): returning clauses wrongfuly output after order by and limit in delete queries. by @​igalklebanov in #​1946

📖 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

v0.29.3: 0.29.3

Compare Source

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

v0.29.2: 0.29.2

Compare Source

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

v0.29.1: 0.29.1

Compare Source

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

v0.29.0: 0.29.0

Compare Source

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


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [kysely](https://kysely.dev) ([source](https://github.com/kysely-org/kysely)) | [`^0.28.0` → `^0.29.0`](https://renovatebot.com/diffs/npm/kysely/0.28.17/0.29.5) | ![age](https://developer.mend.io/api/mc/badges/age/npm/kysely/0.29.5?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/kysely/0.28.17/0.29.5?slim=true) | --- ### Release Notes <details> <summary>kysely-org/kysely (kysely)</summary> ### [`v0.29.5`](https://github.com/kysely-org/kysely/releases/tag/v0.29.5): 0.29.5 [Compare Source](https://github.com/kysely-org/kysely/compare/v0.29.4...v0.29.5) 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 [@&#8203;koskimas](https://github.com/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 - fix infinite type check recursion by [@&#8203;koskimas](https://github.com/koskimas) in [#&#8203;1960](https://github.com/kysely-org/kysely/pull/1960) - Add missing beforeThrow calls in getInflightQueryAbortHandler by [@&#8203;lourd](https://github.com/lourd) in [#&#8203;1971](https://github.com/kysely-org/kysely/pull/1971) #### 📖 Documentation - Fix typo in `CreateTypeBuilder.asEnum` docstring by [@&#8203;anonpay-sh](https://github.com/anonpay-sh) in [#&#8203;1949](https://github.com/kysely-org/kysely/pull/1949) - chore: revamp docs hero page. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1959](https://github.com/kysely-org/kysely/pull/1959) - fix(site): various issues with stats section. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1966](https://github.com/kysely-org/kysely/pull/1966) - chore(site): replace most text proof with logos. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1968](https://github.com/kysely-org/kysely/pull/1968) - feat(site): migrate to pagefind for cross-site search we own. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1972](https://github.com/kysely-org/kysely/pull/1972) - chore(site): drop self-narrating captions, make proof arrows a standing cue by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1973](https://github.com/kysely-org/kysely/pull/1973) - feat(site): grow the proof wall (Replicas, EmbedPDF) + fix production hover by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1974](https://github.com/kysely-org/kysely/pull/1974) - feat(site): add AirTrail, bknd, Civitai, Corsair.dev, Hot Updater, Profilarr and Tunarr to the proof wall. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1975](https://github.com/kysely-org/kysely/pull/1975) - feat(site): proof-strength gauges, query-module evidence, and new wall names by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1976](https://github.com/kysely-org/kysely/pull/1976) - feat(site): explain the proof gauge behind a (?) on the production wall by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1977](https://github.com/kysely-org/kysely/pull/1977) - feat(site): align docs code blocks with the landing page's VS Code themes by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1978](https://github.com/kysely-org/kysely/pull/1978) #### 📦 CICD & Tooling - chore: bump deps. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1979](https://github.com/kysely-org/kysely/pull/1979) - chore: bump github actions. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1980](https://github.com/kysely-org/kysely/pull/1980) #### ⚠️ Breaking Changes #### 🐤 New Contributors - [@&#8203;anonpay-sh](https://github.com/anonpay-sh) made their first contribution in [#&#8203;1949](https://github.com/kysely-org/kysely/pull/1949) - [@&#8203;lourd](https://github.com/lourd) made their first contribution in [#&#8203;1971](https://github.com/kysely-org/kysely/pull/1971) #### What's Changed **Full Changelog**: <https://github.com/kysely-org/kysely/compare/v0.29.4...v0.29.5> ### [`v0.29.4`](https://github.com/kysely-org/kysely/releases/tag/v0.29.4): 0.29.4 [Compare Source](https://github.com/kysely-org/kysely/compare/v0.29.3...v0.29.4) Hey 👋 A small batch of bug fixes. Please report any issues. 🤞😰🤞 #### 🚀 Features #### 🐞 Bugfixes ##### PostgreSQL 🐘 - fix: fix postgres password not being passed to control client by [@&#8203;CakeWithDivinity](https://github.com/CakeWithDivinity) & [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1944](https://github.com/kysely-org/kysely/pull/1944) ##### SQLite 📘 - fix(sqlite): returning clauses wrongfuly output after order by and limit in delete queries. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1946](https://github.com/kysely-org/kysely/pull/1946) #### 📖 Documentation #### 📦 CICD & Tooling - chore: bump dependencies. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1945](https://github.com/kysely-org/kysely/pull/1945) #### ⚠️ Breaking Changes #### 🐤 New Contributors - [@&#8203;CakeWithDivinity](https://github.com/CakeWithDivinity) made their first contribution in [#&#8203;1944](https://github.com/kysely-org/kysely/pull/1944) #### What's Changed **Full Changelog**: <https://github.com/kysely-org/kysely/compare/v0.29.3...v0.29.4> ### [`v0.29.3`](https://github.com/kysely-org/kysely/releases/tag/v0.29.3): 0.29.3 [Compare Source](https://github.com/kysely-org/kysely/compare/v0.29.2...v0.29.3) Hey 👋 A small batch of bug fixes. Please report any issues. 🤞😰🤞 #### 🚀 Features #### 🐞 Bugfixes ##### PostgreSQL 🐘 / MSSQL 🥅 - fix: PostgreSQL and MSSQL migrations are not running exclusively when `disableTransactions: true`. by [@&#8203;morgan-coded](https://github.com/morgan-coded) & [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1919](https://github.com/kysely-org/kysely/pull/1919) #### 📖 Documentation - docs: add kysely-durable-objects to community dialects by [@&#8203;jeffwilde](https://github.com/jeffwilde) in [#&#8203;1805](https://github.com/kysely-org/kysely/pull/1805) - docs: use new play.kysely.dev domain for the playground. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1874](https://github.com/kysely-org/kysely/pull/1874) - docs([#&#8203;1892](https://github.com/kysely-org/kysely/issues/1892)): add marshift/kysely-deno-sqlite3 to community dialects by [@&#8203;ltianyi992](https://github.com/ltianyi992) in [#&#8203;1901](https://github.com/kysely-org/kysely/pull/1901) #### 📦 CICD & Tooling - chore(deps-dev): bump tsx from 4.22.0 to 4.22.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1855](https://github.com/kysely-org/kysely/pull/1855) - chore(deps): bump hono from 4.12.18 to 4.12.19 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1854](https://github.com/kysely-org/kysely/pull/1854) - chore(deps): bump zizmorcore/zizmor-action from 0.5.4 to 0.5.6 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1853](https://github.com/kysely-org/kysely/pull/1853) - chore(deps): bump github/codeql-action from 4.35.4 to 4.35.5 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1850](https://github.com/kysely-org/kysely/pull/1850) - chore(deps-dev): bump [@&#8203;types/node](https://github.com/types/node) from 25.8.0 to 25.9.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1860](https://github.com/kysely-org/kysely/pull/1860) - chore(deps-dev): bump pg from 8.20.0 to 8.21.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1858](https://github.com/kysely-org/kysely/pull/1858) - chore(deps-dev): bump tsx from 4.22.1 to 4.22.3 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1863](https://github.com/kysely-org/kysely/pull/1863) - chore(deps): bump hono from 4.12.19 to 4.12.21 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1862](https://github.com/kysely-org/kysely/pull/1862) - chore(deps-dev): bump pg-cursor from 2.19.0 to 2.20.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1857](https://github.com/kysely-org/kysely/pull/1857) - chore(deps-dev): bump [@&#8203;types/node](https://github.com/types/node) from 25.9.0 to 25.9.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1866](https://github.com/kysely-org/kysely/pull/1866) - chore(ci): use pedantic `zizmor` persona. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1869](https://github.com/kysely-org/kysely/pull/1869) - chore(deps-dev): bump [@&#8203;electric-sql/pglite](https://github.com/electric-sql/pglite) from 0.4.5 to 0.4.6 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1881](https://github.com/kysely-org/kysely/pull/1881) - chore(deps): bump hono from 4.12.21 to 4.12.23 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1880](https://github.com/kysely-org/kysely/pull/1880) - chore: resolve audit vulnerabilities. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1882](https://github.com/kysely-org/kysely/pull/1882) - chore(ci): audit npm packages. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1883](https://github.com/kysely-org/kysely/pull/1883) - chore(deps-dev): bump mysql2 from 3.22.3 to 3.22.4 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1888](https://github.com/kysely-org/kysely/pull/1888) - chore(deps): bump github/codeql-action from 4.35.5 to 4.36.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1900](https://github.com/kysely-org/kysely/pull/1900) - chore(deps-dev): bump [@&#8203;arethetypeswrong/cli](https://github.com/arethetypeswrong/cli) from 0.18.2 to 0.18.3 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1899](https://github.com/kysely-org/kysely/pull/1899) - chore(deps): bump actions/checkout from 6.0.2 to 6.0.3 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1896](https://github.com/kysely-org/kysely/pull/1896) - chore(deps): bump step-security/harden-runner from 2.19.3 to 2.19.4 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1870](https://github.com/kysely-org/kysely/pull/1870) - chore(deps-dev): bump semver from 7.8.0 to 7.8.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1877](https://github.com/kysely-org/kysely/pull/1877) - chore: bump dependencies. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1920](https://github.com/kysely-org/kysely/pull/1920) - chore(deps-dev): bump [@&#8203;types/node](https://github.com/types/node) from 26.0.1 to 26.1.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1926](https://github.com/kysely-org/kysely/pull/1926) - chore(deps-dev): bump [@&#8203;ark/attest](https://github.com/ark/attest) from 0.56.1 to 0.56.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1925](https://github.com/kysely-org/kysely/pull/1925) - chore(deps-dev): bump [@&#8203;types/sinon](https://github.com/types/sinon) from 21.0.1 to 22.0.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1924](https://github.com/kysely-org/kysely/pull/1924) - chore(deps-dev): bump prettier from 3.9.1 to 3.9.4 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1923](https://github.com/kysely-org/kysely/pull/1923) #### ⚠️ Breaking Changes #### 🐤 New Contributors - [@&#8203;jeffwilde](https://github.com/jeffwilde) made their first contribution in [#&#8203;1805](https://github.com/kysely-org/kysely/pull/1805) - [@&#8203;ltianyi992](https://github.com/ltianyi992) made their first contribution in [#&#8203;1901](https://github.com/kysely-org/kysely/pull/1901) - [@&#8203;morgan-coded](https://github.com/morgan-coded) made their first contribution in [#&#8203;1919](https://github.com/kysely-org/kysely/pull/1919) #### What's Changed **Full Changelog**: <https://github.com/kysely-org/kysely/compare/v0.29.2...v0.29.3> ### [`v0.29.2`](https://github.com/kysely-org/kysely/releases/tag/v0.29.2): 0.29.2 [Compare Source](https://github.com/kysely-org/kysely/compare/v0.29.1...v0.29.2) Hey 👋 A small batch of bug fixes. Please report any issues. 🤞😰🤞 #### 🚀 Features #### 🐞 Bugfixes - fix: `$narrowType` mishandling branded types. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1851](https://github.com/kysely-org/kysely/pull/1851) #### 📖 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> ### [`v0.29.1`](https://github.com/kysely-org/kysely/releases/tag/v0.29.1): 0.29.1 [Compare Source](https://github.com/kysely-org/kysely/compare/v0.29.0...v0.29.1) Hey 👋 A small batch of bug fixes. Please report any issues. 🤞😰🤞 #### 🚀 Features #### 🐞 Bugfixes - fix: regression in piping of plugins' result transformations. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1840](https://github.com/kysely-org/kysely/pull/1840) #### 📖 Documentation #### 📦 CICD & Tooling - ci: test node.js v26. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1841](https://github.com/kysely-org/kysely/pull/1841) - ci: harden github workflows with the help of `zizmor` scans. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1843](https://github.com/kysely-org/kysely/pull/1843) - ci: split node tests by variant. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1848](https://github.com/kysely-org/kysely/pull/1848) #### ⚠️ Breaking Changes #### 🐤 New Contributors #### What's Changed **Full Changelog**: <https://github.com/kysely-org/kysely/compare/v0.29.0...v0.29.1> ### [`v0.29.0`](https://github.com/kysely-org/kysely/releases/tag/v0.29.0): 0.29.0 [Compare Source](https://github.com/kysely-org/kysely/compare/v0.28.17...v0.29.0) 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! ```ts 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! ```ts 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! ```ts 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! ```ts 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. ```ts 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`. ```ts 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. ```ts 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 - feat(utils): Allow explicit undefined in Updateable type (for exactOptionalPropertyTypes support) by [@&#8203;y-hsgw](https://github.com/y-hsgw) in [#&#8203;1496](https://github.com/kysely-org/kysely/pull/1496) - feat(migrator): allow disabling transactions in migrate methods. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1517](https://github.com/kysely-org/kysely/pull/1517) - feat: add `thenRef` method in `eb.case` by [@&#8203;ericsodev](https://github.com/ericsodev) in [#&#8203;1531](https://github.com/kysely-org/kysely/pull/1531) - feat: add `whenRef(lhs, op, rhs)` in `eb.case`. by [@&#8203;iam-abdul](https://github.com/iam-abdul) in [#&#8203;1598](https://github.com/kysely-org/kysely/pull/1598) - feat: add `elseRef` in `eb.case()` by [@&#8203;iam-abdul](https://github.com/iam-abdul) in [#&#8203;1601](https://github.com/kysely-org/kysely/pull/1601) - feat: add `$pickTables`, `$omitTables` and `$extendTables`, deprecate `withTables`. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1582](https://github.com/kysely-org/kysely/pull/1582) - feat: add `SafeNullComparisonPlugin` plugin by [@&#8203;rafaelalmeidatk](https://github.com/rafaelalmeidatk) in [#&#8203;1338](https://github.com/kysely-org/kysely/pull/1338) - feat: add more control through configuration @&#8203; `ParseJSONResultsPlugin`. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1453](https://github.com/kysely-org/kysely/pull/1453) - feat: allow expressions in create/add index's `column` and `columns` functions, deprecate their `expression` functions. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1664](https://github.com/kysely-org/kysely/pull/1664) - feat: add `with(name, query)`. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1702](https://github.com/kysely-org/kysely/pull/1702) - feat: expose migrations from 'kysely/migration'. deprecate migration exports in root. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1618](https://github.com/kysely-org/kysely/pull/1618) - refactor: bump minimum TypeScript version to 4.7. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1696](https://github.com/kysely-org/kysely/pull/1696) - refactor: bump minimum TypeScript version to 4.8. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1756](https://github.com/kysely-org/kysely/pull/1756) - refactor: bump minimum TypeScript version to 4.9. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1759](https://github.com/kysely-org/kysely/pull/1759) - refactor: bump minimum TypeScript version to 5.0. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1761](https://github.com/kysely-org/kysely/pull/1761) - refactor: bump minimum TypeScript version to 5.1. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1770](https://github.com/kysely-org/kysely/pull/1770) - refactor: bump minimum TypeScript version to 5.2. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1771](https://github.com/kysely-org/kysely/pull/1771) - refactor: bump minimum TypeScript version to 5.3. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1772](https://github.com/kysely-org/kysely/pull/1772) - refactor: bump minimum TypeScript version to 5.4. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1773](https://github.com/kysely-org/kysely/pull/1773) - feat: support narrowing by deep object keys in `NarrowPartial` by [@&#8203;ethanresnick](https://github.com/ethanresnick) in [#&#8203;1667](https://github.com/kysely-org/kysely/pull/1667) - feat: add `ReadonlyKysely<DB>` helper. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;218](https://github.com/kysely-org/kysely/pull/218) - refactor: replace `requireAllProps<T>(obj)` usage with `satisfies AllProps<T>`. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1787](https://github.com/kysely-org/kysely/pull/1787) - feat: allow overriding file import function @&#8203; `FileMigrationProvider`. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1661](https://github.com/kysely-org/kysely/pull/1661) - feat: query cancellation. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1796](https://github.com/kysely-org/kysely/pull/1796) & [#&#8203;1797](https://github.com/kysely-org/kysely/pull/1797) & [#&#8203;1798](https://github.com/kysely-org/kysely/pull/1798) & [`33e60df`](https://github.com/kysely-org/kysely/commit/33e60dfa6284263173ee7e678455ad410f8bf246) & [`b739e02`](https://github.com/kysely-org/kysely/commit/b739e0240cd885091508335ce16461da258c47f6) & [`4d7064f`](https://github.com/kysely-org/kysely/commit/4d7064f199bd107213597a5965c4d673ab9880a2) - refactor: remove long deprecated things. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1799](https://github.com/kysely-org/kysely/pull/1799) - fix(ParseJSONResultsPlugin): wrap object keys in quotes. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [`1e051c8`](https://github.com/kysely-org/kysely/commit/1e051c880a028eb37552bf241b1bc750f115cbf3) ##### PostgreSQL 🐘 / MySQL 🐬 - feat(Introspect): add support for postgres & mysql foreign tables by [@&#8203;williamluke4](https://github.com/williamluke4) in [#&#8203;1494](https://github.com/kysely-org/kysely/pull/1494) ##### PostgreSQL 🐘 / MSSQL 🥅 - feat(Migrator): allow passing transactions to `Migrator`. by [@&#8203;jlucaso1](https://github.com/jlucaso1) in [#&#8203;1480](https://github.com/kysely-org/kysely/pull/1480) - feat: support IF EXISTS in DROP COLUMN by [@&#8203;shuaixr](https://github.com/shuaixr) in [#&#8203;1692](https://github.com/kysely-org/kysely/pull/1692) ##### PostgreSQL 🐘 - feat: support dropping multiple types with schema.dropType(), cascade. by [@&#8203;aantia](https://github.com/aantia) in [#&#8203;1516](https://github.com/kysely-org/kysely/pull/1516) - feat: add alter type query support. by [@&#8203;lucianolix](https://github.com/lucianolix) in [#&#8203;1363](https://github.com/kysely-org/kysely/pull/1363) - refactor(postgres): refactor: optimize table metadata parsing in PostgresIntrospector by [@&#8203;rubenferreira97](https://github.com/rubenferreira97) in [`ba89cc3`](https://github.com/kysely-org/kysely/commit/ba89cc338690f40d07f59a99a741b78a6a992f0d) ##### MySQL 🐬 - feat: allow expressions in unique constraint by [@&#8203;ericsodev](https://github.com/ericsodev) in [#&#8203;1518](https://github.com/kysely-org/kysely/pull/1518) - feat: Add support for dropping temporary tables with temporary() modifier by [@&#8203;szalonna](https://github.com/szalonna) in [#&#8203;1615](https://github.com/kysely-org/kysely/pull/1615) - feat: add `addIndex` to `CreateTableBuilder` by [@&#8203;alenap93](https://github.com/alenap93) in [#&#8203;1352](https://github.com/kysely-org/kysely/pull/1352) ##### MSSQL 🥅 - feat: add `datetime2` data type support. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1792](https://github.com/kysely-org/kysely/pull/1792) ##### PGlite 🟨 - feat: add PGlite dialect. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1510](https://github.com/kysely-org/kysely/pull/1510) #### 🐞 Bugfixes #### 📖 Documentation #### 📦 CICD & Tooling - chore: improve TypeScript benchmarks. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1757](https://github.com/kysely-org/kysely/pull/1757) - chore: add returning.bench.ts by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [`65b6ec4`](https://github.com/kysely-org/kysely/commit/65b6ec4abe15101ea2fad61e01b89fecf762ad40) - chore: enhance returning benchmarks. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [`b23085a`](https://github.com/kysely-org/kysely/commit/b23085acc23f3aeaa2764006ca327bc72919d108) - chore: add selectNoFrom benchmarks. [@&#8203;igalklebanov](https://github.com/igalklebanov) in [`8193d37`](https://github.com/kysely-org/kysely/commit/8193d3716dea0a8c0a93e882cc0450966900073e) - test: fix TypeScript 5.4.0 test following target bump to es2023. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1780](https://github.com/kysely-org/kysely/pull/1780) - chore: drop CommonJS distribution. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1782](https://github.com/kysely-org/kysely/pull/1782) - chore(ci): support rc publishes from next branch. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [`585bf60`](https://github.com/kysely-org/kysely/commit/585bf60c6d93cf01db39e196be32f12a2c8a7f01) - chore: bump dependencies. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1810](https://github.com/kysely-org/kysely/pull/1810) - chore: migrate to pnpm 11. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1811](https://github.com/kysely-org/kysely/pull/1811) - add dependabot. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [`7f98851`](https://github.com/kysely-org/kysely/commit/7f988516d414027ba658d5f3100f8eba0aa2a36d) - chore: remove npm bump in publish workflow. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [`9e0bfc0`](https://github.com/kysely-org/kysely/commit/9e0bfc0bf0f32d9a3828e4b1557efb7287ef721b) - fix(ci): better-sqlite3 node.js version mismatches since pnpm action bump. by [@&#8203;igalklebanov](https://github.com/igalklebanov) in [#&#8203;1820](https://github.com/kysely-org/kysely/pull/1820) #### ⚠️ 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. ```diff -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 - [@&#8203;y-hsgw](https://github.com/y-hsgw) made their first contribution in [#&#8203;1496](https://github.com/kysely-org/kysely/pull/1496) - [@&#8203;williamluke4](https://github.com/williamluke4) made their first contribution in [#&#8203;1494](https://github.com/kysely-org/kysely/pull/1494) - [@&#8203;ericsodev](https://github.com/ericsodev) made their first contribution in [#&#8203;1518](https://github.com/kysely-org/kysely/pull/1518) - [@&#8203;aantia](https://github.com/aantia) made their first contribution in [#&#8203;1516](https://github.com/kysely-org/kysely/pull/1516) - [@&#8203;iam-abdul](https://github.com/iam-abdul) made their first contribution in [#&#8203;1598](https://github.com/kysely-org/kysely/pull/1598) - [@&#8203;szalonna](https://github.com/szalonna) made their first contribution in [#&#8203;1615](https://github.com/kysely-org/kysely/pull/1615) - [@&#8203;rafaelalmeidatk](https://github.com/rafaelalmeidatk) made their first contribution in [#&#8203;1338](https://github.com/kysely-org/kysely/pull/1338) - [@&#8203;jlucaso1](https://github.com/jlucaso1) made their first contribution in [#&#8203;1480](https://github.com/kysely-org/kysely/pull/1480) - [@&#8203;lucianolix](https://github.com/lucianolix) made their first contribution in [#&#8203;1363](https://github.com/kysely-org/kysely/pull/1363) - [@&#8203;shuaixr](https://github.com/shuaixr) made their first contribution in [#&#8203;1692](https://github.com/kysely-org/kysely/pull/1692) - [@&#8203;rubenferreira97](https://github.com/rubenferreira97) made their first contribution in [`ba89cc3`](https://github.com/kysely-org/kysely/commit/ba89cc338690f40d07f59a99a741b78a6a992f0d) **Full Changelog**: <https://github.com/kysely-org/kysely/compare/v0.28.17...v0.29.0> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC40LjIiLCJ1cGRhdGVkSW5WZXIiOiI0NC4xNy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Update dependency kysely to ^0.29.0
Some checks failed
Build / build (pull_request) Failing after 36s
Cypress / cypress (pull_request) Failing after 21m52s
c491e1ebf0
Some checks are pending
Build / build (pull_request) Failing after 36s
Cypress / cypress (pull_request) Failing after 21m52s
Build / setup (pull_request)
Required
Build / unit (pull_request)
Required
Build / cypress (pull_request)
Required
This pull request is blocked because it's outdated.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/kysely:renovate/kysely
git switch renovate/kysely
Sign in to join this conversation.
No description provided.