knex 3.1.0 → 3.2.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.
Files changed (199) hide show
  1. package/CHANGELOG.md +2431 -2380
  2. package/CONTRIBUTING.md +190 -194
  3. package/LICENSE +22 -22
  4. package/README.md +156 -149
  5. package/UPGRADING.md +245 -245
  6. package/bin/cli.js +516 -475
  7. package/bin/knexfile-runtime-error.js +27 -0
  8. package/bin/utils/cli-config-utils.js +217 -212
  9. package/bin/utils/constants.js +7 -7
  10. package/bin/utils/migrationsLister.js +37 -37
  11. package/knex.js +23 -23
  12. package/knex.mjs +11 -11
  13. package/lib/builder-interface-augmenter.js +120 -120
  14. package/lib/client.js +585 -495
  15. package/lib/constants.js +61 -61
  16. package/lib/dialects/better-sqlite3/index.js +101 -77
  17. package/lib/dialects/cockroachdb/crdb-columncompiler.js +14 -14
  18. package/lib/dialects/cockroachdb/crdb-querybuilder.js +11 -11
  19. package/lib/dialects/cockroachdb/crdb-querycompiler.js +122 -122
  20. package/lib/dialects/cockroachdb/crdb-tablecompiler.js +46 -37
  21. package/lib/dialects/cockroachdb/crdb-viewcompiler.js +15 -15
  22. package/lib/dialects/cockroachdb/index.js +86 -86
  23. package/lib/dialects/index.js +34 -34
  24. package/lib/dialects/mssql/index.js +498 -500
  25. package/lib/dialects/mssql/mssql-formatter.js +34 -34
  26. package/lib/dialects/mssql/query/mssql-querycompiler.js +601 -601
  27. package/lib/dialects/mssql/schema/mssql-columncompiler.js +185 -185
  28. package/lib/dialects/mssql/schema/mssql-compiler.js +91 -91
  29. package/lib/dialects/mssql/schema/mssql-tablecompiler.js +393 -378
  30. package/lib/dialects/mssql/schema/mssql-viewcompiler.js +55 -55
  31. package/lib/dialects/mssql/transaction.js +176 -176
  32. package/lib/dialects/mysql/index.js +317 -206
  33. package/lib/dialects/mysql/query/mysql-querybuilder.js +14 -14
  34. package/lib/dialects/mysql/query/mysql-querycompiler.js +292 -292
  35. package/lib/dialects/mysql/schema/mysql-columncompiler.js +193 -193
  36. package/lib/dialects/mysql/schema/mysql-compiler.js +60 -60
  37. package/lib/dialects/mysql/schema/mysql-tablecompiler.js +426 -405
  38. package/lib/dialects/mysql/schema/mysql-viewbuilder.js +21 -21
  39. package/lib/dialects/mysql/schema/mysql-viewcompiler.js +15 -15
  40. package/lib/dialects/mysql/transaction.js +46 -46
  41. package/lib/dialects/mysql2/index.js +53 -53
  42. package/lib/dialects/mysql2/transaction.js +44 -44
  43. package/lib/dialects/oracle/DEAD_CODE.md +5 -5
  44. package/lib/dialects/oracle/index.js +92 -92
  45. package/lib/dialects/oracle/query/oracle-querycompiler.js +343 -343
  46. package/lib/dialects/oracle/schema/internal/incrementUtils.js +22 -22
  47. package/lib/dialects/oracle/schema/internal/trigger.js +155 -155
  48. package/lib/dialects/oracle/schema/oracle-columnbuilder.js +17 -17
  49. package/lib/dialects/oracle/schema/oracle-columncompiler.js +126 -126
  50. package/lib/dialects/oracle/schema/oracle-compiler.js +124 -124
  51. package/lib/dialects/oracle/schema/oracle-tablecompiler.js +210 -197
  52. package/lib/dialects/oracle/utils.js +107 -106
  53. package/lib/dialects/oracledb/index.js +381 -381
  54. package/lib/dialects/oracledb/query/oracledb-querycompiler.js +481 -481
  55. package/lib/dialects/oracledb/schema/oracledb-columncompiler.js +61 -61
  56. package/lib/dialects/oracledb/schema/oracledb-tablecompiler.js +19 -19
  57. package/lib/dialects/oracledb/schema/oracledb-viewbuilder.js +13 -13
  58. package/lib/dialects/oracledb/schema/oracledb-viewcompiler.js +19 -19
  59. package/lib/dialects/oracledb/transaction.js +98 -98
  60. package/lib/dialects/oracledb/utils.js +208 -208
  61. package/lib/dialects/pgnative/index.js +60 -60
  62. package/lib/dialects/postgres/execution/pg-transaction.js +19 -19
  63. package/lib/dialects/postgres/index.js +373 -361
  64. package/lib/dialects/postgres/query/pg-querybuilder.js +43 -43
  65. package/lib/dialects/postgres/query/pg-querycompiler.js +400 -400
  66. package/lib/dialects/postgres/schema/pg-columncompiler.js +162 -156
  67. package/lib/dialects/postgres/schema/pg-compiler.js +138 -138
  68. package/lib/dialects/postgres/schema/pg-tablecompiler.js +331 -304
  69. package/lib/dialects/postgres/schema/pg-viewbuilder.js +21 -21
  70. package/lib/dialects/postgres/schema/pg-viewcompiler.js +35 -35
  71. package/lib/dialects/redshift/index.js +86 -86
  72. package/lib/dialects/redshift/query/redshift-querycompiler.js +163 -163
  73. package/lib/dialects/redshift/schema/redshift-columnbuilder.js +22 -22
  74. package/lib/dialects/redshift/schema/redshift-columncompiler.js +67 -67
  75. package/lib/dialects/redshift/schema/redshift-compiler.js +14 -14
  76. package/lib/dialects/redshift/schema/redshift-tablecompiler.js +134 -122
  77. package/lib/dialects/redshift/schema/redshift-viewcompiler.js +11 -11
  78. package/lib/dialects/redshift/transaction.js +32 -32
  79. package/lib/dialects/sqlite3/execution/sqlite-transaction.js +172 -25
  80. package/lib/dialects/sqlite3/index.js +263 -250
  81. package/lib/dialects/sqlite3/query/sqlite-querybuilder.js +33 -33
  82. package/lib/dialects/sqlite3/query/sqlite-querycompiler.js +341 -334
  83. package/lib/dialects/sqlite3/schema/ddl.js +380 -400
  84. package/lib/dialects/sqlite3/schema/internal/compiler.js +327 -327
  85. package/lib/dialects/sqlite3/schema/internal/parser-combinator.js +161 -161
  86. package/lib/dialects/sqlite3/schema/internal/parser.js +638 -638
  87. package/lib/dialects/sqlite3/schema/internal/sqlite-ddl-operations.js +41 -41
  88. package/lib/dialects/sqlite3/schema/internal/tokenizer.js +38 -38
  89. package/lib/dialects/sqlite3/schema/internal/utils.js +12 -12
  90. package/lib/dialects/sqlite3/schema/sqlite-columncompiler.js +50 -50
  91. package/lib/dialects/sqlite3/schema/sqlite-compiler.js +80 -80
  92. package/lib/dialects/sqlite3/schema/sqlite-tablecompiler.js +364 -347
  93. package/lib/dialects/sqlite3/schema/sqlite-viewcompiler.js +40 -40
  94. package/lib/execution/batch-insert.js +51 -51
  95. package/lib/execution/internal/delay.js +6 -6
  96. package/lib/execution/internal/ensure-connection-callback.js +41 -41
  97. package/lib/execution/internal/query-executioner.js +62 -62
  98. package/lib/execution/runner.js +325 -325
  99. package/lib/execution/transaction.js +417 -413
  100. package/lib/formatter/formatterUtils.js +42 -42
  101. package/lib/formatter/rawFormatter.js +84 -84
  102. package/lib/formatter/wrappingFormatter.js +253 -250
  103. package/lib/formatter.js +25 -25
  104. package/lib/index.js +3 -3
  105. package/lib/knex-builder/FunctionHelper.js +80 -80
  106. package/lib/knex-builder/Knex.js +59 -59
  107. package/lib/knex-builder/internal/config-resolver.js +57 -57
  108. package/lib/knex-builder/internal/parse-connection.js +87 -87
  109. package/lib/knex-builder/make-knex.js +345 -345
  110. package/lib/logger.js +76 -76
  111. package/lib/migrations/common/MigrationsLoader.js +36 -36
  112. package/lib/migrations/migrate/MigrationGenerator.js +84 -84
  113. package/lib/migrations/migrate/Migrator.js +632 -599
  114. package/lib/migrations/migrate/migrate-stub.js +17 -17
  115. package/lib/migrations/migrate/migration-list-resolver.js +33 -33
  116. package/lib/migrations/migrate/migrator-configuration-merger.js +58 -58
  117. package/lib/migrations/migrate/sources/fs-migrations.js +74 -74
  118. package/lib/migrations/migrate/stub/cjs.stub +15 -15
  119. package/lib/migrations/migrate/stub/coffee.stub +13 -13
  120. package/lib/migrations/migrate/stub/eg.stub +14 -14
  121. package/lib/migrations/migrate/stub/js-schema.stub +22 -22
  122. package/lib/migrations/migrate/stub/js.stub +22 -22
  123. package/lib/migrations/migrate/stub/knexfile-coffee.stub +34 -34
  124. package/lib/migrations/migrate/stub/knexfile-eg.stub +43 -43
  125. package/lib/migrations/migrate/stub/knexfile-js.stub +47 -47
  126. package/lib/migrations/migrate/stub/knexfile-ls.stub +35 -35
  127. package/lib/migrations/migrate/stub/knexfile-ts.stub +47 -47
  128. package/lib/migrations/migrate/stub/ls.stub +14 -14
  129. package/lib/migrations/migrate/stub/mjs.stub +23 -23
  130. package/lib/migrations/migrate/stub/ts-schema.stub +21 -21
  131. package/lib/migrations/migrate/stub/ts.stub +21 -21
  132. package/lib/migrations/migrate/table-creator.js +77 -77
  133. package/lib/migrations/migrate/table-resolver.js +27 -27
  134. package/lib/migrations/seed/Seeder.js +137 -137
  135. package/lib/migrations/seed/seed-stub.js +13 -13
  136. package/lib/migrations/seed/seeder-configuration-merger.js +60 -60
  137. package/lib/migrations/seed/sources/fs-seeds.js +65 -65
  138. package/lib/migrations/seed/stub/coffee.stub +9 -9
  139. package/lib/migrations/seed/stub/eg.stub +11 -11
  140. package/lib/migrations/seed/stub/js.stub +13 -13
  141. package/lib/migrations/seed/stub/ls.stub +11 -11
  142. package/lib/migrations/seed/stub/mjs.stub +12 -12
  143. package/lib/migrations/seed/stub/ts.stub +13 -13
  144. package/lib/migrations/util/fs.js +86 -86
  145. package/lib/migrations/util/import-file.js +12 -12
  146. package/lib/migrations/util/is-module-type.js +9 -9
  147. package/lib/migrations/util/template.js +52 -52
  148. package/lib/migrations/util/timestamp.js +14 -14
  149. package/lib/query/analytic.js +52 -52
  150. package/lib/query/constants.js +15 -15
  151. package/lib/query/joinclause.js +270 -270
  152. package/lib/query/method-constants.js +136 -136
  153. package/lib/query/querybuilder.js +1793 -1793
  154. package/lib/query/querycompiler.js +1634 -1591
  155. package/lib/raw.js +139 -139
  156. package/lib/ref.js +39 -39
  157. package/lib/schema/builder.js +115 -115
  158. package/lib/schema/columnbuilder.js +146 -146
  159. package/lib/schema/columncompiler.js +307 -307
  160. package/lib/schema/compiler.js +187 -187
  161. package/lib/schema/internal/helpers.js +55 -55
  162. package/lib/schema/tablebuilder.js +379 -376
  163. package/lib/schema/tablecompiler.js +450 -439
  164. package/lib/schema/viewbuilder.js +92 -92
  165. package/lib/schema/viewcompiler.js +138 -138
  166. package/lib/util/finally-mixin.js +13 -13
  167. package/lib/util/helpers.js +95 -95
  168. package/lib/util/is.js +32 -32
  169. package/lib/util/nanoid.js +40 -40
  170. package/lib/util/noop.js +1 -1
  171. package/lib/util/save-async-stack.js +14 -14
  172. package/lib/util/security.js +32 -26
  173. package/lib/util/string.js +190 -190
  174. package/lib/util/timeout.js +29 -29
  175. package/package.json +285 -267
  176. package/scripts/act-testing/act.sh +19 -0
  177. package/scripts/act-testing/merged-no-label.json +11 -0
  178. package/scripts/act-testing/merged-patch-labeled.json +12 -0
  179. package/scripts/act-testing/merged-skip-labeled.json +12 -0
  180. package/scripts/act-testing/not-merged-patch-labeled.json +12 -0
  181. package/scripts/build-for-release.sh +122 -0
  182. package/scripts/build.js +125 -125
  183. package/scripts/clean.js +31 -31
  184. package/scripts/docker-compose.yml +150 -152
  185. package/scripts/format-changelog.js +55 -0
  186. package/scripts/next-release-howto.md +24 -24
  187. package/scripts/oracledb-install-driver-libs.sh +82 -82
  188. package/scripts/release.sh +36 -36
  189. package/scripts/runkit-example.js +35 -35
  190. package/scripts/stress-test/README.txt +18 -18
  191. package/scripts/stress-test/docker-compose.yml +55 -57
  192. package/scripts/stress-test/knex-stress-test.js +212 -212
  193. package/scripts/stress-test/mysql2-random-hanging-every-now-and-then.js +149 -149
  194. package/scripts/stress-test/mysql2-sudden-exit-without-error.js +101 -101
  195. package/scripts/stress-test/reconnect-test-mysql-based-drivers.js +188 -188
  196. package/types/index.d.ts +3321 -3275
  197. package/types/result.d.ts +27 -27
  198. package/types/tables.d.ts +4 -4
  199. package/scripts/update_gitignore_for_tsc_output.js +0 -90
