@aws-amplify/graphql-model-transformer 1.4.0-rds.3 → 1.4.0
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 +24 -8
- package/lib/definitions.d.ts.map +1 -1
- package/lib/definitions.js +28 -2
- package/lib/definitions.js.map +1 -1
- package/lib/graphql-model-transformer.d.ts.map +1 -1
- package/lib/graphql-model-transformer.js +38 -36
- package/lib/graphql-model-transformer.js.map +1 -1
- package/lib/graphql-types/common.d.ts.map +1 -1
- package/lib/graphql-types/common.js +16 -18
- package/lib/graphql-types/common.js.map +1 -1
- package/lib/graphql-types/mutation.d.ts.map +1 -1
- package/lib/graphql-types/mutation.js +12 -12
- package/lib/graphql-types/mutation.js.map +1 -1
- package/lib/graphql-types/query.d.ts.map +1 -1
- package/lib/graphql-types/query.js.map +1 -1
- package/lib/rds-lambda.zip +0 -0
- package/lib/rds-notification-lambda.zip +0 -0
- package/lib/rds-patching-lambda.zip +0 -0
- package/lib/resolvers/common.d.ts.map +1 -1
- package/lib/resolvers/common.js.map +1 -1
- package/lib/resolvers/dynamodb/mutation.d.ts.map +1 -1
- package/lib/resolvers/dynamodb/mutation.js +10 -8
- package/lib/resolvers/dynamodb/mutation.js.map +1 -1
- package/lib/resolvers/dynamodb/query.d.ts.map +1 -1
- package/lib/resolvers/dynamodb/query.js +1 -4
- package/lib/resolvers/dynamodb/query.js.map +1 -1
- package/lib/resolvers/dynamodb/subscriptions.d.ts.map +1 -1
- package/lib/resolvers/dynamodb/subscriptions.js.map +1 -1
- package/lib/resolvers/generators/dynamodb-vtl-generator.d.ts.map +1 -1
- package/lib/resolvers/generators/dynamodb-vtl-generator.js.map +1 -1
- package/lib/resolvers/generators/rds-vtl-generator.d.ts.map +1 -1
- package/lib/resolvers/generators/rds-vtl-generator.js.map +1 -1
- package/lib/resolvers/generators/vtl-generator.d.ts.map +1 -1
- package/lib/resolvers/index.d.ts.map +1 -1
- package/lib/resolvers/index.js.map +1 -1
- package/lib/resolvers/rds/mutation.d.ts.map +1 -1
- package/lib/resolvers/rds/mutation.js.map +1 -1
- package/lib/resolvers/rds/query.d.ts.map +1 -1
- package/lib/resolvers/rds/query.js.map +1 -1
- package/lib/resolvers/rds/resolver.d.ts +2 -2
- package/lib/resolvers/rds/resolver.d.ts.map +1 -1
- package/lib/resolvers/rds/resolver.js +82 -82
- package/lib/resolvers/rds/resolver.js.map +1 -1
- package/lib/resources/dynamo-model-resource-generator.d.ts +1 -1
- package/lib/resources/dynamo-model-resource-generator.d.ts.map +1 -1
- package/lib/resources/dynamo-model-resource-generator.js +2 -2
- package/lib/resources/dynamo-model-resource-generator.js.map +1 -1
- package/lib/resources/model-resource-generator.d.ts.map +1 -1
- package/lib/resources/model-resource-generator.js +15 -7
- package/lib/resources/model-resource-generator.js.map +1 -1
- package/lib/resources/rds-model-resource-generator.d.ts.map +1 -1
- package/lib/resources/rds-model-resource-generator.js +1 -1
- package/lib/resources/rds-model-resource-generator.js.map +1 -1
- package/package.json +17 -8
- package/publish-notification-lambda/node_modules/.package-lock.json +10 -10
- package/publish-notification-lambda/node_modules/@smithy/protocol-http/package.json +3 -3
- package/publish-notification-lambda/node_modules/@smithy/types/package.json +2 -2
- package/publish-notification-lambda/node_modules/@types/node/README.md +1 -1
- package/publish-notification-lambda/node_modules/@types/node/package.json +2 -2
- package/publish-notification-lambda/package-lock.json +10 -10
- package/publish-notification-lambda/src/index.ts +2 -2
- package/publish-notification-lambda/tsconfig.json +9 -9
- package/rds-lambda/handler.ts +17 -4
- package/rds-lambda/node_modules/.package-lock.json +373 -374
- package/rds-lambda/node_modules/@babel/compat-data/README.md +1 -1
- package/rds-lambda/node_modules/@babel/compat-data/data/corejs2-built-ins.json +146 -0
- package/rds-lambda/node_modules/@babel/compat-data/data/native-modules.json +1 -1
- package/rds-lambda/node_modules/@babel/compat-data/data/plugin-bugfixes.json +17 -0
- package/rds-lambda/node_modules/@babel/compat-data/data/plugins.json +76 -9
- package/rds-lambda/node_modules/@babel/compat-data/package.json +4 -4
- package/rds-lambda/node_modules/@babel/core/README.md +1 -1
- package/rds-lambda/node_modules/@babel/core/package.json +10 -10
- package/rds-lambda/node_modules/@babel/generator/README.md +1 -1
- package/rds-lambda/node_modules/@babel/generator/package.json +4 -3
- package/rds-lambda/node_modules/@babel/helper-compilation-targets/README.md +1 -1
- package/rds-lambda/node_modules/@babel/helper-compilation-targets/package.json +5 -5
- package/rds-lambda/node_modules/@babel/helper-module-transforms/README.md +1 -1
- package/rds-lambda/node_modules/@babel/helper-module-transforms/package.json +10 -6
- package/rds-lambda/node_modules/@babel/helper-split-export-declaration/README.md +1 -1
- package/rds-lambda/node_modules/@babel/helper-split-export-declaration/package.json +1 -1
- package/rds-lambda/node_modules/@babel/helpers/README.md +1 -1
- package/rds-lambda/node_modules/@babel/helpers/package.json +3 -3
- package/rds-lambda/node_modules/@babel/parser/README.md +1 -1
- package/rds-lambda/node_modules/@babel/parser/package.json +2 -2
- package/rds-lambda/node_modules/@babel/traverse/README.md +1 -1
- package/rds-lambda/node_modules/@babel/traverse/package.json +4 -4
- package/rds-lambda/node_modules/@jest/console/package.json +6 -6
- package/rds-lambda/node_modules/@jest/core/package.json +21 -21
- package/rds-lambda/node_modules/@jest/environment/package.json +5 -5
- package/rds-lambda/node_modules/@jest/expect/package.json +6 -6
- package/rds-lambda/node_modules/@jest/expect-utils/package.json +5 -5
- package/rds-lambda/node_modules/@jest/fake-timers/package.json +7 -7
- package/rds-lambda/node_modules/@jest/globals/package.json +6 -6
- package/rds-lambda/node_modules/@jest/reporters/package.json +14 -14
- package/rds-lambda/node_modules/@jest/schemas/package.json +3 -3
- package/rds-lambda/node_modules/@jest/source-map/package.json +3 -3
- package/rds-lambda/node_modules/@jest/test-result/package.json +6 -6
- package/rds-lambda/node_modules/@jest/test-sequencer/package.json +5 -5
- package/rds-lambda/node_modules/@jest/transform/package.json +7 -7
- package/rds-lambda/node_modules/@jest/types/package.json +5 -5
- package/rds-lambda/node_modules/@sinclair/typebox/package.json +3 -8
- package/rds-lambda/node_modules/@sinclair/typebox/readme.md +487 -300
- package/rds-lambda/node_modules/@smithy/protocol-http/package.json +3 -3
- package/rds-lambda/node_modules/@smithy/types/package.json +2 -2
- package/rds-lambda/node_modules/@types/jest/README.md +1 -1
- package/rds-lambda/node_modules/@types/jest/package.json +2 -2
- package/rds-lambda/node_modules/@types/node/README.md +1 -1
- package/rds-lambda/node_modules/@types/node/package.json +2 -2
- package/rds-lambda/node_modules/babel-jest/package.json +4 -4
- package/rds-lambda/node_modules/caniuse-lite/package.json +1 -1
- package/rds-lambda/node_modules/collect-v8-coverage/CHANGELOG.md +7 -0
- package/rds-lambda/node_modules/collect-v8-coverage/package.json +18 -20
- package/rds-lambda/node_modules/commander/Readme.md +7 -2
- package/rds-lambda/node_modules/commander/package.json +17 -17
- package/rds-lambda/node_modules/electron-to-chromium/full-chromium-versions.json +1 -1
- package/rds-lambda/node_modules/electron-to-chromium/full-versions.json +1 -1
- package/rds-lambda/node_modules/electron-to-chromium/package.json +1 -1
- package/rds-lambda/node_modules/electron-to-chromium/versions.json +1 -1
- package/rds-lambda/node_modules/expect/package.json +10 -9
- package/rds-lambda/node_modules/jest/package.json +7 -7
- package/rds-lambda/node_modules/jest-circus/package.json +15 -14
- package/rds-lambda/node_modules/jest-cli/package.json +10 -9
- package/rds-lambda/node_modules/jest-config/package.json +14 -14
- package/rds-lambda/node_modules/jest-diff/package.json +4 -4
- package/rds-lambda/node_modules/jest-each/package.json +5 -5
- package/rds-lambda/node_modules/jest-environment-node/package.json +8 -8
- package/rds-lambda/node_modules/jest-haste-map/package.json +5 -5
- package/rds-lambda/node_modules/jest-leak-detector/package.json +3 -3
- package/rds-lambda/node_modules/jest-matcher-utils/package.json +5 -5
- package/rds-lambda/node_modules/jest-message-util/package.json +4 -4
- package/rds-lambda/node_modules/jest-mock/package.json +6 -6
- package/rds-lambda/node_modules/jest-resolve/package.json +7 -7
- package/rds-lambda/node_modules/jest-resolve-dependencies/package.json +8 -8
- package/rds-lambda/node_modules/jest-runner/package.json +20 -20
- package/rds-lambda/node_modules/jest-runtime/package.json +17 -17
- package/rds-lambda/node_modules/jest-snapshot/node_modules/semver/package.json +3 -3
- package/rds-lambda/node_modules/jest-snapshot/package.json +15 -17
- package/rds-lambda/node_modules/jest-util/package.json +3 -3
- package/rds-lambda/node_modules/jest-validate/package.json +4 -4
- package/rds-lambda/node_modules/jest-watcher/package.json +5 -5
- package/rds-lambda/node_modules/jest-worker/package.json +6 -6
- package/rds-lambda/node_modules/knex/CHANGELOG.md +63 -21
- package/rds-lambda/node_modules/knex/CONTRIBUTING.md +1 -1
- package/rds-lambda/node_modules/knex/LICENSE +22 -22
- package/rds-lambda/node_modules/knex/README.md +32 -31
- package/rds-lambda/node_modules/knex/UPGRADING.md +94 -82
- package/rds-lambda/node_modules/knex/knex.mjs +11 -0
- package/rds-lambda/node_modules/knex/lib/dialects/oracle/DEAD_CODE.md +3 -3
- package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/cjs.stub +15 -15
- package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/coffee.stub +13 -13
- package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/eg.stub +14 -14
- package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/js-schema.stub +22 -22
- package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/js.stub +22 -22
- package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-coffee.stub +34 -34
- package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-eg.stub +43 -43
- package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-js.stub +47 -47
- package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-ls.stub +35 -35
- package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-ts.stub +47 -47
- package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/ls.stub +14 -14
- package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/mjs.stub +23 -23
- package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/ts-schema.stub +21 -21
- package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/ts.stub +21 -21
- package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/coffee.stub +9 -9
- package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/eg.stub +11 -11
- package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/js.stub +13 -13
- package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/ls.stub +11 -11
- package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/mjs.stub +12 -12
- package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/ts.stub +13 -13
- package/rds-lambda/node_modules/knex/package.json +21 -18
- package/rds-lambda/node_modules/knex/scripts/docker-compose.yml +2 -2
- package/rds-lambda/node_modules/knex/scripts/next-release-howto.md +1 -1
- package/rds-lambda/node_modules/knex/scripts/oracledb-install-driver-libs.sh +82 -82
- package/rds-lambda/node_modules/knex/scripts/release.sh +36 -34
- package/rds-lambda/node_modules/knex/scripts/stress-test/README.txt +18 -18
- package/rds-lambda/node_modules/knex/scripts/stress-test/docker-compose.yml +16 -16
- package/rds-lambda/node_modules/node-releases/data/processed/envs.json +1 -1
- package/rds-lambda/node_modules/node-releases/package.json +1 -1
- package/rds-lambda/node_modules/pg-connection-string/package.json +2 -2
- package/rds-lambda/node_modules/pretty-format/package.json +5 -5
- package/rds-lambda/node_modules/semver/package.json +19 -9
- package/rds-lambda/node_modules/ts-jest/.ts-jest-digest +1 -1
- package/rds-lambda/node_modules/ts-jest/CHANGELOG.md +9 -0
- package/rds-lambda/node_modules/ts-jest/node_modules/semver/package.json +3 -3
- package/rds-lambda/node_modules/ts-jest/package.json +12 -12
- package/rds-lambda/package-lock.json +373 -374
- package/rds-patching-lambda/node_modules/.package-lock.json +10 -10
- package/rds-patching-lambda/node_modules/@smithy/protocol-http/package.json +3 -3
- package/rds-patching-lambda/node_modules/@smithy/types/package.json +2 -2
- package/rds-patching-lambda/node_modules/@types/node/README.md +1 -1
- package/rds-patching-lambda/node_modules/@types/node/package.json +2 -2
- package/rds-patching-lambda/package-lock.json +10 -10
- package/rds-patching-lambda/src/index.ts +2 -4
- package/rds-patching-lambda/tsconfig.json +9 -9
- package/src/__tests__/model-transformer.test.ts +175 -145
- package/src/__tests__/test-utils/helpers.ts +1 -1
- package/src/definitions.ts +30 -2
- package/src/graphql-model-transformer.ts +81 -75
- package/src/graphql-types/common.ts +41 -41
- package/src/graphql-types/mutation.ts +13 -13
- package/src/graphql-types/query.ts +1 -0
- package/src/index.ts +1 -0
- package/src/resolvers/common.ts +1 -12
- package/src/resolvers/dynamodb/mutation.ts +16 -13
- package/src/resolvers/dynamodb/query.ts +7 -12
- package/src/resolvers/dynamodb/subscriptions.ts +1 -3
- package/src/resolvers/generators/dynamodb-vtl-generator.ts +18 -8
- package/src/resolvers/generators/rds-vtl-generator.ts +11 -4
- package/src/resolvers/generators/vtl-generator.ts +5 -5
- package/src/resolvers/index.ts +1 -3
- package/src/resolvers/rds/mutation.ts +76 -70
- package/src/resolvers/rds/query.ts +4 -12
- package/src/resolvers/rds/resolver.ts +124 -130
- package/src/resources/dynamo-model-resource-generator.ts +14 -28
- package/src/resources/model-resource-generator.ts +65 -27
- package/src/resources/rds-model-resource-generator.ts +5 -15
- package/tsconfig.json +4 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/rds-lambda/node_modules/semver/CHANGELOG.md +0 -70
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "semver",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.4",
|
|
4
4
|
"description": "The semantic version parser used by npm.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@npmcli/eslint-config": "^4.0.0",
|
|
17
|
-
"@npmcli/template-oss": "4.
|
|
17
|
+
"@npmcli/template-oss": "4.17.0",
|
|
18
18
|
"tap": "^16.0.0"
|
|
19
19
|
},
|
|
20
20
|
"license": "ISC",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"author": "GitHub Inc.",
|
|
54
54
|
"templateOSS": {
|
|
55
55
|
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
56
|
-
"version": "4.
|
|
56
|
+
"version": "4.17.0",
|
|
57
57
|
"engines": ">=10",
|
|
58
58
|
"ciVersions": [
|
|
59
59
|
"10.0.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-snapshot",
|
|
3
|
-
"version": "29.
|
|
3
|
+
"version": "29.6.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/facebook/jest.git",
|
|
@@ -21,31 +21,29 @@
|
|
|
21
21
|
"@babel/generator": "^7.7.2",
|
|
22
22
|
"@babel/plugin-syntax-jsx": "^7.7.2",
|
|
23
23
|
"@babel/plugin-syntax-typescript": "^7.7.2",
|
|
24
|
-
"@babel/traverse": "^7.7.2",
|
|
25
24
|
"@babel/types": "^7.3.3",
|
|
26
|
-
"@jest/expect-utils": "^29.
|
|
27
|
-
"@jest/transform": "^29.
|
|
28
|
-
"@jest/types": "^29.
|
|
29
|
-
"@types/babel__traverse": "^7.0.6",
|
|
25
|
+
"@jest/expect-utils": "^29.6.1",
|
|
26
|
+
"@jest/transform": "^29.6.1",
|
|
27
|
+
"@jest/types": "^29.6.1",
|
|
30
28
|
"@types/prettier": "^2.1.5",
|
|
31
29
|
"babel-preset-current-node-syntax": "^1.0.0",
|
|
32
30
|
"chalk": "^4.0.0",
|
|
33
|
-
"expect": "^29.
|
|
31
|
+
"expect": "^29.6.1",
|
|
34
32
|
"graceful-fs": "^4.2.9",
|
|
35
|
-
"jest-diff": "^29.
|
|
33
|
+
"jest-diff": "^29.6.1",
|
|
36
34
|
"jest-get-type": "^29.4.3",
|
|
37
|
-
"jest-matcher-utils": "^29.
|
|
38
|
-
"jest-message-util": "^29.
|
|
39
|
-
"jest-util": "^29.
|
|
35
|
+
"jest-matcher-utils": "^29.6.1",
|
|
36
|
+
"jest-message-util": "^29.6.1",
|
|
37
|
+
"jest-util": "^29.6.1",
|
|
40
38
|
"natural-compare": "^1.4.0",
|
|
41
|
-
"pretty-format": "^29.
|
|
42
|
-
"semver": "^7.3
|
|
39
|
+
"pretty-format": "^29.6.1",
|
|
40
|
+
"semver": "^7.5.3"
|
|
43
41
|
},
|
|
44
42
|
"devDependencies": {
|
|
45
43
|
"@babel/preset-flow": "^7.7.2",
|
|
46
44
|
"@babel/preset-react": "^7.12.1",
|
|
47
|
-
"@jest/test-utils": "^29.
|
|
48
|
-
"@tsd/typescript": "^
|
|
45
|
+
"@jest/test-utils": "^29.6.1",
|
|
46
|
+
"@tsd/typescript": "^5.0.4",
|
|
49
47
|
"@types/babel__core": "^7.1.14",
|
|
50
48
|
"@types/graceful-fs": "^4.1.3",
|
|
51
49
|
"@types/natural-compare": "^1.4.0",
|
|
@@ -53,7 +51,7 @@
|
|
|
53
51
|
"ansi-regex": "^5.0.1",
|
|
54
52
|
"ansi-styles": "^5.0.0",
|
|
55
53
|
"prettier": "^2.1.1",
|
|
56
|
-
"tsd-lite": "^0.
|
|
54
|
+
"tsd-lite": "^0.7.0"
|
|
57
55
|
},
|
|
58
56
|
"engines": {
|
|
59
57
|
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
|
@@ -61,5 +59,5 @@
|
|
|
61
59
|
"publishConfig": {
|
|
62
60
|
"access": "public"
|
|
63
61
|
},
|
|
64
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "1f019afdcdfc54a6664908bb45f343db4e3d0848"
|
|
65
63
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-util",
|
|
3
|
-
"version": "29.
|
|
3
|
+
"version": "29.6.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/facebook/jest.git",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"./package.json": "./package.json"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@jest/types": "^29.
|
|
20
|
+
"@jest/types": "^29.6.1",
|
|
21
21
|
"@types/node": "*",
|
|
22
22
|
"chalk": "^4.0.0",
|
|
23
23
|
"ci-info": "^3.2.0",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "1f019afdcdfc54a6664908bb45f343db4e3d0848"
|
|
38
38
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-validate",
|
|
3
|
-
"version": "29.
|
|
3
|
+
"version": "29.6.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/facebook/jest.git",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"./package.json": "./package.json"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@jest/types": "^29.
|
|
20
|
+
"@jest/types": "^29.6.1",
|
|
21
21
|
"camelcase": "^6.2.0",
|
|
22
22
|
"chalk": "^4.0.0",
|
|
23
23
|
"jest-get-type": "^29.4.3",
|
|
24
24
|
"leven": "^3.1.0",
|
|
25
|
-
"pretty-format": "^29.
|
|
25
|
+
"pretty-format": "^29.6.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/yargs": "^17.0.8"
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "1f019afdcdfc54a6664908bb45f343db4e3d0848"
|
|
37
37
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-watcher",
|
|
3
3
|
"description": "Delightful JavaScript Testing.",
|
|
4
|
-
"version": "29.
|
|
4
|
+
"version": "29.6.1",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"./package.json": "./package.json"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@jest/test-result": "^29.
|
|
16
|
-
"@jest/types": "^29.
|
|
15
|
+
"@jest/test-result": "^29.6.1",
|
|
16
|
+
"@jest/types": "^29.6.1",
|
|
17
17
|
"@types/node": "*",
|
|
18
18
|
"ansi-escapes": "^4.2.1",
|
|
19
19
|
"chalk": "^4.0.0",
|
|
20
20
|
"emittery": "^0.13.1",
|
|
21
|
-
"jest-util": "^29.
|
|
21
|
+
"jest-util": "^29.6.1",
|
|
22
22
|
"string-length": "^4.0.1"
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "1f019afdcdfc54a6664908bb45f343db4e3d0848"
|
|
41
41
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-worker",
|
|
3
|
-
"version": "29.
|
|
3
|
+
"version": "29.6.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/facebook/jest.git",
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@types/node": "*",
|
|
21
|
-
"jest-util": "^29.
|
|
21
|
+
"jest-util": "^29.6.1",
|
|
22
22
|
"merge-stream": "^2.0.0",
|
|
23
23
|
"supports-color": "^8.0.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@babel/core": "^7.11.6",
|
|
27
|
-
"@tsd/typescript": "^
|
|
27
|
+
"@tsd/typescript": "^5.0.4",
|
|
28
28
|
"@types/merge-stream": "^1.1.2",
|
|
29
29
|
"@types/supports-color": "^8.1.0",
|
|
30
30
|
"get-stream": "^6.0.0",
|
|
31
|
-
"jest-leak-detector": "^29.
|
|
32
|
-
"tsd-lite": "^0.
|
|
31
|
+
"jest-leak-detector": "^29.6.1",
|
|
32
|
+
"tsd-lite": "^0.7.0",
|
|
33
33
|
"worker-farm": "^1.6.0"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "1f019afdcdfc54a6664908bb45f343db4e3d0848"
|
|
42
42
|
}
|
|
@@ -1,18 +1,60 @@
|
|
|
1
1
|
# Master (Unreleased)
|
|
2
2
|
|
|
3
|
-
# 2.
|
|
3
|
+
# 2.5.1 - 12 July, 2023
|
|
4
|
+
|
|
5
|
+
### Bug fixes
|
|
6
|
+
|
|
7
|
+
- Fix Linting #5455 - #5460
|
|
8
|
+
|
|
9
|
+
# 2.5.0 - 08 July, 2023
|
|
10
|
+
|
|
11
|
+
### New features
|
|
12
|
+
|
|
13
|
+
- Add uuid helper function (#5617)
|
|
14
|
+
- Add `nativeBindings` option to `better-sqlite3` options (#5461)
|
|
15
|
+
- Add QueryBuilder#updateFrom (#5386)
|
|
16
|
+
- Add readonly transaction access mode (#5445)
|
|
17
|
+
- Add readonly option to Better-SQLite3 (#5530)
|
|
18
|
+
- Add EXCEPT as a valid keyword (#5357)
|
|
19
|
+
- Add ability to prepend query comments (#5289)
|
|
20
|
+
- Add fetchAsString option (#5484)
|
|
21
|
+
|
|
22
|
+
### Bug fixes
|
|
23
|
+
|
|
24
|
+
- Avoid password leaks on query logs (#5559)
|
|
25
|
+
- Add knex.mjs to files in package.json (#5518)
|
|
26
|
+
- Handle numeric array elements in .orderBy() (#5551)
|
|
27
|
+
- Attach error handler early enough (#5552)
|
|
28
|
+
- Fix Returning \* in Oracle (#5598)
|
|
29
|
+
- Fix indexType option in `Postgres` (#5601)
|
|
30
|
+
- Add mjs extension type (#5616)
|
|
31
|
+
- Use implicit check on json fields for OracleDB (#5478)
|
|
32
|
+
- Fix when manually close source stream (#5466)
|
|
33
|
+
- Fix case sensitive issue with get table (#5509)
|
|
34
|
+
|
|
35
|
+
### Typings
|
|
36
|
+
|
|
37
|
+
- Add Object syntax overload to increment method (#5512)
|
|
38
|
+
- Add object syntax overload to decrement method (#5555)
|
|
39
|
+
- Fix typing for toSql (#5594)
|
|
40
|
+
- Add ResolveTableType for `.merge()` (#5605)
|
|
41
|
+
- Add missing types for havingNull and havingNotNull (#5529)
|
|
42
|
+
- Add collate to the columnbuilder interface (#5568)
|
|
43
|
+
- TableBuilder methods return the SchemaBuilder. (#5486)
|
|
44
|
+
|
|
45
|
+
# 2.4.2 - 22 January, 2023
|
|
4
46
|
|
|
5
47
|
### Bug fixes
|
|
6
48
|
|
|
7
49
|
- CLI: Fix incorrent EOL causing errors on Linux #5455
|
|
8
50
|
|
|
9
|
-
# 2.4.1 - 18 January,
|
|
51
|
+
# 2.4.1 - 18 January, 2023
|
|
10
52
|
|
|
11
53
|
### Bug fixes
|
|
12
54
|
|
|
13
55
|
- PostgreSQL: Fix Malformed array literal 2.4.0 Regression #5439
|
|
14
56
|
|
|
15
|
-
# 2.4.0 - 06 January,
|
|
57
|
+
# 2.4.0 - 06 January, 2023
|
|
16
58
|
|
|
17
59
|
### New features:
|
|
18
60
|
|
|
@@ -465,13 +507,13 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
|
|
|
465
507
|
- Change default to not trigger a promise rejection for transactions with a specified handler #4195
|
|
466
508
|
- Make toSQL().toNative() work for Raw to match the API for QueryBuilder #4058
|
|
467
509
|
- Allow 'match' operator #3569
|
|
468
|
-
- Support optimizer hints #4243
|
|
510
|
+
- Support optimizer hints #4243
|
|
469
511
|
- Add parameter to prevent autoincrement columns from being primary keys #4266
|
|
470
|
-
- Make "first" and "pluck" mutually exclusive #4280
|
|
512
|
+
- Make "first" and "pluck" mutually exclusive #4280
|
|
471
513
|
- Added merge strategy to allow selecting columns to upsert. #4252
|
|
472
514
|
- Throw error if the array passed to insert is empty #4289
|
|
473
515
|
- Events: introduce queryContext on query-error #4301
|
|
474
|
-
- CLI: Use UTC timestamp for new migrations #4245
|
|
516
|
+
- CLI: Use UTC timestamp for new migrations #4245
|
|
475
517
|
- MSSQL: Replace MSSQL dialect with Tedious.js implementation #2857 #4281
|
|
476
518
|
- MSSQL: Use "nvarchar(max)" for ".json()" #4278
|
|
477
519
|
- MSSQL: Schema builder - add predictable constraint names for default values #4319
|
|
@@ -513,9 +555,9 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
|
|
|
513
555
|
- Various internal refactorings #4175 #4177 #4178 #4192
|
|
514
556
|
- Refactor to classes #4190 #4191 #4193 #4210 #4253
|
|
515
557
|
- Move transaction type tests to TSD #4208
|
|
516
|
-
- Clean up destroy logic #4248
|
|
517
|
-
- Colorize code snippets in readme files #4234
|
|
518
|
-
- Add "Ecosystem" documentation for Knex plugins #4183
|
|
558
|
+
- Clean up destroy logic #4248
|
|
559
|
+
- Colorize code snippets in readme files #4234
|
|
560
|
+
- Add "Ecosystem" documentation for Knex plugins #4183
|
|
519
561
|
- Documentation cleanup
|
|
520
562
|
- SQLite: Use SQLite "rename column" instead of a DDL helper #4200
|
|
521
563
|
- SQLite: Simplify reinsert logic when altering a table #4272
|
|
@@ -570,7 +612,7 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
|
|
|
570
612
|
|
|
571
613
|
### Bug fixes:
|
|
572
614
|
|
|
573
|
-
- Make sure query-response and query-error events contain _knexTxId #4160
|
|
615
|
+
- Make sure query-response and query-error events contain \_knexTxId #4160
|
|
574
616
|
|
|
575
617
|
### Test / internal changes:
|
|
576
618
|
|
|
@@ -826,7 +868,7 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
|
|
|
826
868
|
|
|
827
869
|
### Bug fixes:
|
|
828
870
|
|
|
829
|
-
- Correctly handle dateToString escaping without timezone passed #3742
|
|
871
|
+
- Correctly handle dateToString escaping without timezone passed #3742
|
|
830
872
|
- Make protocol length check more defensive #3744
|
|
831
873
|
|
|
832
874
|
### Typings:
|
|
@@ -837,7 +879,7 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
|
|
|
837
879
|
|
|
838
880
|
### Bug fixes:
|
|
839
881
|
|
|
840
|
-
- Added missing call to _reject in Transactor#transaction #3706
|
|
882
|
+
- Added missing call to \_reject in Transactor#transaction #3706
|
|
841
883
|
- Fix method binding on knex proxy #3717
|
|
842
884
|
- Oracle: Transaction_OracleDB can use config.connection #3731
|
|
843
885
|
|
|
@@ -848,7 +890,7 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
|
|
|
848
890
|
### Test / internal changes:
|
|
849
891
|
|
|
850
892
|
- Cleanup/remove transaction stalling #3716
|
|
851
|
-
- Rewrote Transaction#acquireConnection() methods to use async #3707
|
|
893
|
+
- Rewrote Transaction#acquireConnection() methods to use async #3707
|
|
852
894
|
|
|
853
895
|
# 0.20.11 - 26 February, 2020
|
|
854
896
|
|
|
@@ -884,7 +926,7 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
|
|
|
884
926
|
### Typings:
|
|
885
927
|
|
|
886
928
|
- `fn.now` takes optionally a precision argument. #3662
|
|
887
|
-
- PG: Include SSL in connection definition #3659
|
|
929
|
+
- PG: Include SSL in connection definition #3659
|
|
888
930
|
|
|
889
931
|
### Test / internal changes:
|
|
890
932
|
|
|
@@ -898,7 +940,7 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
|
|
|
898
940
|
|
|
899
941
|
### Typings:
|
|
900
942
|
|
|
901
|
-
- MSSQL: Add `enableArithAbort` to `MsSqlConnectionConfig`
|
|
943
|
+
- MSSQL: Add `enableArithAbort` to `MsSqlConnectionConfig`
|
|
902
944
|
|
|
903
945
|
### Test / internal changes:
|
|
904
946
|
|
|
@@ -917,7 +959,7 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
|
|
|
917
959
|
|
|
918
960
|
### Typings:
|
|
919
961
|
|
|
920
|
-
- Fix incorrect type of QueryBuilder.first('
|
|
962
|
+
- Fix incorrect type of QueryBuilder.first('\*') result #3621
|
|
921
963
|
|
|
922
964
|
# 0.20.7 - 07 January, 2020
|
|
923
965
|
|
|
@@ -1072,7 +1114,7 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
|
|
|
1072
1114
|
### Typings:
|
|
1073
1115
|
|
|
1074
1116
|
- Add missing Migrator.list typing #3460
|
|
1075
|
-
- Fix Typescript type inference for to better support wildcard (
|
|
1117
|
+
- Fix Typescript type inference for to better support wildcard (\*) calls #3444
|
|
1076
1118
|
- Make options argument optional in timeout #3442
|
|
1077
1119
|
|
|
1078
1120
|
### Test / internal changes:
|
|
@@ -1109,7 +1151,7 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
|
|
|
1109
1151
|
|
|
1110
1152
|
### Changes:
|
|
1111
1153
|
|
|
1112
|
-
- migrate: Refactor _lockMigrations to avoid forUpdate - makes migrations compatible with CockroachDB #3395
|
|
1154
|
+
- migrate: Refactor \_lockMigrations to avoid forUpdate - makes migrations compatible with CockroachDB #3395
|
|
1113
1155
|
|
|
1114
1156
|
# 0.19.2 - 17 August, 2019
|
|
1115
1157
|
|
|
@@ -1120,7 +1162,7 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
|
|
|
1120
1162
|
|
|
1121
1163
|
### New features:
|
|
1122
1164
|
|
|
1123
|
-
- Fallback to JSON when using JSONB in MySQL #3394
|
|
1165
|
+
- Fallback to JSON when using JSONB in MySQL #3394
|
|
1124
1166
|
|
|
1125
1167
|
# 0.19.1 - 23 July, 2019
|
|
1126
1168
|
|
|
@@ -1139,7 +1181,7 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
|
|
|
1139
1181
|
|
|
1140
1182
|
### Changes:
|
|
1141
1183
|
|
|
1142
|
-
- Pooling: tarn.js connection pool was updated to version 2.0.0. This fixes issue with destroying connections and introduces support for connection pool event handlers. Please see tarn.js documentation for more details #3345
|
|
1184
|
+
- Pooling: tarn.js connection pool was updated to version 2.0.0. This fixes issue with destroying connections and introduces support for connection pool event handlers. Please see tarn.js documentation for more details #3345
|
|
1143
1185
|
- Pooling: Passing unsupported pooling configuration options now throws an error
|
|
1144
1186
|
- Pooling: `beforeDestroy` configuration option was removed
|
|
1145
1187
|
|
|
@@ -1330,7 +1372,7 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
|
|
|
1330
1372
|
- Typings: Add 'string' as accepted Knex constructor type definition #3105
|
|
1331
1373
|
- Typings: Add boolean as a column name in join #3121
|
|
1332
1374
|
- Typings: Add missing clearOrder & clearCounters types #3109
|
|
1333
|
-
- Dependencies: Fix security warning #3082
|
|
1375
|
+
- Dependencies: Fix security warning #3082
|
|
1334
1376
|
- Do not use unsupported column width/length arguments on data types int and tinyint in MSSQL #2738
|
|
1335
1377
|
|
|
1336
1378
|
### Changes:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## How to contribute to Knex.js
|
|
2
2
|
|
|
3
|
-
- Make changes in the `/lib` directory.
|
|
3
|
+
- Make changes in the `/lib` directory.
|
|
4
4
|
|
|
5
5
|
- Before sending a pull request for a feature or bug fix, be sure to have
|
|
6
6
|
[tests](https://github.com/knex/knex/tree/master/test). Every pull request that changes the queries should have
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
Copyright (c) 2013-present Tim Griesser
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person
|
|
4
|
-
obtaining a copy of this software and associated documentation
|
|
5
|
-
files (the "Software"), to deal in the Software without
|
|
6
|
-
restriction, including without limitation the rights to use,
|
|
7
|
-
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
-
copies of the Software, and to permit persons to whom the
|
|
9
|
-
Software is furnished to do so, subject to the following
|
|
10
|
-
conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be
|
|
13
|
-
included in all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
16
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
17
|
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
18
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
19
|
-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
20
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
21
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
Copyright (c) 2013-present Tim Griesser
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person
|
|
4
|
+
obtaining a copy of this software and associated documentation
|
|
5
|
+
files (the "Software"), to deal in the Software without
|
|
6
|
+
restriction, including without limitation the rights to use,
|
|
7
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the
|
|
9
|
+
Software is furnished to do so, subject to the following
|
|
10
|
+
conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be
|
|
13
|
+
included in all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
17
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
19
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
20
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
21
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
[](https://coveralls.io/r/knex/knex?branch=master)
|
|
7
7
|
[](https://libraries.io/npm/knex)
|
|
8
8
|
[](https://gitter.im/tgriesser/knex)
|
|
9
|
-
[](https://lgtm.com/projects/g/knex/knex/context:javascript)
|
|
10
9
|
|
|
11
10
|
> **A SQL query builder that is _flexible_, _portable_, and _fun_ to use!**
|
|
12
11
|
|
|
@@ -21,14 +20,13 @@ Node.js, featuring:
|
|
|
21
20
|
|
|
22
21
|
Node.js versions 12+ are supported.
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
- Take a look at the [full documentation](https://knex.github.io/documentation) to get started!
|
|
24
|
+
- Browse the [list of plugins and tools](https://github.com/knex/knex/blob/master/ECOSYSTEM.md) built for knex
|
|
25
|
+
- Check out our [recipes wiki](https://github.com/knex/knex/wiki/Recipes) to search for solutions to some specific problems
|
|
26
|
+
- In case of upgrading from an older version, see [migration guide](https://github.com/knex/knex/blob/master/UPGRADING.md)
|
|
28
27
|
|
|
29
28
|
You can report bugs and discuss features on the [GitHub issues page](https://github.com/knex/knex/issues) or send tweets to [@kibertoad](http://twitter.com/kibertoad).
|
|
30
29
|
|
|
31
|
-
|
|
32
30
|
For support and questions, join our [Gitter channel](https://gitter.im/tgriesser/knex).
|
|
33
31
|
|
|
34
32
|
For knex-based Object Relational Mapper, see:
|
|
@@ -52,46 +50,46 @@ const knex = require('knex')({
|
|
|
52
50
|
});
|
|
53
51
|
|
|
54
52
|
try {
|
|
55
|
-
|
|
56
53
|
// Create a table
|
|
57
54
|
await knex.schema
|
|
58
|
-
.createTable('users', table => {
|
|
55
|
+
.createTable('users', (table) => {
|
|
59
56
|
table.increments('id');
|
|
60
57
|
table.string('user_name');
|
|
61
58
|
})
|
|
62
59
|
// ...and another
|
|
63
|
-
.createTable('accounts', table => {
|
|
60
|
+
.createTable('accounts', (table) => {
|
|
64
61
|
table.increments('id');
|
|
65
62
|
table.string('account_name');
|
|
66
|
-
table
|
|
67
|
-
|
|
68
|
-
.unsigned()
|
|
69
|
-
.references('users.id');
|
|
70
|
-
})
|
|
63
|
+
table.integer('user_id').unsigned().references('users.id');
|
|
64
|
+
});
|
|
71
65
|
|
|
72
66
|
// Then query the table...
|
|
73
|
-
const insertedRows = await knex('users').insert({ user_name: 'Tim' })
|
|
67
|
+
const insertedRows = await knex('users').insert({ user_name: 'Tim' });
|
|
74
68
|
|
|
75
69
|
// ...and using the insert id, insert into the other table.
|
|
76
|
-
await knex('accounts').insert({
|
|
70
|
+
await knex('accounts').insert({
|
|
71
|
+
account_name: 'knex',
|
|
72
|
+
user_id: insertedRows[0],
|
|
73
|
+
});
|
|
77
74
|
|
|
78
75
|
// Query both of the rows.
|
|
79
76
|
const selectedRows = await knex('users')
|
|
80
77
|
.join('accounts', 'users.id', 'accounts.user_id')
|
|
81
|
-
.select('users.user_name as user', 'accounts.account_name as account')
|
|
78
|
+
.select('users.user_name as user', 'accounts.account_name as account');
|
|
82
79
|
|
|
83
80
|
// map over the results
|
|
84
|
-
const enrichedRows = selectedRows.map(row => ({ ...row, active: true }))
|
|
81
|
+
const enrichedRows = selectedRows.map((row) => ({ ...row, active: true }));
|
|
85
82
|
|
|
86
83
|
// Finally, add a catch statement
|
|
87
|
-
} catch(e) {
|
|
84
|
+
} catch (e) {
|
|
88
85
|
console.error(e);
|
|
89
|
-
}
|
|
86
|
+
}
|
|
90
87
|
```
|
|
91
88
|
|
|
92
89
|
## TypeScript example
|
|
90
|
+
|
|
93
91
|
```ts
|
|
94
|
-
import { Knex, knex } from 'knex'
|
|
92
|
+
import { Knex, knex } from 'knex';
|
|
95
93
|
|
|
96
94
|
interface User {
|
|
97
95
|
id: number;
|
|
@@ -121,28 +119,31 @@ try {
|
|
|
121
119
|
|
|
122
120
|
If you are launching your Node application with `--experimental-modules`, `knex.mjs` should be picked up automatically and named ESM import should work out-of-the-box.
|
|
123
121
|
Otherwise, if you want to use named imports, you'll have to import knex like this:
|
|
122
|
+
|
|
124
123
|
```js
|
|
125
|
-
import { knex } from 'knex/knex.mjs'
|
|
124
|
+
import { knex } from 'knex/knex.mjs';
|
|
126
125
|
```
|
|
127
126
|
|
|
128
127
|
You can also just do the default import:
|
|
128
|
+
|
|
129
129
|
```js
|
|
130
|
-
import knex from 'knex'
|
|
130
|
+
import knex from 'knex';
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
If you are not using TypeScript and would like the IntelliSense of your IDE to work correctly, it is recommended to set the type explicitly:
|
|
134
|
+
|
|
134
135
|
```js
|
|
135
136
|
/**
|
|
136
137
|
* @type {Knex}
|
|
137
138
|
*/
|
|
138
139
|
const database = knex({
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
140
|
+
client: 'mysql',
|
|
141
|
+
connection: {
|
|
142
|
+
host: '127.0.0.1',
|
|
143
|
+
user: 'your_database_user',
|
|
144
|
+
password: 'your_database_password',
|
|
145
|
+
database: 'myapp_test',
|
|
146
|
+
},
|
|
147
|
+
});
|
|
147
148
|
database.migrate.latest();
|
|
148
149
|
```
|