Packages

knex

3.3.0 · 26 Jun 2026MIT7.2M / weekRepositoryHomepagenpmAtom feed

Your version

0.95.0

3 Mar 2021Where it was published

0.95.15 is the newest release of 0.95.x.

In short

1 breaking26 new11 fixed11 changed

Security

1 advisory affects 0.95.0; 2.4.0 fixes them

Release note

0.95.0 - 03 March, 2021

Please upgrade to TypeScript 4.1 if using an older version!
Check out the migration guide for other breaking changes.

New features

  • Add transaction isolation support #4185

  • Add analytic functions #4188

  • Change default to not trigger a promise rejection for transactions with a specified handler #4195

  • Make toSQL().toNative() work for Raw to match the API for QueryBuilder #4058

  • Allow 'match' operator #3569

  • Support optimizer hints #4243

  • Add parameter to prevent autoincrement columns from being primary keys #4266

  • Make "first" and "pluck" mutually exclusive #4280

  • Added merge strategy to allow selecting columns to upsert. #4252

  • Throw error if the array passed to insert is empty #4289

  • Events: Introduce queryContext on query-error #4301

  • CLI: Use UTC timestamp for new migrations #4245

  • MSSQL: Replace MSSQL dialect with Tedious.js implementation #2857 #4281

  • MSSQL: Use "nvarchar(max)" for ".json()" #4278

  • MSSQL: Schema builder - add predictable constraint names for default values #4319

  • MSSQL: Schema builder - attempt to drop default constraints when changing default value on columns #4321

  • SQLite: Fallback to json for sqlite3 when using jsonb #4186

  • SQLite: Return complete list of DDL commands for creating foreign keys #4194

  • SQLite: Support dropping composite foreign keys #4202

  • SQLite: Recreate indices when altering a table #4277

  • SQLite: Add support for altering columns #4322

Bug fixes

  • Fix issue with .withSchema usage with joins on a subquery #4267

  • Fix issue with schema usage with FROM clause contain QueryBuilder, function or Raw #4268

  • CLI: Address raised security warnings by dropping liftoff #4122

  • CLI: Fix an issue with npm@7 and ESM when type was set to 'module' in package.json #4295

  • PostgreSQL: Add check to only create native enum once #3658

  • SQLite: Fix foreign key "on delete" when altering a table #4225

  • SQLite: Made the constraint detection case-insensitive #4330

  • MySQL: Keep auto increment after rename #4266

  • MSSQL: Don't raise query-error twice #4314

  • MSSQL: Alter column must have its own query #4317

Typings

  • Add missing onConflict overrides #4182

  • Introduce the "infamous triplet" export #4181

  • Fix type definition of Transaction #4172

  • Add typedefinitions for havingNotIn #4265

  • Include 'name' property in MigratorConfig #4300

  • Improve join and conflict types #4318

  • Fix ArrayIfAlready type #4331

Test / internal changes

  • Drop global Knex.raw #4180

  • Stop using legacy url.parse API #3702

  • Various internal refactorings #4175 #4177 #4178 #4192

  • Refactor to classes #4190 #4191 #4193 #4210 #4253

  • Move transaction type tests to TSD #4208

  • Clean up destroy logic #4248

  • Colorize code snippets in readme files #4234

  • Add "Ecosystem" documentation for Knex plugins #4183

  • Documentation cleanup

  • SQLite: Use SQLite "rename column" instead of a DDL helper #4200

  • SQLite: Simplify reinsert logic when altering a table #4272

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.