package/package.json CHANGED
@@ -1,267 +1,285 @@
1
- {
2
- "name": "knex",
3
- "version": "3.1.0",
4
- "description": "A batteries-included SQL query & schema builder for PostgresSQL, MySQL, CockroachDB, MSSQL and SQLite3",
5
- "main": "knex",
6
- "types": "types/index.d.ts",
7
- "engines": {
8
- "node": ">=16"
9
- },
10
- "scripts": {
11
- "build": "npm run build:gitignore && npm run build:ts && npm run format",
12
- "clean": "node scripts/clean.js",
13
- "build:ts": "tsc",
14
- "build:gitignore": "node scripts/update_gitignore_for_tsc_output.js run",
15
- "format": "prettier --write --list-different .",
16
- "format:check": "prettier --list-different .",
17
- "debug:test": "mocha --inspect-brk --exit -t 0 test/all-tests-suite.js",
18
- "debug:tape": "node --inspect-brk test/tape/index.js",
19
- "coveralls": "nyc report --reporter=lcov",
20
- "lint": "eslint --cache .",
21
- "lint:fix": "eslint --cache --fix .",
22
- "lint:types": "tsd",
23
- "lint:types:legacy": "dtslint types",
24
- "lint:everything": "npm run lint && npm run lint:types",
25
- "lint:fix:everything": "npm run lint:fix && npm run lint:types",
26
- "test:unit": "npm run test:unit-only && npm run test:cli",
27
- "test:unit-only": "mocha --exit -t 10000 --config test/mocha-unit-config-test.js",
28
- "test:db": "mocha --exit -t 10000 --config test/mocha-integration-config-test.js",
29
- "test:db:coverage": "nyc mocha --exit --check-leaks -t 10000 --config test/mocha-integration-config-test.js && npm run test:tape",
30
- "test:db:no-oracle": "cross-env DB=\"mssql mysql mysql2 postgres sqlite3\" mocha --exit -t 10000 --config test/mocha-integration-config-test.js && npm run test:tape",
31
- "test": "mocha --exit -t 10000 --config test/mocha-all-config-test.js && npm run test:tape && npm run test:cli",
32
- "test:coverage": "nyc mocha --exit --check-leaks -t 10000 --config test/mocha-all-config-test.js && npm run test:tape && npm run test:cli",
33
- "test:everything": "npm run lint:everything && npm run test:coverage",
34
- "test:mssql": "cross-env DB=mssql npm run test:db",
35
- "test:mysql": "cross-env DB=mysql npm run test:db",
36
- "test:mysql2": "cross-env DB=mysql2 npm run test:db",
37
- "test:oracledb": "cross-env DB=oracledb npm run test:db",
38
- "test:sqlite": "cross-env DB=sqlite3 npm run test:db",
39
- "test:better-sqlite3": "cross-env DB=better-sqlite3 npm run test:db",
40
- "test:postgres": "cross-env DB=postgres npm run test:db",
41
- "test:cockroachdb": "cross-env DB=cockroachdb npm run test:db",
42
- "test:pgnative": "cross-env DB=pgnative npm run test:db",
43
- "test:tape": "node test/tape/index.js | tap-spec",
44
- "test:cli": "cross-env KNEX_PATH=../knex.js KNEX=bin/cli.js jake -f test/jake/Jakefile",
45
- "db:start": "docker-compose -f scripts/docker-compose.yml up --build -d mysql oracledb postgres mssql cockroachdb pgnative && docker-compose -f scripts/docker-compose.yml up waitmssql waitmysql waitpostgres waitoracledb",
46
- "db:start:no-oracle": "docker-compose -f scripts/docker-compose.yml up --build -d mysql postgres mssql cockroachdb pgnative && docker-compose -f scripts/docker-compose.yml up waitmssql waitmysql waitpostgres",
47
- "db:stop": "docker-compose -f scripts/docker-compose.yml down",
48
- "db:start:postgres": "docker-compose -f scripts/docker-compose.yml up --build -d postgres && docker-compose -f scripts/docker-compose.yml up waitpostgres",
49
- "db:stop:postgres": "docker-compose -f scripts/docker-compose.yml down",
50
- "db:start:pgnative": "docker-compose -f scripts/docker-compose.yml up --build -d pgnative && docker-compose -f scripts/docker-compose.yml up waitpgnative",
51
- "db:stop:pgnative": "docker-compose -f scripts/docker-compose.yml down",
52
- "db:start:mysql": "docker-compose -f scripts/docker-compose.yml up --build -d mysql && docker-compose -f scripts/docker-compose.yml up waitmysql",
53
- "db:stop:mysql": "docker-compose -f scripts/docker-compose.yml down",
54
- "db:start:mssql": "docker-compose -f scripts/docker-compose.yml up --build -d mssql && docker-compose -f scripts/docker-compose.yml up waitmssql",
55
- "db:stop:mssql": "docker-compose -f scripts/docker-compose.yml down",
56
- "db:start:cockroachdb": "docker-compose -f scripts/docker-compose.yml up --build -d cockroachdb && docker-compose -f scripts/docker-compose.yml up waitcockroachdb",
57
- "db:stop:cockroachdb": "docker-compose -f scripts/docker-compose.yml down",
58
- "db:start:oracle": "docker-compose -f scripts/docker-compose.yml up --build -d oracledb && docker-compose -f scripts/docker-compose.yml up waitoracledb",
59
- "db:stop:oracle": "docker-compose -f scripts/docker-compose.yml down",
60
- "stress:init": "docker-compose -f scripts/stress-test/docker-compose.yml up --no-start && docker-compose -f scripts/stress-test/docker-compose.yml start",
61
- "stress:test": "node scripts/stress-test/knex-stress-test.js | grep -A 5 -B 60 -- '- STATS '",
62
- "stress:destroy": "docker-compose -f scripts/stress-test/docker-compose.yml stop"
63
- },
64
- "dependencies": {
65
- "colorette": "2.0.19",
66
- "commander": "^10.0.0",
67
- "debug": "4.3.4",
68
- "escalade": "^3.1.1",
69
- "esm": "^3.2.25",
70
- "get-package-type": "^0.1.0",
71
- "getopts": "2.3.0",
72
- "interpret": "^2.2.0",
73
- "lodash": "^4.17.21",
74
- "pg-connection-string": "2.6.2",
75
- "rechoir": "^0.8.0",
76
- "resolve-from": "^5.0.0",
77
- "tarn": "^3.0.2",
78
- "tildify": "2.0.0"
79
- },
80
- "peerDependenciesMeta": {
81
- "tedious": {
82
- "optional": true
83
- },
84
- "mysql": {
85
- "optional": true
86
- },
87
- "mysql2": {
88
- "optional": true
89
- },
90
- "pg": {
91
- "optional": true
92
- },
93
- "pg-native": {
94
- "optional": true
95
- },
96
- "sqlite3": {
97
- "optional": true
98
- },
99
- "better-sqlite3": {
100
- "optional": true
101
- }
102
- },
103
- "lint-staged": {
104
- "*": "prettier --ignore-unknown --write",
105
- "*.js": "eslint --cache --fix"
106
- },
107
- "devDependencies": {
108
- "@tsconfig/recommended": "^1.0.1",
109
- "@types/node": "^20.4.0",
110
- "better-sqlite3": "^9.1.1",
111
- "chai": "^4.3.6",
112
- "chai-as-promised": "^7.1.1",
113
- "chai-subset-in-order": "^3.1.0",
114
- "cli-testlab": "^2.2.0",
115
- "coveralls": "^3.1.1",
116
- "cross-env": "^7.0.3",
117
- "dtslint": "4.2.1",
118
- "eslint": "^8.54.0",
119
- "eslint-config-prettier": "^8.6.0",
120
- "eslint-plugin-import": "^2.29.0",
121
- "eslint-plugin-mocha-no-only": "^1.1.1",
122
- "eslint-plugin-prettier": "^4.2.1",
123
- "husky": "^8.0.1",
124
- "jake": "^10.8.5",
125
- "JSONStream": "^1.3.5",
126
- "lint-staged": "^13.0.0",
127
- "mocha": "^10.0.0",
128
- "mock-fs": "^5.1.4",
129
- "mysql": "^2.18.1",
130
- "mysql2": "^3.2.0",
131
- "nyc": "^15.1.0",
132
- "oracledb": "^6.1.0",
133
- "pg": "^8.8.0",
134
- "pg-query-stream": "^4.2.4",
135
- "prettier": "2.8.7",
136
- "rimraf": "^5.0.5",
137
- "sinon": "^15.0.1",
138
- "sinon-chai": "^3.7.0",
139
- "source-map-support": "^0.5.21",
140
- "sqlite3": "^5.0.11",
141
- "tap-spec": "^5.0.0",
142
- "tape": "^5.6.0",
143
- "tedious": "^16.6.1",
144
- "toxiproxy-node-client": "^2.0.6",
145
- "ts-node": "^10.9.1",
146
- "tsd": "^0.28.1",
147
- "typescript": "5.0.4"
148
- },
149
- "buildDependencies": [
150
- "rimraf"
151
- ],
152
- "bin": {
153
- "knex": "./bin/cli.js"
154
- },
155
- "repository": {
156
- "type": "git",
157
- "url": "git://github.com/knex/knex.git"
158
- },
159
- "homepage": "https://knex.github.io/documentation/",
160
- "keywords": [
161
- "sql",
162
- "query",
163
- "postgresql",
164
- "postgres",
165
- "mysql",
166
- "cockroachdb",
167
- "sqlite3",
168
- "oracle",
169
- "mssql",
170
- "builder",
171
- "querybuilder",
172
- "build",
173
- "db",
174
- "database"
175
- ],
176
- "author": {
177
- "name": "Tim Griesser",
178
- "web": "https://github.com/tgriesser"
179
- },
180
- "contributors": [
181
- {
182
- "name": "Mikael Lepisto"
183
- },
184
- {
185
- "name": "Igor Savin",
186
- "web": "https://www.codeflashbacks.com"
187
- },
188
- {
189
- "name": "Olivier Cavadenti"
190
- },
191
- {
192
- "name": "Simon Liden"
193
- },
194
- {
195
- "name": "Paul Gaurab",
196
- "web": "https://lorefnon.tech"
197
- },
198
- {
199
- "name": "Brian Lauber",
200
- "web": "https://briandamaged.org"
201
- }
202
- ],
203
- "browser": {
204
- "./lib/migrations/migrate/Migrator.js": "./lib/util/noop.js",
205
- "./lib/bin/cli.js": "./lib/util/noop.js",
206
- "./lib/migrations/seed/Seeder.js": "./lib/util/noop.js",
207
- "tedious": false,
208
- "mysql": false,
209
- "mysql2": false,
210
- "pg": false,
211
- "pg-native": false,
212
- "pg-query-stream": false,
213
- "oracle": false,
214
- "sqlite3": false,
215
- "better-sqlite3": false,
216
- "oracledb": false
217
- },
218
- "react-native": {
219
- "./lib/migrate": "./lib/util/noop.js",
220
- "./lib/seed": "./lib/util/noop.js"
221
- },
222
- "files": [
223
- "bin/*",
224
- "lib/",
225
- "lib/**/*.js",
226
- "!lib/**/*.ts",
227
- "!lib/**/*.d.ts",
228
- "!lib/**/*.js.map",
229
- "!lib/.gitignore",
230
- "scripts/*",
231
- "types/index.d.ts",
232
- "types/result.d.ts",
233
- "types/tables.d.ts",
234
- "CHANGELOG.md",
235
- "CONTRIBUTING.md",
236
- "knex.js",
237
- "knex.mjs",
238
- "LICENSE",
239
- "README.md",
240
- "UPGRADING.md"
241
- ],
242
- "license": "MIT",
243
- "tonicExampleFilename": "scripts/runkit-example.js",
244
- "nyc": {
245
- "check-coverage": true,
246
- "lines": 84,
247
- "statements": 82,
248
- "functions": 83,
249
- "branches": 69,
250
- "extension": [
251
- ".js"
252
- ],
253
- "exclude": [
254
- "lib/dialects/oracle",
255
- "lib/dialects/oracledb",
256
- "test/**/*.spec.js"
257
- ]
258
- },
259
- "tsd": {
260
- "directory": "test-tsd",
261
- "compilerOptions": {
262
- "esModuleInterop": false,
263
- "module": "commonjs",
264
- "target": "ES2017"
265
- }
266
- }
267
- }
1
+ {
2
+ "name": "knex",
3
+ "version": "3.2.0",
4
+ "description": "A batteries-included SQL query & schema builder for PostgresSQL, MySQL, CockroachDB, MSSQL and SQLite3",
5
+ "main": "knex.js",
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
+ },
19
+ "engines": {
20
+ "node": ">=16"
21
+ },
22
+ "scripts": {
23
+ "build": "npm run build:ts && npm run format",
24
+ "clean": "node scripts/clean.js",
25
+ "build:ts": "tsc",
26
+ "format": "prettier --write --list-different .",
27
+ "format:check": "prettier --list-different .",
28
+ "debug:test": "mocha --inspect-brk --exit -t 0 test/all-tests-suite.js",
29
+ "debug:tape": "node --inspect-brk test/tape/index.js",
30
+ "coveralls": "nyc report --reporter=lcov",
31
+ "lint": "eslint --cache .",
32
+ "lint:fix": "eslint --cache --fix .",
33
+ "lint:types": "tsd",
34
+ "lint:everything": "npm run lint && npm run lint:types",
35
+ "lint:fix:everything": "npm run lint:fix && npm run lint:types",
36
+ "test:unit": "npm run test:unit-only && npm run test:cli",
37
+ "test:unit-only": "mocha --exit -t 10000 --config test/mocha-unit-config-test.js",
38
+ "test:db": "mocha --exit -t 10000 --config test/mocha-integration-config-test.js",
39
+ "test:db:coverage": "nyc mocha --exit --check-leaks -t 10000 --config test/mocha-integration-config-test.js && npm run test:tape",
40
+ "test:db:no-oracle": "cross-env DB=\"mssql mysql mysql2 postgres sqlite3\" mocha --exit -t 10000 --config test/mocha-integration-config-test.js && npm run test:tape",
41
+ "test": "mocha --exit -t 10000 --config test/mocha-all-config-test.js && npm run test:tape && npm run test:cli",
42
+ "test:coverage": "nyc mocha --exit --check-leaks -t 10000 --config test/mocha-all-config-test.js && npm run test:tape && npm run test:cli",
43
+ "test:everything": "npm run lint:everything && npm run test:coverage",
44
+ "test:mssql": "cross-env DB=mssql npm run test:db",
45
+ "test:mysql": "cross-env DB=mysql npm run test:db",
46
+ "test:mysql2": "cross-env DB=mysql2 npm run test:db",
47
+ "test:oracledb": "cross-env DB=oracledb npm run test:db",
48
+ "test:sqlite": "cross-env DB=sqlite3 npm run test:db",
49
+ "test:better-sqlite3": "cross-env DB=better-sqlite3 npm run test:db",
50
+ "test:postgres": "cross-env DB=postgres npm run test:db",
51
+ "test:cockroachdb": "cross-env DB=cockroachdb npm run test:db",
52
+ "test:pgnative": "cross-env DB=pgnative npm run test:db",
53
+ "test:tape": "node test/tape/index.js | faucet",
54
+ "test:cli": "cross-env KNEX_PATH=../knex.js KNEX=bin/cli.js jake -f test/jake/Jakefile && mocha --exit -t 10000 test/cli-tests-suite.js",
55
+ "db:start": "docker compose -f scripts/docker-compose.yml up --build -d mysql oracledb postgres mssql cockroachdb pgnative && docker compose -f scripts/docker-compose.yml up waitmssql waitmysql waitpostgres waitoracledb",
56
+ "db:start:no-oracle": "docker compose -f scripts/docker-compose.yml up --build -d mysql postgres mssql cockroachdb pgnative && docker compose -f scripts/docker-compose.yml up waitmssql waitmysql waitpostgres",
57
+ "db:stop": "docker compose -f scripts/docker-compose.yml down",
58
+ "db:start:postgres": "docker compose -f scripts/docker-compose.yml up --build -d postgres && docker compose -f scripts/docker-compose.yml up waitpostgres",
59
+ "db:stop:postgres": "docker compose -f scripts/docker-compose.yml down",
60
+ "db:start:pgnative": "docker compose -f scripts/docker-compose.yml up --build -d pgnative && docker compose -f scripts/docker-compose.yml up waitpgnative",
61
+ "db:stop:pgnative": "docker compose -f scripts/docker-compose.yml down",
62
+ "db:start:mysql": "docker compose -f scripts/docker-compose.yml up --build -d mysql && docker compose -f scripts/docker-compose.yml up waitmysql",
63
+ "db:stop:mysql": "docker compose -f scripts/docker-compose.yml down",
64
+ "db:start:mssql": "docker compose -f scripts/docker-compose.yml up --build -d mssql && docker compose -f scripts/docker-compose.yml up waitmssql",
65
+ "db:stop:mssql": "docker compose -f scripts/docker-compose.yml down",
66
+ "db:start:cockroachdb": "docker compose -f scripts/docker-compose.yml up --build -d cockroachdb && docker compose -f scripts/docker-compose.yml up waitcockroachdb",
67
+ "db:stop:cockroachdb": "docker compose -f scripts/docker-compose.yml down",
68
+ "db:start:oracle": "docker compose -f scripts/docker-compose.yml up --build -d oracledb && docker compose -f scripts/docker-compose.yml up waitoracledb",
69
+ "db:stop:oracle": "docker compose -f scripts/docker-compose.yml down",
70
+ "stress:init": "docker compose -f scripts/stress-test/docker-compose.yml up --no-start && docker compose -f scripts/stress-test/docker-compose.yml start",
71
+ "stress:test": "node scripts/stress-test/knex-stress-test.js | grep -A 5 -B 60 -- '- STATS '",
72
+ "stress:destroy": "docker compose -f scripts/stress-test/docker-compose.yml stop"
73
+ },
74
+ "dependencies": {
75
+ "colorette": "2.0.19",
76
+ "commander": "^10.0.0",
77
+ "debug": "4.3.4",
78
+ "escalade": "^3.1.1",
79
+ "esm": "^3.2.25",
80
+ "get-package-type": "^0.1.0",
81
+ "getopts": "2.3.0",
82
+ "interpret": "^2.2.0",
83
+ "lodash": "^4.17.21",
84
+ "pg-connection-string": "2.6.2",
85
+ "rechoir": "^0.8.0",
86
+ "resolve-from": "^5.0.0",
87
+ "tarn": "^3.0.2",
88
+ "tildify": "2.0.0"
89
+ },
90
+ "peerDependencies": {
91
+ "pg-query-stream": "^4.14.0"
92
+ },
93
+ "peerDependenciesMeta": {
94
+ "tedious": {
95
+ "optional": true
96
+ },
97
+ "mysql": {
98
+ "optional": true
99
+ },
100
+ "mysql2": {
101
+ "optional": true
102
+ },
103
+ "pg": {
104
+ "optional": true
105
+ },
106
+ "pg-native": {
107
+ "optional": true
108
+ },
109
+ "pg-query-stream": {
110
+ "optional": true
111
+ },
112
+ "sqlite3": {
113
+ "optional": true
114
+ },
115
+ "better-sqlite3": {
116
+ "optional": true
117
+ }
118
+ },
119
+ "lint-staged": {
120
+ "*": "prettier --ignore-unknown --write",
121
+ "*.js": "eslint --cache --fix"
122
+ },
123
+ "devDependencies": {
124
+ "@tsconfig/node12": "^1.0.11",
125
+ "@tsconfig/recommended": "^1.0.1",
126
+ "@types/minimatch": "^5.1.2",
127
+ "@types/node": "^20.4.0",
128
+ "better-sqlite3": "^10.1.0",
129
+ "chai": "^4.3.6",
130
+ "chai-as-promised": "^7.1.1",
131
+ "chai-subset-in-order": "^3.1.0",
132
+ "cli-testlab": "^3.0.0",
133
+ "cross-env": "^7.0.3",
134
+ "eslint": "^8.54.0",
135
+ "eslint-config-prettier": "^8.6.0",
136
+ "eslint-plugin-import": "^2.29.0",
137
+ "eslint-plugin-mocha-no-only": "^1.1.1",
138
+ "eslint-plugin-n": "^17.23.1",
139
+ "eslint-plugin-prettier": "^4.2.1",
140
+ "expect-type": "^1.3.0",
141
+ "faucet": "^0.0.4",
142
+ "husky": "^8.0.1",
143
+ "jake": "^10.8.5",
144
+ "JSONStream": "^1.3.5",
145
+ "lint-staged": "^16.2.7",
146
+ "mocha": "^10.0.0",
147
+ "mock-fs": "^5.1.4",
148
+ "mysql": "^2.18.1",
149
+ "mysql2": "^3.2.0",
150
+ "nyc": "^15.1.0",
151
+ "oracledb": "^6.1.0",
152
+ "pg": "^8.20.0",
153
+ "pg-query-stream": "^4.14.0",
154
+ "prettier": "2.8.7",
155
+ "rimraf": "^5.0.5",
156
+ "sinon": "^15.0.1",
157
+ "sinon-chai": "^3.7.0",
158
+ "source-map-support": "^0.5.21",
159
+ "sqlite3": "^5.0.11",
160
+ "tape": "^5.6.0",
161
+ "tedious": "^18.2.1",
162
+ "toxiproxy-node-client": "^4.0.0",
163
+ "ts-node": "^10.9.1",
164
+ "tsd": "^0.28.1",
165
+ "typescript": "5.0.4"
166
+ },
167
+ "buildDependencies": [
168
+ "rimraf"
169
+ ],
170
+ "bin": {
171
+ "knex": "./bin/cli.js"
172
+ },
173
+ "repository": {
174
+ "type": "git",
175
+ "url": "git://github.com/knex/knex.git"
176
+ },
177
+ "homepage": "https://knex.github.io/documentation/",
178
+ "keywords": [
179
+ "sql",
180
+ "query",
181
+ "postgresql",
182
+ "postgres",
183
+ "mysql",
184
+ "cockroachdb",
185
+ "sqlite3",
186
+ "oracle",
187
+ "mssql",
188
+ "builder",
189
+ "querybuilder",
190
+ "build",
191
+ "db",
192
+ "database"
193
+ ],
194
+ "author": {
195
+ "name": "Tim Griesser",
196
+ "web": "https://github.com/tgriesser"
197
+ },
198
+ "contributors": [
199
+ {
200
+ "name": "Mikael Lepisto"
201
+ },
202
+ {
203
+ "name": "Igor Savin",
204
+ "web": "https://www.codeflashbacks.com"
205
+ },
206
+ {
207
+ "name": "Olivier Cavadenti"
208
+ },
209
+ {
210
+ "name": "Simon Liden"
211
+ },
212
+ {
213
+ "name": "Paul Gaurab",
214
+ "web": "https://lorefnon.tech"
215
+ },
216
+ {
217
+ "name": "Brian Lauber",
218
+ "web": "https://briandamaged.org"
219
+ }
220
+ ],
221
+ "browser": {
222
+ "./lib/migrations/migrate/Migrator.js": "./lib/util/noop.js",
223
+ "./lib/bin/cli.js": "./lib/util/noop.js",
224
+ "./lib/migrations/seed/Seeder.js": "./lib/util/noop.js",
225
+ "tedious": false,
226
+ "mysql": false,
227
+ "mysql2": false,
228
+ "pg": false,
229
+ "pg-native": false,
230
+ "pg-query-stream": false,
231
+ "oracle": false,
232
+ "sqlite3": false,
233
+ "better-sqlite3": false,
234
+ "oracledb": false
235
+ },
236
+ "react-native": {
237
+ "./lib/migrate": "./lib/util/noop.js",
238
+ "./lib/seed": "./lib/util/noop.js"
239
+ },
240
+ "files": [
241
+ "bin/*",
242
+ "lib/",
243
+ "lib/**/*.js",
244
+ "!lib/**/*.ts",
245
+ "!lib/**/*.d.ts",
246
+ "!lib/**/*.js.map",
247
+ "!lib/.gitignore",
248
+ "scripts/*",
249
+ "types/index.d.ts",
250
+ "types/result.d.ts",
251
+ "types/tables.d.ts",
252
+ "CHANGELOG.md",
253
+ "CONTRIBUTING.md",
254
+ "knex.js",
255
+ "knex.mjs",
256
+ "LICENSE",
257
+ "README.md",
258
+ "UPGRADING.md"
259
+ ],
260
+ "license": "MIT",
261
+ "tonicExampleFilename": "scripts/runkit-example.js",
262
+ "nyc": {
263
+ "check-coverage": true,
264
+ "lines": 84,
265
+ "statements": 82,
266
+ "functions": 83,
267
+ "branches": 69,
268
+ "extension": [
269
+ ".js"
270
+ ],
271
+ "exclude": [
272
+ "lib/dialects/oracle",
273
+ "lib/dialects/oracledb",
274
+ "test/**/*.spec.js"
275
+ ]
276
+ },
277
+ "tsd": {
278
+ "directory": "test-tsd",
279
+ "compilerOptions": {
280
+ "esModuleInterop": false,
281
+ "module": "commonjs",
282
+ "target": "ES2017"
283
+ }
284
+ }
285
+ }
@@ -0,0 +1,19 @@
1
+ #!/bin/bash -e
2
+
3
+ mkdir -p /tmp/artifacts
4
+
5
+ HERE="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
6
+
7
+ evtfile=""
8
+ if [ -f "$1" ]; then
9
+ evtfile="$1"
10
+ elif [ -f "$HERE/$1.json" ]; then
11
+ evtfile="$HERE/$1.json"
12
+ else
13
+ echo "Usage: $0 <event jsonfile>"
14
+ exit 1
15
+ fi
16
+
17
+ shift
18
+
19
+ act --artifact-server-path /tmp/artifacts -e "$evtfile" -W "$HERE/../../.github/workflows/publish.yml" "$@"
@@ -0,0 +1,11 @@
1
+ {
2
+ "pull_request": {
3
+ "head": {
4
+ "ref": "pr-getting-merged"
5
+ },
6
+ "base": {
7
+ "ref": "master"
8
+ },
9
+ "merged": true
10
+ }
11
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "pull_request": {
3
+ "head": {
4
+ "ref": "pr-getting-merged"
5
+ },
6
+ "base": {
7
+ "ref": "master"
8
+ },
9
+ "merged": true,
10
+ "labels": [{ "name": "patch" }]
11
+ }
12
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "pull_request": {
3
+ "head": {
4
+ "ref": "pr-getting-merged"
5
+ },
6
+ "base": {
7
+ "ref": "master"
8
+ },
9
+ "merged": true,
10
+ "labels": [{ "name": "skip-release" }]
11
+ }
12
+ }