knex 3.2.4 → 3.2.5
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/README.md +21 -0
- package/package.json +4 -3
- package/types/index.d.mts +7 -4
package/README.md
CHANGED
|
@@ -37,6 +37,27 @@ For knex-based Object Relational Mapper, see:
|
|
|
37
37
|
|
|
38
38
|
To see the SQL that Knex will generate for a given query, you can use [Knex Query Lab](https://michaelavila.com/knex-querylab/)
|
|
39
39
|
|
|
40
|
+
## Local Development Setup
|
|
41
|
+
|
|
42
|
+
### Prerequisites
|
|
43
|
+
|
|
44
|
+
- Node.js 16+
|
|
45
|
+
- Python 3.x with `setuptools` installed (required for building native dependencies like `better-sqlite3`)
|
|
46
|
+
|
|
47
|
+
Python 3.12+ removed the built-in `distutils` module. If you encounter a `ModuleNotFoundError: No module named 'distutils'` error during `npm install`, install `setuptools` for the Python version used by node-gyp:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install setuptools
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
- **Windows only:** [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) with the "Desktop development with C++" workload
|
|
54
|
+
|
|
55
|
+
### Install dependencies
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm install
|
|
59
|
+
```
|
|
60
|
+
|
|
40
61
|
## Examples
|
|
41
62
|
|
|
42
63
|
We have several examples [on the website](http://knexjs.org). Here is the first one to get you started:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knex",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.5",
|
|
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",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"coveralls": "nyc report --reporter=lcov",
|
|
37
37
|
"lint": "eslint --cache .",
|
|
38
38
|
"lint:fix": "eslint --cache --fix .",
|
|
39
|
-
"lint:types": "tsd",
|
|
39
|
+
"lint:types": "tsd && tstyche --target 5.4 test-tstyche/esm-types.tst.ts",
|
|
40
40
|
"lint:everything": "npm run lint && npm run lint:types",
|
|
41
41
|
"lint:fix:everything": "npm run lint:fix && npm run lint:types",
|
|
42
42
|
"test:unit": "npm run test:unit-only && npm run test:cli",
|
|
@@ -170,7 +170,8 @@
|
|
|
170
170
|
"toxiproxy-node-client": "^4.0.0",
|
|
171
171
|
"ts-node": "^10.9.1",
|
|
172
172
|
"tsd": "^0.28.1",
|
|
173
|
-
"
|
|
173
|
+
"tstyche": "^6.2.0",
|
|
174
|
+
"typescript": "5.4.5"
|
|
174
175
|
},
|
|
175
176
|
"buildDependencies": [
|
|
176
177
|
"rimraf"
|
package/types/index.d.mts
CHANGED
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
// This file provides ESM type definitions that wrap the CJS types from index.d.ts
|
|
3
3
|
// to match the exports defined in knex.mjs
|
|
4
4
|
|
|
5
|
-
import type
|
|
5
|
+
import type { Knex } from './index.d.ts';
|
|
6
6
|
|
|
7
|
-
// Re-
|
|
8
|
-
|
|
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>;
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
export { knex, Knex };
|
|
11
14
|
export default knex;
|