knex

A query builder for PostgreSQL, MySQL, CockroachDB, SQL Server, SQLite3 and Oracle, designed to be flexible, portable, and fun to use.

MIT License

Downloads
7.5M
Stars
18.8K
Committers
563

Bot releases are hidden (Show)

knex - 3.1.0 Latest Release

Published by kibertoad 10 months ago

3.1.0 - 8 December, 2023

Bug fixes

  • andWhereNotJsonObject calling wrong function (#5683)
  • PostgreSQL: fix error when setting query_timeout (#5673)
  • MySQL: Missing comments on delete, update and insert (#5738)
  • MySQL: Fixed issue with bigincrements not working with composite primary key - #5341 (#5343)

New features

  • Add transactor.parentTransaction (#5567)
  • MySQL: Added implementation for upsert (#5743)
  • Oracle: Support Object Names Greater than 30 Characters for Oracle DB Versions 12.2 and Greater (#5197)

Types

  • Add type definitions for orHavingNull and orHavingNotNull (#5669)
  • Import knex as type in TS migration template (#5741)
  • Fix conditional constraint error (#5747)
  • PostgreSQL: Fix typing to reflect pg typing change (#5647)
knex - 3.0.1

Published by kibertoad about 1 year ago

  • Fix broken release
knex - 3.0.0

Published by kibertoad about 1 year ago

3.0.0 - 6 October, 2023

  • Fix raw bindings typing (#5401)
  • Fix migrate:unlock when used with custom identifier wrapping. (#5353)
  • Fix driver options specified with .options() method being ignored for oracledb dialect (#5123)
  • Drop compatibility for Node < 16
  • Fix knex d.ts to work with mixed modules (#5659)
  • Fix Lexical error from "Instaed" to "Instead" (#5655)
knex - 2.5.1

Published by OlivierCavadenti over 1 year ago

2.5.1 - 12 July, 2023

Bug fixes

  • Fix Linting #5455 - #5460
knex - 2.5.0

Published by OlivierCavadenti over 1 year ago

2.5.0 - 08 July, 2023

New features

  • Add uuid helper function #5617
  • Add nativeBindings option to better-sqlite3 options #5461
  • Add QueryBuilder#updateFrom #5386
  • Add readonly transaction access mode #5445
  • Add readonly option to Better-SQLite3 #5530
  • Add EXCEPT as a valid keyword #5357
  • Add ability to prepend query comments #5289
  • Add fetchAsString option #5484

Bug fixes

  • Avoid password leaks on query logs #5559
  • Add knex.mjs to files in package.json #5518
  • Handle numeric array elements in .orderBy() #5551
  • Attach error handler early enough #5552
  • Fix Returning * in Oracle #5598
  • Fix indexType option in Postgres #5601
  • Add mjs extension type #5616
  • Use implicit check on json fields for OracleDB #5478
  • Fix when manually close source stream #5466
  • Fix case sensitive issue with get table #5509

Typings

  • Add Object syntax overload to increment method #5512
  • Add object syntax overload to decrement method #5555
  • Fix typing for toSql #5594
  • Add ResolveTableType for .merge() #5605
  • Add missing types for havingNull and havingNotNull #5529
  • Add collate to the columnbuilder interface #5568
  • TableBuilder methods return the SchemaBuilder. #5486

Full Changelog: https://github.com/knex/knex/compare/2.4.2...2.5.0

knex - 2.4.2

Published by OlivierCavadenti over 1 year ago

2.4.2 - 22 January, 2023

Bug fixes

CLI: Fix incorrent EOL causing errors on Linux #5455

knex - 2.4.1

Published by OlivierCavadenti over 1 year ago

2.4.1 - 18 January, 2023

Bug fixes

knex - 2.4.0

Published by kibertoad almost 2 years ago

New features:

  • Support partial unique indexes #5316
  • Make compiling SQL in error message optional #5282

Bug fixes

  • Insert array into json column #5321
  • Fix unexpected max acquire-timeout #5377
  • Fix: orWhereJson #5361
  • MySQL: Add assertion for basic where clause not to be object or array #1227
  • SQLite: Fix changing the default value of a boolean column in SQLite #5319

Typings:

  • add missing type for 'expirationChecker' on PgConnectionConfig #5334
knex - 2.3.0

Published by kibertoad about 2 years ago

New features:

  • PostgreSQL: Explicit jsonb support for custom pg clients #5201
  • SQLite: Support returning with sqlite3 and better-sqlite3 #5285
  • MSSQL: Implement mapBinding mssql dialect option #5292

Typings:

  • Update types for TS 4.8 #5279
  • Fix typo #5267
  • Fix WhereJsonObject withCompositeTableType #5306
  • Fix AnalyticFunction type #5304
  • Infer specific column value type in aggregations #5297
knex - 2.2.0

Published by kibertoad about 2 years ago

New features:

  • Inline primary key creation for postgres flavours #5233
  • SQLite: Add warning for undefined connection file #5223
  • MSSQL: Add JSON parameter support for connection #5200

Bug fixes:

  • PostgreSQL: add primaryKey option for uuid #5212

Typings:

  • Add promisable and better types #5222
  • Update raw query bind parameter type #5208
knex - 2.1.0

Published by kibertoad over 2 years ago

2.1.0 - 26 May, 2022

New features:

  • Improve bundling experience to safely import dialects while using static paths #5142
  • Implement extendable builders #5041
  • PostgreSQL: Refresh materialized view concurrently #5166

Bug fixes:

  • Use correct paths in package.json browser field #5174
  • MariaDB: Fix 'NULL' returned instead of NULL on MariaDB 10.2.6+ #5181
  • MySQL: fix hasColumn Error (hasColumn ('a_id') is true, but hasColumn('a_Id') is false) #5148
  • MSSQL: Fix .hasTable result when using .withSchema #5176
  • Oracle: correctly INSERTS Buffer #4869

Typings:

  • Update type definitions for pg connection #5139
knex - 2.0.0

Published by kibertoad over 2 years ago

2.0.0 - 21 April, 2022

Breaking changes

  • Restore sqlite3 package #5136

Test / internal changes:

  • Migrate Husky from 4 to 7 #5137
  • Migrate Jake to 10.8.5 #5138
knex - 1.0.7

Published by kibertoad over 2 years ago

1.0.7 - 13 March, 2022

Bug fixes:

  • CLI: Fix cli migrate:make SQLite dependency #5106

1.0.6 - 12 March, 2022

Bug fixes:

  • PostgreSQL: Wait for search path to be set before returning connection #5107
  • CLI: No client override during migrate:make #5109
knex - 1.0.5

Published by kibertoad over 2 years ago

New features:

  • Override knexfile options with CLI options #4047

Bug fixes:

  • Stringify json value in update #5063
  • Fix isModuleType() for yarn #4447
  • Wrapped Unions Fixes #5072
  • SQLite: Fix @vscode-sqlite3 error message #5081
  • CLI: Fix completed migration listing #5060

Typings:

  • Make default generic parameters of Knex match the generic parameter types of knex #5021
  • Update knex types for TS 4.7 #5095
knex - 1.0.4

Published by kibertoad over 2 years ago

1.0.4 - 13 March, 2022

New features:

  • Add whereLike functions #5044

Bug fixes:

  • Fix orWhereJsonPath clause #5022
  • Subquery in on clause missing parenthesis #5049
  • Rework Union Wrapping #5030
  • Oracle: Fix batch inserts with DEFAULT values with OracleDB #2592 #5037

Typings:

  • Fix types for "returning" methods #5031
  • createTableLike callback should be optional #5055

Documentation:

knex - 1.0.3

Published by kibertoad over 2 years ago

1.0.3 - 11 February, 2022

Bug fixes:

  • Fix error message for missing migration files #4937
  • Add withMaterialized and withNotMaterialized to method-constants #5009
  • PostgreSQL: Fix whereJsonPath queries #5011
  • PostgreSQL: Fix delete joins #5016
  • CockroachDB: Fix whereJsonPath queries #5011
  • MySQL: Create primary keys in same statement #5017

Typings:

  • Fix type definition for getMigration in MigrationSource #4998
  • Fix argument type of alter method #4996

Improvements:

  • Use async / await syntax in seeds as default #5005

Documentation:

  • Add Firebird dialect to ECOSYSTEM.md #5003

1.0.2 - 02 February, 2022

New features:

  • Support of MATERIALIZED and NOT MATERIALIZED with WITH/CTE #4940
  • Add raw support in onConflict clause #4960
  • Alter nullable constraint when alterNullable is set to true #4730
  • Add alterType parameter for alter function #4967
  • Support string json in json values #4988
  • MySQL: add with clause #4508

Bug fixes:

  • Fix error message for missing migration files #4937
  • Move deferrable to after on update/on delete #4976
  • Do not use sys.tables to find if a table exists #2328
  • PostgreSQL: Fix Order nulls #4989
  • MySQL: Fix collation when renaming column #2666
  • SQLite: Same boolean handling in better-sqlite3 as in sqlite3 #4982

Typings:

  • WhereILike - fix typo #4941
knex - 1.0.1

Published by kibertoad almost 3 years ago

Bug fixes:

  • Fix package.json metadata
knex - 1.0.0

Published by kibertoad almost 3 years ago

Breaking changes

  • Dropped support for Node 10;
  • Replaced unsupported sqlite3 driver with @vscode/sqlite3;
  • Changed data structure from RETURNING operation to be consistent with SELECT;
  • Changed Migrator to return list of migrations as objects consistently.

New features:

  • Support fromRaw #4781
  • Support zero precision in timestamp/datetime #4784
  • Support whereLike and whereILike #4779
  • Add JSDoc (TS flavor) to stub files #4809
  • Allow skip binding in limit and offset #4811
  • Support creating a new table in the database based on another table #4821
  • Accept Raw on onIn joins #4830
  • Implement support for custom seed sources #4842
  • Add binary uuid option #4836
  • ForUpdate array parameter #4882
  • Add camel case to timestamps method #4803
  • Advanced JSON support #4859
  • Add type to TypeScript knexfile #4909
  • Checks Constraints Support #4874
  • Support creating multiple PKs with increments #4903
  • Enable wrapIdentifier for SQLite .hasTable #4915
  • MSSQL: Add support for unique constraint #4887
  • SQLite: New dialect, using better-sqlite3 driver #4871
  • SQLite: Switch to @vscode/sqlite3 #4866
  • SQLite: Support createViewOrReplace #4856
  • SQLite: Support RETURNING statements for better-sqlite3 driver #4934
  • PostgreSQL: Support JOIN and USING syntax for Delete Statement #4800

Bug fixes:

  • Fix overzealous warning on use of whereNot with "in" or "between" #4780
  • Fix Union all + first syntax error #4799
  • Make view columns optional in create view like #4829
  • Insert lock row fix during migration #4865
  • Fix for createViewOrReplace #4856
  • SQLite: Fix foreign key constraints when altering a table #4189
  • MySQL: Validate connection fix #4794
  • MySQL: Set comment size warning limit to 1024 #4867

Typings:

  • Allow string indexType in index creation #4791
  • Add missing ints typings #4832
  • Returning method types #4881
  • Improve columnInfo type #4868
knex - 0.95.14

Published by kibertoad almost 3 years ago

0.95.14 - 09 November, 2021

Bug fixes:

  • MySQL: mysql2 dialect validate connection fix #4794

0.95.13 - 02 November, 2021

Bug fixes:

  • PostgreSQL: Support zero precision in timestamp/datetime #4784

Typings:

  • Allow string indexType in index creation #4791
knex - 0.95.12

Published by kibertoad almost 3 years ago

0.95.12 - 28 October, 2021

New features:

  • New dialect: CockroachDB #4742
  • New dialect: pg-native #4327
  • CockroachDB: add support for upsert #4767
  • PostgreSQL: Support SELECT .. FOR NO KEY UPDATE / KEY SHARE row level locking clauses #4755
  • PostgreSQL: Add support for 'CASCADE' in PostgreSQL 'DROP SCHEMA' queries #4713
  • MySQL: Add storage engine index Type support to index() and unique() schema #4756
  • MSSQL: Support table.primary, table.unique variant with options object #4710
  • SQLite: Add setNullable support to SQLite #4684
  • Add geometry column building #4776
  • Add support for creating table copies #1373
  • Implement support for views and materialized views #1626
  • Implement partial index support #4768
  • Support for 'is null' in 'order by' #3667

Bug fixes:

  • Fix support for Oracle connections passed via knex.connection() #4757
  • Avoid inserting multiple locks if a migration lock already exists #4694

Typings:

  • Some TableBuilder methods return wrong types #4764
  • Update JoinRaw bindings type to accept arrays #4752
  • fix onDelete/onUpdate for ColumnBuilder #4656
Package Rankings
Top 0.32% on Npmjs.org
Top 3.81% on Proxy.golang.org
Badges
Extracted from project README's
npm version npm downloads Coverage Status Dependencies Status Gitter chat