knex
3.3.0 · 26 Jun 2026MIT7.3M / weekRepositoryHomepagenpmAtom feed
0.95.15 is the newest release of 0.4.x.
In short
5 breaking
- Breaking
Global state is no longer stored in the library, an instance is returned from
Knex.initialize, so you will need to call this once and then reference thisknexclient elsewhere in your application. - Breaking
Lowercasing of
knex.raw,knex.transaction, andknex.schema. - Breaking
Created columns are now nullable by default, unless
notNullableis chained as an option. - Breaking
Keys created with
incrementsare now assumed to be unsigned (MySQL) by default. - Breaking
The
destroyAllNowis no longer called by the library onprocess.exitevent. If you need to call it explicitly yourself, you may useknex.client.destroyPool
Security
2 advisories affect 0.4.0; 2.4.0 fixes them
- CriticalSQL Injection in knexGHSA-58v4-qwx5-7f59 · 21 Oct 2019Fixed in 0.19.5
- HighKnex.js has a limited SQL injection vulnerabilityGHSA-4jv9-3563-23j3 · 19 Dec 2022Fixed in 2.4.0
Release note
Breaking Changes
- Breaking
Global state is no longer stored in the library, an instance is returned from
Knex.initialize, so you will need to call this once and then reference thisknexclient elsewhere in your application. - Breaking
Lowercasing of
knex.raw,knex.transaction, andknex.schema. - Breaking
Created columns are now nullable by default, unless
notNullableis chained as an option. - Breaking
Keys created with
incrementsare now assumed to be unsigned (MySQL) by default. - Breaking
The
destroyAllNowis no longer called by the library onprocess.exitevent. If you need to call it explicitly yourself, you may useknex.client.destroyPool
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.