kysely-org/kysely (kysely)
Compare Source
Hey 👋
A small batch of bug fixes. Please report any issues. 🤞😰🤞
🚀 Features
🐞 Bugfixes
PostgreSQL 🐘
- fix: filter schemas the current user does not have access to in postres introspector by@chanon in#1550
- fix: insert/update not being wrapped in parens when in CTE of a merge query. by@igalklebanov &@msifd in#1611
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
Full Changelog:kysely-org/kysely@v0.28.7...v0.28.8
Compare Source
Hey 👋
A small batch of bug fixes. Please report any issues. 🤞😰🤞
🚀 Features
🐞 Bugfixes
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
Full Changelog:kysely-org/kysely@v0.28.6...v0.28.7
Compare Source
Hey 👋
A small batch of bug fixes. Please report any issues. 🤞😰🤞
Docs site has been optimized and all we got was this animation:

🚀 Features
🐞 Bugfixes
PostgreSQL 🐘 / MSSQL 🥅
MySQL 🐬
- fix(dialect/mysql): compatibility with mysql2@3.14.5 by@jeengbe in#1574.
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
Full Changelog:kysely-org/kysely@v0.28.5...v0.28.6
Compare Source
Hey 👋
A small batch of bug fixes. Please report any issues. 🤞😰🤞
🚀 Features
🐞 Bugfixes
- fix:
Buffer breakingShallowDehydrateValue in non-Node.js TypeScript environments. by@igalklebanov in#1542.
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
Full Changelog:kysely-org/kysely@v0.28.4...v0.28.5
Compare Source
Hey 👋
A small batch of bug fixes. Please report any issues. 🤞😰🤞
🚀 Features
🐞 Bugfixes
- fix: ShallowDehydrateValue mishandles null & undefined, and bigint / numeric strings. by@igalklebanov in#1529
PostgreSQL 🐘
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
Full Changelog:kysely-org/kysely@v0.28.3...v0.28.4
Compare Source
Hey 👋
A small batch of bug fixes. Please report any issues. 🤞😰🤞
🚀 Features
CockroachDB 🟣
- fix: filter out internal cockroachdb schemas in postgres introspector by@yawhide in#1459
🐞 Bugfixes
- fix(Migrator): NO_MIGRATIONS comparison fails in dup Kysely scenarios. by@igalklebanov in#1475
- Fix
Kysely<any> type errors with narrow table name types by@koskimas in#1443 - fix
AsyncDisposable usage erroring for older TypeScript versions. by@igalklebanov in#1507 - fix(helpers): JSON helpers' return types incorrectly have
Dates and other JS/Node-native instances that require data type metadata. by@igalklebanov in#1477
MySQL 🐬 / MS SQL Server 🥅
- fix: bigint immediates are appended as string literals instead of numbers. by@igalklebanov in#1445
MS SQL Server 🥅
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
Full Changelog:kysely-org/kysely@0.28.2...v0.28.3
Compare Source
Hey 👋
v0.28 broke an undocumented TypeScript behavior our API had that allowed you to pass table name unions to query builders and enable some DRYing of queries. Seeing that this pattern was quite popular, we decided to support it officially with the addition of thetable method in the dynamic module.
You can pull off some crazy complex stuff like:
asyncfunctiongetRowByColumn<TextendskeyofDatabase,CextendskeyofDatabase[T]&string,VextendsSelectType<Database[T][C]>,>(t:T,c:C,v:V){// We need to use the dynamic module since the table name// is not known at compile time.const{ table, ref}=db.dynamicreturnawaitdb.selectFrom(table(t).as('t')).selectAll().where(ref(c),'=',v)// `id` can be directly referenced since every table has it..orderBy('t.id').executeTakeFirstOrThrow()}constperson=awaitgetRowByColumn('person','first_name','Arnold')...and it'll narrow the downstream query context to the intersection of all the possible shapes of tables in the union type. (DONT DO THIS AT HOME KIDS!)
A simpler example would be:
asyncfunctiondeleteItem(id:string,table:'person'|'pet'){awaitdb.deleteFrom(db.dynamic.table(table).as('t')).where('id','=',id).executeTakeFirstOrThrow()}If you attempt to refer to a column that doesn't exist in both "person" and "pet" (e.g. "pet"'s "species" column), the compiler will correctly yell at you.
🚀 Features
🐞 Bugfixes
SQLite 📘
- fix: SQLite's introspector is printing deprecation errors for
orderBy(array). by@igalklebanov in#1435
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
Full Changelog:kysely-org/kysely@0.28.1...0.28.2
Compare Source
Hey 👋
Just a small crucial bug fix release. Please inform us if you see any more regressions sincev0.28. 🙏
🚀 Features
🐞 Bugfixes
PostgreSQL 🐘
- pg introspector - Wrap schema.table in double quotes for case handling by@neil176 in#1426
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
Full Changelog:kysely-org/kysely@0.28.0...0.28.1
Compare Source
Hey 👋
Transactions are getting a lot of love in this one!
As part an effort to replace Knex with Kysely, B4nan, the author ofmikro-orm drove the newsetAccessMode('read only'|'read write') method when starting transactions.
You can now commit/rollback transactions manually and there's even savepoint support:
consttrx=awaitdb.startTransaction().execute()try{// do stuff with `trx`, including work with savepoints via the new `savepoint(name)`, `rollbackToSavepoint(name)` and `releaseSavepoint(name)` methods!awaittrx.commit().execute()}catch(error){awaittrx.rollback().execute()throwerror}We also addedusing keyword support, so now you can write:
await usingdb=newKysely({...})anddb.destroy() will be called automatically once the current scope is exited.
If you plan on trying this out (it is optional, you can stillconst db = new Kysely({...}) andawait db.destroy() manually), theusing keyword requirestypescript >= 5.2 and the followingtsconfig.json options:
{"compilerOptions":{"target":"ES2022","lib":["ESNext", ...], ...} ...}We also added a plugin to handlein () andnot in (). It comes with 2 handling strategies, one similar to how Knex.js, PrismaORM, Laravel and SQLAlchemy do it, and one similar to how TypeORM and Sequelize do it. It also supports custom strategies, e.g. throwing an error to avoid making a call to the database and wasting resources. Here's an example with one of the strategies we ship:
import{// ...HandleEmptyInListsPlugin,// ...replaceWithNoncontingentExpression,// ...}from'kysely'constdb=newKysely<Database>({// ...plugins:[newHandleEmptyInListsPlugin({strategy:replaceWithNoncontingentExpression})],})// ....where('id','in',[]).where('first_name','not in',[])// => `where 1 = 0 and 1 = 1`🚀 Features
PostgreSQL 🐘 / MySQL 🐬
- feat: Allow read-only transactions in Postgres and MySQL by B4nan in#1342 Ն
PostgreSQL 🐘 / MS SQL Server 🥅
- Add within group clause support for aggregate function builder by@ivashog in#1024
PostgreSQL 🐘 / SQLite 📘
PostgreSQL 🐘
MySQL 🐬
MS SQL Server 🥅
- Add outer and cross apply (mssql) by@drew-marsh in#1074
- refactor: extract
validateConnections andresetConnectionsOnRelease to root of config, flip defaultresetConnectionsOnRelease behavior. by@igalklebanov in#1388
SQLite 📘
🐞 Bugfixes
PostgreSQL 🐘
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
InferResult now outputsInsertResult[],UpdateResult[],DeleteResult[],MergeResult[], instead ofInsertResult,UpdateResult,DeleteResult,MergeResult. To get the singular form, usetype Result = InferResult<T>[number].- Some generic/wide usages of
QueryCreator's methods should no longer pass type checks. We never supported these officially. - As
preventAwait is now removed on all builders, you must avoid awaiting builders without callingexecute-like methods on your own. - TypeScript versions 4.5 and older are no longer supported. You will get an immediate compilation error telling you to upgrade.
QueryResult.numUpdatedOrDeletedRows has been removed (after spending ~2 years in deprecation). We still log a warning. Outdated dialects that don't useQueryResult.numAffectedRows should be updated OR forked.DefaultQueryExecutor.compileQuery now requires passing aqueryId argument. Use the newly exportedcreateQueryId() as that argument value from now on.UpdateValuesNode type has been removed.MssqlDialectConfig.tedious.resetConnectionOnRelease has been deprecated, and had it's default flipped tofalse. UseMssqlDialectConfig.resetConnectionsOnRelease instead.MssqlDialectConfig.tarn.options.validateConnections has been deprecated. UseMssqlDialectConfig.validateConnections instead.- String literals are now
' injection protected, hopefully. Please report any issues.
🐤 New Contributors
Full Changelog:kysely-org/kysely@0.27.6...0.28.0
Compare Source
Hey 👋
v0.28 is right around the corner! 👀
🚀 Features
🐞 Bugfixes
PostgreSQL 🐘
- Use JS sort method to sort migrations by name by@DavesBorges in#844
- fix: WithSchemaPlugin is adding schema to table function arguments and causes db errors in json_agg and to_json. by@igalklebanov in#827
SQLite 📘
📖 Documentation
PostgreSQL 🐘
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
Full Changelog:kysely-org/kysely@0.27.5...0.27.6
Compare Source
Hey 👋
Long-time community member and ambassador@thelinuxlich has joined the contributors club! 🏅
v0.28 is right around the corner! 👀
🚀 Features
PostgreSQL 🐘 / MySQL 🐬 / SQLite 📘
- Add orderBy clause support to aggregate function builder by@ivashog in#896
PostgreSQL 🐘 / MySQL 🐬
PostgreSQL 🐘
MS SQL Server 🥅
🐞 Bugfixes
📖 Documentation
📦 CICD & Tooling
⚠️ Breaking Changes
🐤 New Contributors
Full Changelog:kysely-org/kysely@0.27.4...0.27.5
Uh oh!
There was an error while loading.Please reload this page.
This PR contains the following updates:
^0.27.4->^0.28.0Release Notes
kysely-org/kysely (kysely)
v0.28.8: 0.28.8Compare Source
Hey 👋
A small batch of bug fixes. Please report any issues. 🤞😰🤞
🚀 Features
🐞 Bugfixes
PostgreSQL 🐘
📖 Documentation
📦 CICD & Tooling
🐤 New Contributors
Full Changelog:kysely-org/kysely@v0.28.7...v0.28.8
v0.28.7: 0.28.7Compare Source
Hey 👋
A small batch of bug fixes. Please report any issues. 🤞😰🤞
🚀 Features
🐞 Bugfixes
eb(). by@igalklebanov in#1579📖 Documentation
📦 CICD & Tooling
🐤 New Contributors
Full Changelog:kysely-org/kysely@v0.28.6...v0.28.7
v0.28.6: 0.28.6Compare Source
Hey 👋
A small batch of bug fixes. Please report any issues. 🤞😰🤞
Docs site has been optimized and all we got was this animation:
🚀 Features
🐞 Bugfixes
PostgreSQL 🐘 / MSSQL 🥅
MySQL 🐬
📖 Documentation
c1fd84d.1a21140.98e84f1.caa22f4.3db3542.77eadc0.45a010b.8f4dd28.📦 CICD & Tooling
575c43a.c00319e.163fcf4.🐤 New Contributors
Full Changelog:kysely-org/kysely@v0.28.5...v0.28.6
v0.28.5: 0.28.5Compare Source
Hey 👋
A small batch of bug fixes. Please report any issues. 🤞😰🤞
🚀 Features
🐞 Bugfixes
BufferbreakingShallowDehydrateValuein non-Node.js TypeScript environments. by@igalklebanov in#1542.📖 Documentation
📦 CICD & Tooling
🐤 New Contributors
Full Changelog:kysely-org/kysely@v0.28.4...v0.28.5
v0.28.4: 0.28.4Compare Source
Hey 👋
A small batch of bug fixes. Please report any issues. 🤞😰🤞
🚀 Features
🐞 Bugfixes
PostgreSQL 🐘
📖 Documentation
📦 CICD & Tooling
a9bcfa5🐤 New Contributors
Full Changelog:kysely-org/kysely@v0.28.3...v0.28.4
v0.28.3: 0.28.3Compare Source
Hey 👋
A small batch of bug fixes. Please report any issues. 🤞😰🤞
🚀 Features
CockroachDB 🟣
🐞 Bugfixes
Kysely<any>type errors with narrow table name types by@koskimas in#1443AsyncDisposableusage erroring for older TypeScript versions. by@igalklebanov in#1507Dates and other JS/Node-native instances that require data type metadata. by@igalklebanov in#1477MySQL 🐬 / MS SQL Server 🥅
MS SQL Server 🥅
📖 Documentation
📦 CICD & Tooling
1ae88297d1c4e5🐤 New Contributors
Full Changelog:kysely-org/kysely@0.28.2...v0.28.3
v0.28.2Compare Source
Hey 👋
v0.28 broke an undocumented TypeScript behavior our API had that allowed you to pass table name unions to query builders and enable some DRYing of queries. Seeing that this pattern was quite popular, we decided to support it officially with the addition of the
tablemethod in the dynamic module.You can pull off some crazy complex stuff like:
...and it'll narrow the downstream query context to the intersection of all the possible shapes of tables in the union type. (DONT DO THIS AT HOME KIDS!)
A simpler example would be:
If you attempt to refer to a column that doesn't exist in both "person" and "pet" (e.g. "pet"'s "species" column), the compiler will correctly yell at you.
🚀 Features
tabletoDynamicModulefor dynamic table references by@koskimas in#1434🐞 Bugfixes
SQLite 📘
orderBy(array). by@igalklebanov in#1435📖 Documentation
📦 CICD & Tooling
🐤 New Contributors
Full Changelog:kysely-org/kysely@0.28.1...0.28.2
v0.28.1Compare Source
Hey 👋
Just a small crucial bug fix release. Please inform us if you see any more regressions sincev0.28. 🙏
🚀 Features
🐞 Bugfixes
PostgreSQL 🐘
📖 Documentation
📦 CICD & Tooling
🐤 New Contributors
Full Changelog:kysely-org/kysely@0.28.0...0.28.1
v0.28.0Compare Source
Hey 👋
Transactions are getting a lot of love in this one!
As part an effort to replace Knex with Kysely, B4nan, the author ofmikro-orm drove the new
setAccessMode('read only'|'read write')method when starting transactions.You can now commit/rollback transactions manually and there's even savepoint support:
We also added
usingkeyword support, so now you can write:and
db.destroy()will be called automatically once the current scope is exited.If you plan on trying this out (it is optional, you can still
const db = new Kysely({...})andawait db.destroy()manually), theusingkeyword requirestypescript >= 5.2and the followingtsconfig.jsonoptions:We also added a plugin to handle
in ()andnot in (). It comes with 2 handling strategies, one similar to how Knex.js, PrismaORM, Laravel and SQLAlchemy do it, and one similar to how TypeORM and Sequelize do it. It also supports custom strategies, e.g. throwing an error to avoid making a call to the database and wasting resources. Here's an example with one of the strategies we ship:🚀 Features
InferResultshould output plural. by@igalklebanov in#1064ControlledTransaction. by@igalklebanov in#962 ҩawait using kysely = new Kysely()support. by@igalklebanov in#1167c95f499queryIdtoCompiledQueryand all transformer methods. by@igalklebanov in#176PostgreSQL 🐘 / MySQL 🐬
PostgreSQL 🐘 / MS SQL Server 🥅
PostgreSQL 🐘 / SQLite 📘
PostgreSQL 🐘
returningsupport inMERGEqueries. by@igalklebanov in#1171MySQL 🐬
MS SQL Server 🥅
validateConnectionsandresetConnectionsOnReleaseto root of config, flip defaultresetConnectionsOnReleasebehavior. by@igalklebanov in#1388SQLite 📘
🐞 Bugfixes
PostgreSQL 🐘
📖 Documentation
1c5e03a📦 CICD & Tooling
9736aebf348dfb6eaf754ca11632InferResultnow outputsInsertResult[],UpdateResult[],DeleteResult[],MergeResult[], instead ofInsertResult,UpdateResult,DeleteResult,MergeResult. To get the singular form, usetype Result = InferResult<T>[number].QueryCreator's methods should no longer pass type checks. We never supported these officially.preventAwaitis now removed on all builders, you must avoid awaiting builders without callingexecute-like methods on your own.QueryResult.numUpdatedOrDeletedRowshas been removed (after spending ~2 years in deprecation). We still log a warning. Outdated dialects that don't useQueryResult.numAffectedRowsshould be updated OR forked.DefaultQueryExecutor.compileQuerynow requires passing aqueryIdargument. Use the newly exportedcreateQueryId()as that argument value from now on.UpdateValuesNodetype has been removed.MssqlDialectConfig.tedious.resetConnectionOnReleasehas been deprecated, and had it's default flipped tofalse. UseMssqlDialectConfig.resetConnectionsOnReleaseinstead.MssqlDialectConfig.tarn.options.validateConnectionshas been deprecated. UseMssqlDialectConfig.validateConnectionsinstead.'injection protected, hopefully. Please report any issues.🐤 New Contributors
Full Changelog:kysely-org/kysely@0.27.6...0.28.0
v0.27.6Compare Source
Hey 👋
v0.28 is right around the corner! 👀
🚀 Features
🐞 Bugfixes
PostgreSQL 🐘
SQLite 📘
📖 Documentation
bfbd002541c9359ba0f02708afad1ba55861cbe9b5559833867e413ebd167d34870549anddeedd28PostgreSQL 🐘
📦 CICD & Tooling
🐤 New Contributors
Full Changelog:kysely-org/kysely@0.27.5...0.27.6
v0.27.5Compare Source
Hey 👋
Long-time community member and ambassador@thelinuxlich has joined the contributors club! 🏅
v0.28 is right around the corner! 👀
🚀 Features
PostgreSQL 🐘 / MySQL 🐬 / SQLite 📘
PostgreSQL 🐘 / MySQL 🐬
onReserveConnectionto Postgres and MySQL dialect configs by@dcousineau in#996PostgreSQL 🐘
MS SQL Server 🥅
🐞 Bugfixes
📖 Documentation
generatedAlwaysAsby@nikeee in#1113MERGEexamples by@igalklebanov in#1188📦 CICD & Tooling
3f99090🐤 New Contributors
Full Changelog:kysely-org/kysely@0.27.4...0.27.5
Configuration
📅Schedule: 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.
This PR was generated byMend Renovate. View therepository job log.