knex 3.2.7 → 3.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Master (Unreleased)
2
2
 
3
+ ### Bug fixes
4
+
5
+ - Reverts the breaking changes added in [#6227](https://github.com/knex/knex/issues/6227). This means that the ESM import of Knex is reverted to `import { knex } from 'knex/knex.mjs` [#6422](https://github.com/knex/knex/issues/6422)
6
+ - fix(types): allow a `QueryBuilder` type as a value in an `update` [#6419](https://github.com/knex/knex/issues/6419)
7
+
3
8
  # 3.2.7 - 27 March, 2026
4
9
 
5
10
  ### Bug fixes
package/knex.mjs CHANGED
@@ -4,7 +4,6 @@
4
4
  // Knex may be freely distributed under the MIT license.
5
5
  // For details and documentation:
6
6
  // http://knexjs.org
7
-
8
7
  import knex from './lib/index.js';
9
8
 
10
9
  export { knex };
package/package.json CHANGED
@@ -1,31 +1,9 @@
1
1
  {
2
2
  "name": "knex",
3
- "version": "3.2.7",
3
+ "version": "3.2.8",
4
4
  "description": "A batteries-included SQL query & schema builder for PostgresSQL, MySQL, CockroachDB, MSSQL and SQLite3",
5
5
  "main": "knex.js",
6
6
  "types": "types/index.d.ts",
7
- "exports": {
8
- ".": {
9
- "import": {
10
- "types": "./types/index.d.mts",
11
- "default": "./knex.mjs"
12
- },
13
- "require": {
14
- "types": "./types/index.d.ts",
15
- "default": "./knex.js"
16
- }
17
- },
18
- "./bin/*.js": "./bin/*.js",
19
- "./bin/*": "./bin/*",
20
- "./types/*.d.ts": "./types/*.d.ts",
21
- "./types/*": "./types/*.d.ts",
22
- "./lib/*.js": "./lib/*.js",
23
- "./lib/*": "./lib/*.js",
24
- "./knex": "./knex.js",
25
- "./knex.js": "./knex.js",
26
- "./knex.mjs": "./knex.mjs",
27
- "./package.json": "./package.json"
28
- },
29
7
  "engines": {
30
8
  "node": ">=16"
31
9
  },
@@ -162,7 +140,6 @@
162
140
  "pg": "^8.20.0",
163
141
  "pg-query-stream": "^4.14.0",
164
142
  "prettier": "2.8.7",
165
- "resolve.exports": "^2.0.3",
166
143
  "rimraf": "^5.0.5",
167
144
  "semver": "^7.7.4",
168
145
  "sinon": "^15.0.1",
package/types/index.d.ts CHANGED
@@ -504,6 +504,8 @@ declare namespace Knex {
504
504
  | Record<string, unknown>
505
505
  | Knex.Raw;
506
506
 
507
+ type ValueOrBuilder = Value | Knex.QueryBuilder;
508
+
507
509
  interface ValueDict extends Dict<Value | Knex.QueryBuilder> {}
508
510
  interface AliasDict extends Dict<string> {}
509
511
 
@@ -1018,7 +1020,7 @@ declare namespace Knex {
1018
1020
  >[]
1019
1021
  >(
1020
1022
  columnName: K1,
1021
- value: DbColumn<ResolveTableType<TRecord, 'update'>[K1]>,
1023
+ value: DbColumn<ResolveTableType<TRecord, 'update'>[K1]> | QueryBuilder,
1022
1024
  returning: readonly K2[],
1023
1025
  options?: DMLOptions
1024
1026
  ): QueryBuilder<TRecord, TResult2>;
@@ -1028,7 +1030,7 @@ declare namespace Knex {
1028
1030
  ): QueryBuilder<TRecord, number>;
1029
1031
  update<TResult2 = SafePartial<TRecord>[]>(
1030
1032
  columnName: string,
1031
- value: Value,
1033
+ value: ValueOrBuilder,
1032
1034
  returning: string | readonly string[],
1033
1035
  options?: DMLOptions
1034
1036
  ): QueryBuilder<TRecord, TResult2>;
@@ -1101,7 +1103,7 @@ declare namespace Knex {
1101
1103
 
1102
1104
  update<TResult2 = number>(
1103
1105
  columnName: string,
1104
- value: Value
1106
+ value: ValueOrBuilder
1105
1107
  ): QueryBuilder<TRecord, TResult2>;
1106
1108
 
1107
1109
  returning(
package/types/index.d.mts DELETED
@@ -1,14 +0,0 @@
1
- // ESM-specific types for Knex.js
2
- // This file provides ESM type definitions that wrap the CJS types from index.d.ts
3
- // to match the exports defined in knex.mjs
4
-
5
- import type { Knex } from './index.d.ts';
6
-
7
- // Re-declare the knex factory function for ESM consumers.
8
- // This matches the call signature from the CJS types.
9
- declare function knex<TRecord extends {} = any, TResult = unknown[]>(
10
- config: Knex.Config | string
11
- ): Knex<TRecord, TResult>;
12
-
13
- export { knex, Knex };
14
- export default knex;