Packages

knex

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

Your version

0.16.1

9 Dec 2018Where it was published

0.95.15 is the newest release of 0.16.x.

In short

4 breaking26 new12 fixed4 changed1 internal

  • Breaking

    Use datetime2 for MSSQL datetime + timestamp types. This change is incompatible with MSSQL older than 2008 #2757

  • Breaking

    Knex.VERSION() method was removed, run "require('knex/package').version" instead #2776

  • Breaking

    Knex transpilation now targets Node.js 6, meaning it will no longer run on older Node.js versions #2813

  • Breaking

    Add json type support for SQLite 3.9+ (tested to work with Node package 'sqlite3' 4.0.2+) #2814

Security

2 advisories affect 0.16.1; 2.4.0 fixes them

Release note

0.16.1 - 28 Nov, 2018

Breaking Changes

  • Breaking

    Use datetime2 for MSSQL datetime + timestamp types. This change is incompatible with MSSQL older than 2008 #2757

  • Breaking

    Knex.VERSION() method was removed, run "require('knex/package').version" instead #2776

  • Breaking

    Knex transpilation now targets Node.js 6, meaning it will no longer run on older Node.js versions #2813

  • Breaking

    Add json type support for SQLite 3.9+ (tested to work with Node package 'sqlite3' 4.0.2+) #2814

New features

  • Support passing explicit connection to query builder

  • Introduced abstraction for getting migrations to make migration bundling easier #2775

  • Allow timestamp with timezone on mssql databases #2724

  • Allow specifying multiple migration directories #2735

  • Allow cloning query builder with .userParams({}) assigned to it #2802

  • Allow chaining of increment, decrement, and update #2740

  • Allow table names with forUpdate/forShare #2834

  • Added whereColumn and the associated not / and / or methods for using columns on the right side of a where clause #2837

  • Added whereRecursive method to make self-referential CTEs possible #2889

  • Added support for named unique, primary and foreign keys to SQLite3 #2840

  • Added support for generating new migration and seed files without knexfile #2884 #2905 #2935

  • Added support for multiple columns in .orderBy() #2881

  • Added option of existingType to .enum() method to support repeated use of enums #2719

  • Added option to pass indexType for MySQL dialect #2890

  • Added onVal and the associated not / and / or methods for using values in on clauses within joins #2746

  • Kill queries after timeout for PostgreSQL #2636

  • Manage TypeScript types internally #2845

  • Support 5.0.0+ versions of mssql driver #2861

  • Typescript migration stub #2816

  • Options object for passing timestamp parameters + regression tests #2919

Bug fixes

  • Implement fail-fast logic for dialect resolution #2776

  • Fixed identifier wrapping for using(). Use columnize instead of wrap in using() #2713

  • Fix issues with warnPromise when migration does not return a promise #2730

  • Compile with before update so that bindings are put in correct order #2733

  • Fix join using builder withSchema #2744

  • Throw instead of process.exit when client module missing #2843

  • Display correct filename of a migration that failed #2910

  • Fixed support of knexSnakeCaseWrappers in migrations #2914

  • SQlite3 renameColunm quote fix #2833

  • Adjust typing for forUpdate()/forShare() variant with table names #2858

  • Fix execution of Oracle tests on Node 11 #2920

  • Fix failures in oracle test bench and added it back to mandatory CI tests #2924

  • Knex client knexfile resolution fix #2923

  • Add queryContext to type declarations #2931

Test / internal changes

  • Add tests for multiple union arguments with callbacks and builders #2749

  • Separate migration generator #2786

  • Do not postprocess internal queries in Migrator #2914 #2934

  • Use Babel 7 #2813

  • Introduce LGTM.com badge #2755

  • Cleanup based on analysis by lgtm.com #2870

  • Add test for retrieving null dates #2865

  • Add link to wiki #2866

  • Add tests for specifying explicit pg version #2895

  • Execute tests on Node.js 11 #2873

  • Version upgrade guide #2894

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.