@aws-amplify/graphql-model-transformer 1.3.7 → 1.3.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.
Files changed (153) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/lib/definitions.d.ts.map +1 -1
  3. package/lib/definitions.js +28 -2
  4. package/lib/definitions.js.map +1 -1
  5. package/lib/graphql-model-transformer.d.ts.map +1 -1
  6. package/lib/graphql-model-transformer.js +37 -35
  7. package/lib/graphql-model-transformer.js.map +1 -1
  8. package/lib/graphql-types/common.d.ts.map +1 -1
  9. package/lib/graphql-types/common.js +16 -18
  10. package/lib/graphql-types/common.js.map +1 -1
  11. package/lib/graphql-types/mutation.js +12 -12
  12. package/lib/graphql-types/mutation.js.map +1 -1
  13. package/lib/rds-lambda.zip +0 -0
  14. package/lib/resolvers/common.d.ts.map +1 -1
  15. package/lib/resolvers/common.js.map +1 -1
  16. package/lib/resolvers/dynamodb/mutation.d.ts.map +1 -1
  17. package/lib/resolvers/dynamodb/mutation.js +10 -8
  18. package/lib/resolvers/dynamodb/mutation.js.map +1 -1
  19. package/lib/resolvers/dynamodb/query.d.ts.map +1 -1
  20. package/lib/resolvers/dynamodb/query.js +1 -4
  21. package/lib/resolvers/dynamodb/query.js.map +1 -1
  22. package/lib/resolvers/dynamodb/subscriptions.d.ts.map +1 -1
  23. package/lib/resolvers/dynamodb/subscriptions.js.map +1 -1
  24. package/lib/resolvers/generators/rds-vtl-generator.d.ts.map +1 -1
  25. package/lib/resolvers/generators/rds-vtl-generator.js.map +1 -1
  26. package/lib/resolvers/generators/vtl-generator.d.ts.map +1 -1
  27. package/lib/resolvers/index.d.ts.map +1 -1
  28. package/lib/resolvers/index.js.map +1 -1
  29. package/lib/resolvers/rds/mutation.d.ts.map +1 -1
  30. package/lib/resolvers/rds/mutation.js.map +1 -1
  31. package/lib/resolvers/rds/query.d.ts.map +1 -1
  32. package/lib/resolvers/rds/query.js.map +1 -1
  33. package/lib/resolvers/rds/resolver.d.ts.map +1 -1
  34. package/lib/resolvers/rds/resolver.js +1 -1
  35. package/lib/resolvers/rds/resolver.js.map +1 -1
  36. package/lib/resources/dynamo-model-resource-generator.d.ts.map +1 -1
  37. package/lib/resources/dynamo-model-resource-generator.js.map +1 -1
  38. package/lib/resources/model-resource-generator.d.ts.map +1 -1
  39. package/lib/resources/model-resource-generator.js +12 -4
  40. package/lib/resources/model-resource-generator.js.map +1 -1
  41. package/lib/resources/rds-model-resource-generator.d.ts.map +1 -1
  42. package/lib/resources/rds-model-resource-generator.js +1 -1
  43. package/lib/resources/rds-model-resource-generator.js.map +1 -1
  44. package/package.json +6 -6
  45. package/rds-lambda/node_modules/.package-lock.json +209 -221
  46. package/rds-lambda/node_modules/@aws-sdk/client-ssm/package.json +17 -18
  47. package/rds-lambda/node_modules/@aws-sdk/client-sso/package.json +14 -15
  48. package/rds-lambda/node_modules/@aws-sdk/client-sso-oidc/package.json +14 -15
  49. package/rds-lambda/node_modules/@aws-sdk/client-sts/package.json +17 -18
  50. package/rds-lambda/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  51. package/rds-lambda/node_modules/@aws-sdk/credential-provider-ini/package.json +6 -6
  52. package/rds-lambda/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  53. package/rds-lambda/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  54. package/rds-lambda/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  55. package/rds-lambda/node_modules/@aws-sdk/credential-provider-web-identity/package.json +2 -2
  56. package/rds-lambda/node_modules/@aws-sdk/middleware-host-header/package.json +2 -2
  57. package/rds-lambda/node_modules/@aws-sdk/middleware-logger/package.json +2 -2
  58. package/rds-lambda/node_modules/@aws-sdk/middleware-recursion-detection/package.json +2 -2
  59. package/rds-lambda/node_modules/@aws-sdk/middleware-sdk-sts/package.json +3 -3
  60. package/rds-lambda/node_modules/@aws-sdk/middleware-signing/package.json +2 -2
  61. package/rds-lambda/node_modules/@aws-sdk/middleware-user-agent/package.json +3 -3
  62. package/rds-lambda/node_modules/@aws-sdk/token-providers/package.json +3 -3
  63. package/rds-lambda/node_modules/@aws-sdk/types/package.json +2 -1
  64. package/rds-lambda/node_modules/@aws-sdk/util-endpoints/package.json +2 -2
  65. package/rds-lambda/node_modules/@aws-sdk/util-user-agent-browser/package.json +2 -2
  66. package/rds-lambda/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
  67. package/rds-lambda/node_modules/@babel/compat-data/data/plugin-bugfixes.json +2 -0
  68. package/rds-lambda/node_modules/@babel/compat-data/data/plugins.json +8 -0
  69. package/rds-lambda/node_modules/@babel/compat-data/package.json +1 -1
  70. package/rds-lambda/node_modules/@babel/core/package.json +7 -7
  71. package/rds-lambda/node_modules/@babel/generator/package.json +2 -2
  72. package/rds-lambda/node_modules/@babel/helper-compilation-targets/package.json +5 -5
  73. package/rds-lambda/node_modules/@babel/helper-module-transforms/README.md +1 -1
  74. package/rds-lambda/node_modules/@babel/helper-module-transforms/package.json +10 -6
  75. package/rds-lambda/node_modules/@types/jest/README.md +1 -1
  76. package/rds-lambda/node_modules/@types/jest/package.json +2 -2
  77. package/rds-lambda/node_modules/@types/node/README.md +1 -1
  78. package/rds-lambda/node_modules/@types/node/package.json +2 -2
  79. package/rds-lambda/node_modules/caniuse-lite/package.json +1 -1
  80. package/rds-lambda/node_modules/commander/Readme.md +7 -2
  81. package/rds-lambda/node_modules/commander/package.json +17 -17
  82. package/rds-lambda/node_modules/electron-to-chromium/full-chromium-versions.json +1 -1
  83. package/rds-lambda/node_modules/electron-to-chromium/full-versions.json +1 -1
  84. package/rds-lambda/node_modules/electron-to-chromium/package.json +1 -1
  85. package/rds-lambda/node_modules/electron-to-chromium/versions.json +1 -1
  86. package/rds-lambda/node_modules/knex/CHANGELOG.md +63 -21
  87. package/rds-lambda/node_modules/knex/CONTRIBUTING.md +1 -1
  88. package/rds-lambda/node_modules/knex/LICENSE +22 -22
  89. package/rds-lambda/node_modules/knex/README.md +32 -31
  90. package/rds-lambda/node_modules/knex/UPGRADING.md +94 -82
  91. package/rds-lambda/node_modules/knex/knex.mjs +11 -0
  92. package/rds-lambda/node_modules/knex/lib/dialects/oracle/DEAD_CODE.md +3 -3
  93. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/cjs.stub +15 -15
  94. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/coffee.stub +13 -13
  95. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/eg.stub +14 -14
  96. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/js-schema.stub +22 -22
  97. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/js.stub +22 -22
  98. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-coffee.stub +34 -34
  99. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-eg.stub +43 -43
  100. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-js.stub +47 -47
  101. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-ls.stub +35 -35
  102. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/knexfile-ts.stub +47 -47
  103. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/ls.stub +14 -14
  104. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/mjs.stub +23 -23
  105. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/ts-schema.stub +21 -21
  106. package/rds-lambda/node_modules/knex/lib/migrations/migrate/stub/ts.stub +21 -21
  107. package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/coffee.stub +9 -9
  108. package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/eg.stub +11 -11
  109. package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/js.stub +13 -13
  110. package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/ls.stub +11 -11
  111. package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/mjs.stub +12 -12
  112. package/rds-lambda/node_modules/knex/lib/migrations/seed/stub/ts.stub +13 -13
  113. package/rds-lambda/node_modules/knex/package.json +21 -18
  114. package/rds-lambda/node_modules/knex/scripts/docker-compose.yml +2 -2
  115. package/rds-lambda/node_modules/knex/scripts/next-release-howto.md +1 -1
  116. package/rds-lambda/node_modules/knex/scripts/oracledb-install-driver-libs.sh +82 -82
  117. package/rds-lambda/node_modules/knex/scripts/release.sh +36 -34
  118. package/rds-lambda/node_modules/knex/scripts/stress-test/README.txt +18 -18
  119. package/rds-lambda/node_modules/knex/scripts/stress-test/docker-compose.yml +16 -16
  120. package/rds-lambda/node_modules/pg-connection-string/package.json +2 -2
  121. package/rds-lambda/node_modules/semver/package.json +19 -9
  122. package/rds-lambda/package-lock.json +209 -221
  123. package/src/__tests__/model-transformer.test.ts +130 -139
  124. package/src/__tests__/test-utils/helpers.ts +1 -1
  125. package/src/__tests__/test-utils/rds_utils.test.ts +29 -68
  126. package/src/definitions.ts +28 -2
  127. package/src/graphql-model-transformer.ts +72 -74
  128. package/src/graphql-types/common.ts +41 -41
  129. package/src/graphql-types/mutation.ts +12 -12
  130. package/src/resolvers/common.ts +1 -12
  131. package/src/resolvers/dynamodb/mutation.ts +16 -13
  132. package/src/resolvers/dynamodb/query.ts +6 -12
  133. package/src/resolvers/dynamodb/subscriptions.ts +1 -3
  134. package/src/resolvers/generators/rds-vtl-generator.ts +1 -4
  135. package/src/resolvers/generators/vtl-generator.ts +5 -5
  136. package/src/resolvers/index.ts +1 -3
  137. package/src/resolvers/rds/mutation.ts +17 -6
  138. package/src/resolvers/rds/query.ts +4 -12
  139. package/src/resolvers/rds/resolver.ts +8 -13
  140. package/src/resources/dynamo-model-resource-generator.ts +12 -22
  141. package/src/resources/model-resource-generator.ts +54 -24
  142. package/src/resources/rds-model-resource-generator.ts +9 -23
  143. package/tsconfig.json +4 -4
  144. package/tsconfig.tsbuildinfo +1 -1
  145. package/rds-lambda/node_modules/@nicolo-ribaudo/semver-v6/CHANGELOG.md +0 -70
  146. package/rds-lambda/node_modules/@nicolo-ribaudo/semver-v6/LICENSE +0 -15
  147. package/rds-lambda/node_modules/@nicolo-ribaudo/semver-v6/README.md +0 -454
  148. package/rds-lambda/node_modules/@nicolo-ribaudo/semver-v6/package.json +0 -28
  149. package/rds-lambda/node_modules/@nicolo-ribaudo/semver-v6/range.bnf +0 -16
  150. package/rds-lambda/node_modules/pg/node_modules/pg-connection-string/LICENSE +0 -21
  151. package/rds-lambda/node_modules/pg/node_modules/pg-connection-string/README.md +0 -77
  152. package/rds-lambda/node_modules/pg/node_modules/pg-connection-string/package.json +0 -40
  153. package/rds-lambda/node_modules/semver/CHANGELOG.md +0 -70
@@ -2,91 +2,101 @@
2
2
 
3
3
  ### Upgrading to version 2.0.0+
4
4
 
5
- * Since `sqlite3` is maintained again, we switched back to it. If you are using `@vscode/sqlite3` driver dependency, please replace it with `sqlite3` in your `package.json`;
5
+ - Since `sqlite3` is maintained again, we switched back to it. If you are using `@vscode/sqlite3` driver dependency, please replace it with `sqlite3` in your `package.json`;
6
6
 
7
7
  ### Upgrading to version 1.0.0+
8
8
 
9
- * Node.js older than 12 is no longer supported, make sure to update your environment;
10
- * If you are using `sqlite3` driver dependency, please replace it with `@vscode/sqlite3` in your `package.json`;
11
- * `RETURNING` operations now always return an object with column names;
12
- * Migrator now returns list of migrations as objects.
9
+ - Node.js older than 12 is no longer supported, make sure to update your environment;
10
+ - If you are using `sqlite3` driver dependency, please replace it with `@vscode/sqlite3` in your `package.json`;
11
+ - `RETURNING` operations now always return an object with column names;
12
+ - Migrator now returns list of migrations as objects.
13
13
 
14
14
  ### Upgrading to version 0.95.0+
15
15
 
16
- * TypeScript type exports changed significantly. While `import Knex from 'knex';` used to import the knex instantiation function, the namespace and the interface for the knex instantiation function/object, there is now a clear distinction between them:
16
+ - TypeScript type exports changed significantly. While `import Knex from 'knex';` used to import the knex instantiation function, the namespace and the interface for the knex instantiation function/object, there is now a clear distinction between them:
17
+
17
18
  ```typescript
18
- import { knex } from 'knex' // this is a function that you call to instantiate knex
19
- import { Knex } from 'knex' // this is a namespace, and a type of a knex object
19
+ import { knex } from 'knex'; // this is a function that you call to instantiate knex
20
+ import { Knex } from 'knex'; // this is a namespace, and a type of a knex object
20
21
  import KnexTimeoutError = Knex.KnexTimeoutError; // this is a class from the Knex namespace
21
22
 
22
- const config: Knex.Config = {} // this is a type from the Knex namespace
23
- const knexInstance: Knex = knex(config)
23
+ const config: Knex.Config = {}; // this is a type from the Knex namespace
24
+ const knexInstance: Knex = knex(config);
24
25
  ```
25
26
 
26
27
  If your code looked like this:
28
+
27
29
  ```typescript
28
- import knex from 'knex'
30
+ import knex from 'knex';
29
31
 
30
- const config: knex.Config = {} // this is a type from the Knex namespace
31
- const knexInstance = knex(config)
32
+ const config: knex.Config = {}; // this is a type from the Knex namespace
33
+ const knexInstance = knex(config);
32
34
  ```
33
35
 
34
36
  Change it to
37
+
35
38
  ```typescript
36
- import { knex, Knex } from 'knex'
39
+ import { knex, Knex } from 'knex';
37
40
 
38
- const config: Knex.Config = {} // this is a type from the Knex namespace
39
- const knexInstance = knex(config)
41
+ const config: Knex.Config = {}; // this is a type from the Knex namespace
42
+ const knexInstance = knex(config);
40
43
  ```
41
44
 
42
- * If you were importing types such as `Config` or `QueryBuilder` directly, use `Knex` namespace instead.
45
+ - If you were importing types such as `Config` or `QueryBuilder` directly, use `Knex` namespace instead.
43
46
 
44
47
  So change this:
48
+
45
49
  ```ts
46
- import { QueryBuilder } from 'knex'
50
+ import { QueryBuilder } from 'knex';
47
51
 
48
- const qb: QueryBuilder = knex('table').select('*')
52
+ const qb: QueryBuilder = knex('table').select('*');
49
53
  ```
50
54
 
51
55
  to this:
56
+
52
57
  ```ts
53
- import { Knex } from 'knex'
58
+ import { Knex } from 'knex';
54
59
 
55
- const qb: Knex.QueryBuilder = knex('table').select('*')
60
+ const qb: Knex.QueryBuilder = knex('table').select('*');
56
61
  ```
57
62
 
58
- * IDE autocomplete may stop working if you are using JavaScript (not TypeScript). There are reports for autocomplete still working correctly if knex is used this way:
63
+ - IDE autocomplete may stop working if you are using JavaScript (not TypeScript). There are reports for autocomplete still working correctly if knex is used this way:
64
+
59
65
  ```js
60
- const knex = require('knex').knex({
61
- //connection parameters
62
- });
66
+ const knex = require('knex').knex({
67
+ //connection parameters
68
+ });
63
69
  ```
64
70
 
65
71
  It also works when using ESM imports:
72
+
66
73
  ```js
67
- import { knex } from 'knex'
74
+ import { knex } from 'knex';
68
75
 
69
- const kn = knex({
70
- //connection parameters
71
- })
76
+ const kn = knex({
77
+ //connection parameters
78
+ });
72
79
  ```
73
80
 
74
81
  For usage as param it can be addressed like this:
82
+
75
83
  ```js
76
- /**
77
- * @param {import("knex").Knex} db
78
- */
79
- function up(db) {
80
- // Your code
81
- }
84
+ /**
85
+ * @param {import("knex").Knex} db
86
+ */
87
+ function up(db) {
88
+ // Your code
89
+ }
82
90
  ```
83
91
 
84
- * Syntax for QueryBuilder augmentation changed. Previously it looked like this:
92
+ - Syntax for QueryBuilder augmentation changed. Previously it looked like this:
85
93
 
86
94
  ```ts
87
95
  declare module 'knex' {
88
- interface QueryBuilder {
89
- paginate<TResult = any[]>(params: IPaginateParams): KnexQB<any, IWithPagination<TResult>>;
96
+ interface QueryBuilder {
97
+ paginate<TResult = any[]>(
98
+ params: IPaginateParams
99
+ ): KnexQB<any, IWithPagination<TResult>>;
90
100
  }
91
101
  }
92
102
  ```
@@ -97,38 +107,41 @@ This should be changed into this:
97
107
  declare module 'knex' {
98
108
  namespace Knex {
99
109
  interface QueryBuilder {
100
- paginate<TResult = any[]>(params: IPaginateParams): KnexQB<any, IWithPagination<TResult>>;
110
+ paginate<TResult = any[]>(
111
+ params: IPaginateParams
112
+ ): KnexQB<any, IWithPagination<TResult>>;
101
113
  }
102
114
  }
103
115
  }
104
116
  ```
105
117
 
106
- * TypeScript version 4.1+ is needed when using knex types now.
118
+ - TypeScript version 4.1+ is needed when using knex types now.
107
119
 
108
- * MSSQL driver was completely reworked in order to address the multitude of connection pool, error handling and performance issues. Since the new implementation uses `tedious` library directly instead of `mssql`, please replace `mssql` with `tedious` in your dependencies if you are using a MSSQL database.
120
+ - MSSQL driver was completely reworked in order to address the multitude of connection pool, error handling and performance issues. Since the new implementation uses `tedious` library directly instead of `mssql`, please replace `mssql` with `tedious` in your dependencies if you are using a MSSQL database.
121
+
122
+ - Transaction rollback does not trigger a promise rejection for transactions with specified handler. If you want to preserve previous behavior, pass `config` object with `doNotRejectOnRollback: false`:
109
123
 
110
- * Transaction rollback does not trigger a promise rejection for transactions with specified handler. If you want to preserve previous behavior, pass `config` object with `doNotRejectOnRollback: false`:
111
124
  ```js
112
- await knex.transaction(async trx => {
113
- const ids = await trx('catalogues')
114
- .insert({
115
- name: 'Old Books'
116
- }, 'id')
117
- }, { doNotRejectOnRollback: false });
125
+ await knex.transaction(
126
+ async (trx) => {
127
+ const ids = await trx('catalogues').insert({ name: 'Old Books' }, 'id');
128
+ },
129
+ { doNotRejectOnRollback: false }
130
+ );
118
131
  ```
119
132
 
120
- * Connection url parsing changed from legacy [url.parse](https://nodejs.org/docs/latest-v10.x/api/url.html#url_legacy_url_api) to [WHATWG URL](https://nodejs.org/docs/latest-v10.x/api/url.html#url_the_whatwg_url_api). If you have symbols, unusual for a URL (not A-z, not digits, not dot, not dash) - check [Node.js docs](https://nodejs.org/docs/latest-v10.x/api/url.html#url_percent_encoding_in_urls) for details
133
+ - Connection url parsing changed from legacy [url.parse](https://nodejs.org/docs/latest-v10.x/api/url.html#url_legacy_url_api) to [WHATWG URL](https://nodejs.org/docs/latest-v10.x/api/url.html#url_the_whatwg_url_api). If you have symbols, unusual for a URL (not A-z, not digits, not dot, not dash) - check [Node.js docs](https://nodejs.org/docs/latest-v10.x/api/url.html#url_percent_encoding_in_urls) for details
121
134
 
122
- * Global static `Knex.raw` support dropped, use instance `knex.raw` instead. (`require('knex').raw()` won't work anymore)
135
+ - Global static `Knex.raw` support dropped, use instance `knex.raw` instead. (`require('knex').raw()` won't work anymore)
123
136
 
124
- * v8 flags are no longer supported in cli. To pass these flags use [`NODE_OPTIONS` environment variable](https://nodejs.org/api/cli.html#cli_node_options_options).
137
+ - v8 flags are no longer supported in cli. To pass these flags use [`NODE_OPTIONS` environment variable](https://nodejs.org/api/cli.html#cli_node_options_options).
125
138
  For example `NODE_OPTIONS="--max-old-space-size=1536" npm run knex`
126
139
 
127
- * Clients are now classes instead of new-able functions. Please migrate your custom clients to classes.
140
+ - Clients are now classes instead of new-able functions. Please migrate your custom clients to classes.
128
141
 
129
142
  ```js
130
- const Client = require('knex')
131
- const {inherits} = require('util')
143
+ const Client = require('knex');
144
+ const { inherits } = require('util');
132
145
 
133
146
  // old
134
147
  function CustomClient(config) {
@@ -138,7 +151,7 @@ function CustomClient(config) {
138
151
  inherits(CustomClient, Client);
139
152
  CustomClient.prototype.methodOverride = function () {
140
153
  // logic
141
- }
154
+ };
142
155
 
143
156
  // new
144
157
  class CustomClient extends Client {
@@ -157,44 +170,44 @@ class CustomClient extends Client {
157
170
  CustomClient.prototype.driverName = 'abcd';
158
171
  ```
159
172
 
160
- * There was a major internal restructuring and renaming effort. Most dialect-specific compilers/builder have dialect name as a prefix now. Also some files were moved. Make sure to make adjustments accordingly if you were referencing specific knex library files directly from your code.
173
+ - There was a major internal restructuring and renaming effort. Most dialect-specific compilers/builder have dialect name as a prefix now. Also some files were moved. Make sure to make adjustments accordingly if you were referencing specific knex library files directly from your code.
161
174
 
162
- * "first" and "pluck" can no longer be both chained on the same operation. Previously only the last one chained was used, now this would throw an error.
175
+ - "first" and "pluck" can no longer be both chained on the same operation. Previously only the last one chained was used, now this would throw an error.
163
176
 
164
- * Trying to execute an operation resulting in an empty query such as inserting an empty array, will now throw an error on all database drivers.
177
+ - Trying to execute an operation resulting in an empty query such as inserting an empty array, will now throw an error on all database drivers.
165
178
 
166
179
  ### Upgrading to version 0.21.0+
167
180
 
168
- * Node.js older than 10 is no longer supported, make sure to update your environment;
181
+ - Node.js older than 10 is no longer supported, make sure to update your environment;
169
182
 
170
183
  ### Upgrading to version 0.19.0+
171
184
 
172
- * Passing unknown properties to connection pool configuration now throws errors (see https://github.com/Vincit/tarn.js/issues/19 for details);
173
- * `beforeDestroy` pool configuration option was removed. You should use tarn.js event handlers if you still need similar functionality.
185
+ - Passing unknown properties to connection pool configuration now throws errors (see https://github.com/Vincit/tarn.js/issues/19 for details);
186
+ - `beforeDestroy` pool configuration option was removed. You should use tarn.js event handlers if you still need similar functionality.
174
187
 
175
188
  ### Upgrading to version 0.18.0+
176
189
 
177
- * Node.js older than 8 is no longer supported, make sure to update your environment;
178
- * Knex returns native promises instead of bluebird ones now. You will need to update your code not to rely on bluebird-specific functionality;
179
- * Knex.Promise was removed, use native promises;
180
- * Promise is no longer passed to migrations and seeds, use native one;
181
- * If you are using TypeScript, make sure to include 'es6' in compilerOptions.lib, otherwise you may get errors for methods `.catch()` and `then()` not being recognized.
190
+ - Node.js older than 8 is no longer supported, make sure to update your environment;
191
+ - Knex returns native promises instead of bluebird ones now. You will need to update your code not to rely on bluebird-specific functionality;
192
+ - Knex.Promise was removed, use native promises;
193
+ - Promise is no longer passed to migrations and seeds, use native one;
194
+ - If you are using TypeScript, make sure to include 'es6' in compilerOptions.lib, otherwise you may get errors for methods `.catch()` and `then()` not being recognized.
182
195
 
183
196
  ### Upgrading to version 0.17.0+
184
197
 
185
- * Generic support was implemented for TypeScript bindings, which may break TS builds in some edge cases. Please refer to https://knexjs.org/#typescript-support for more elaborate documentation.
198
+ - Generic support was implemented for TypeScript bindings, which may break TS builds in some edge cases. Please refer to https://knexjs.org/#typescript-support for more elaborate documentation.
186
199
 
187
200
  ### Upgrading to version 0.16.0+
188
201
 
189
- * MSSQL: DB versions older than 2008 are no longer supported, make sure to update your DB;
190
- * PostgreSQL|MySQL: it is recommended to use options object for `table.datetime` and `table.timestamp` methods instead of argument options. See documentation for these methods for more details;
191
- * Node 6: There are known issues with duplicate event listeners when using knex.js with Node.js 6 (resulting in MaxListenersExceededWarning under certain use-cases (such as reusing single knex instance to run migrations or seeds multiple times)). Please upgrade to Node.js 8+ as soon as possible (knex 0.17.0 will be dropping Node.js 6 support altogether);
202
+ - MSSQL: DB versions older than 2008 are no longer supported, make sure to update your DB;
203
+ - PostgreSQL|MySQL: it is recommended to use options object for `table.datetime` and `table.timestamp` methods instead of argument options. See documentation for these methods for more details;
204
+ - Node 6: There are known issues with duplicate event listeners when using knex.js with Node.js 6 (resulting in MaxListenersExceededWarning under certain use-cases (such as reusing single knex instance to run migrations or seeds multiple times)). Please upgrade to Node.js 8+ as soon as possible (knex 0.17.0 will be dropping Node.js 6 support altogether);
192
205
 
193
206
  ### Upgrading to version 0.15.0+
194
207
 
195
- * Node.js older than 6 is no longer supported, make sure to update your environment;
208
+ - Node.js older than 6 is no longer supported, make sure to update your environment;
196
209
 
197
- * MSSQL: Creating a unique index on the table targeted by stored procedures that were created with QUOTED_IDENTIFIER = OFF fails.
210
+ - MSSQL: Creating a unique index on the table targeted by stored procedures that were created with QUOTED_IDENTIFIER = OFF fails.
198
211
 
199
212
  You can use this query to identify all affected stored procedures:
200
213
 
@@ -206,28 +219,27 @@ WHERE uses_quoted_identifier = 0;
206
219
 
207
220
  The only known solution is to recreate all stored procedures with QUOTED_IDENTIFIER = OFF
208
221
 
209
- * MariaDB: `mariadb` dialect is no longer supported;
222
+ - MariaDB: `mariadb` dialect is no longer supported;
210
223
 
211
224
  Instead, use "mysql" or "mysql2" dialects.
212
225
 
213
226
  ### Upgrading to version 0.14.4+
214
227
 
215
- * Including schema in tableName parameter in migrations no longer works, so this is invalid:
228
+ - Including schema in tableName parameter in migrations no longer works, so this is invalid:
216
229
 
217
230
  ```js
218
231
  await knex.migrate.latest({
219
- directory: 'src/services/orders/database/migrations',
220
- tableName: 'orders.orders_migrations'
221
- })
232
+ directory: 'src/services/orders/database/migrations',
233
+ tableName: 'orders.orders_migrations',
234
+ });
222
235
  ```
223
236
 
224
237
  Instead, starting from 0.14.5 you should use new parameter schemaName:
225
238
 
226
239
  ```js
227
240
  await knex.migrate.latest({
228
- directory: 'src/services/orders/database/migrations',
229
- tableName: 'orders_migrations',
230
- schemaName: 'orders'
231
- })
241
+ directory: 'src/services/orders/database/migrations',
242
+ tableName: 'orders_migrations',
243
+ schemaName: 'orders',
244
+ });
232
245
  ```
233
-
@@ -0,0 +1,11 @@
1
+ // Knex.js
2
+ // --------------
3
+ // (c) 2013-present Tim Griesser
4
+ // Knex may be freely distributed under the MIT license.
5
+ // For details and documentation:
6
+ // http://knexjs.org
7
+
8
+ import knex from './lib/index.js';
9
+
10
+ export { knex };
11
+ export default knex;
@@ -1,5 +1,5 @@
1
- # Warning: Dead Code #
1
+ # Warning: Dead Code
2
2
 
3
- The `oracle` dialect is mostly dead code at this point. However, a handful of its methods are still referenced by the `oracledb` dialect. So, we are in the process of migrating those methods over to the `oracledb` dialect where they belong. Once that task is completed, we will officially remove the `oracle` dialect.
3
+ The `oracle` dialect is mostly dead code at this point. However, a handful of its methods are still referenced by the `oracledb` dialect. So, we are in the process of migrating those methods over to the `oracledb` dialect where they belong. Once that task is completed, we will officially remove the `oracle` dialect.
4
4
 
5
- In short: do not use the `oracle` dialect. Use the `oracledb` dialect instead.
5
+ In short: do not use the `oracle` dialect. Use the `oracledb` dialect instead.
@@ -1,15 +1,15 @@
1
-
2
- exports.up = function(knex) {
3
- <% if (d.tableName) { %>
4
- return knex.schema.createTable("<%= d.tableName %>", function(t) {
5
- t.increments();
6
- t.timestamp();
7
- });
8
- <% } %>
9
- };
10
-
11
- exports.down = function(knex) {
12
- <% if (d.tableName) { %>
13
- return knex.schema.dropTable("<%= d.tableName %>");
14
- <% } %>
15
- };
1
+
2
+ exports.up = function(knex) {
3
+ <% if (d.tableName) { %>
4
+ return knex.schema.createTable("<%= d.tableName %>", function(t) {
5
+ t.increments();
6
+ t.timestamp();
7
+ });
8
+ <% } %>
9
+ };
10
+
11
+ exports.down = function(knex) {
12
+ <% if (d.tableName) { %>
13
+ return knex.schema.dropTable("<%= d.tableName %>");
14
+ <% } %>
15
+ };
@@ -1,13 +1,13 @@
1
-
2
- exports.up = (knex) ->
3
- <% if (d.tableName) { %>
4
- knex.schema.createTable "<%= d.tableName %>", (t) ->
5
- t.increments()
6
- t.timestamp()
7
- <% } %>
8
-
9
-
10
- exports.down = (knex) ->
11
- <% if (d.tableName) { %>
12
- knex.schema.dropTable "<%= d.tableName %>"
13
- <% } %>
1
+
2
+ exports.up = (knex) ->
3
+ <% if (d.tableName) { %>
4
+ knex.schema.createTable "<%= d.tableName %>", (t) ->
5
+ t.increments()
6
+ t.timestamp()
7
+ <% } %>
8
+
9
+
10
+ exports.down = (knex) ->
11
+ <% if (d.tableName) { %>
12
+ knex.schema.dropTable "<%= d.tableName %>"
13
+ <% } %>
@@ -1,14 +1,14 @@
1
- provide: up, down
2
-
3
- up = (knex) ->
4
- <% if (d.tableName) { %>
5
- knex.schema.createTable "<%= d.tableName %>": t ->
6
- t.increments()
7
- t.timestamp()
8
- <% } %>
9
-
10
-
11
- down = (knex) ->
12
- <% if (d.tableName) { %>
13
- knex.schema.dropTable("<%= d.tableName %>")
14
- <% } %>
1
+ provide: up, down
2
+
3
+ up = (knex) ->
4
+ <% if (d.tableName) { %>
5
+ knex.schema.createTable "<%= d.tableName %>": t ->
6
+ t.increments()
7
+ t.timestamp()
8
+ <% } %>
9
+
10
+
11
+ down = (knex) ->
12
+ <% if (d.tableName) { %>
13
+ knex.schema.dropTable("<%= d.tableName %>")
14
+ <% } %>
@@ -1,22 +1,22 @@
1
- /**
2
- * @param { import("knex").Knex } knex
3
- * @returns { Promise<void> }
4
- */
5
- exports.up = function({schema}) {
6
- <% if (d.tableName) { %>
7
- return schema.createTable("<%= d.tableName %>", function(t) {
8
- t.increments();
9
- t.timestamp();
10
- });
11
- <% } %>
12
- };
13
-
14
- /**
15
- * @param { import("knex").Knex } knex
16
- * @returns { Promise<void> }
17
- */
18
- exports.down = function({schema}) {
19
- <% if (d.tableName) { %>
20
- return schema.dropTable("<%= d.tableName %>");
21
- <% } %>
22
- };
1
+ /**
2
+ * @param { import("knex").Knex } knex
3
+ * @returns { Promise<void> }
4
+ */
5
+ exports.up = function({schema}) {
6
+ <% if (d.tableName) { %>
7
+ return schema.createTable("<%= d.tableName %>", function(t) {
8
+ t.increments();
9
+ t.timestamp();
10
+ });
11
+ <% } %>
12
+ };
13
+
14
+ /**
15
+ * @param { import("knex").Knex } knex
16
+ * @returns { Promise<void> }
17
+ */
18
+ exports.down = function({schema}) {
19
+ <% if (d.tableName) { %>
20
+ return schema.dropTable("<%= d.tableName %>");
21
+ <% } %>
22
+ };
@@ -1,22 +1,22 @@
1
- /**
2
- * @param { import("knex").Knex } knex
3
- * @returns { Promise<void> }
4
- */
5
- exports.up = function(knex) {
6
- <% if (d.tableName) { %>
7
- return knex.schema.createTable("<%= d.tableName %>", function(t) {
8
- t.increments();
9
- t.timestamp();
10
- });
11
- <% } %>
12
- };
13
-
14
- /**
15
- * @param { import("knex").Knex } knex
16
- * @returns { Promise<void> }
17
- */
18
- exports.down = function(knex) {
19
- <% if (d.tableName) { %>
20
- return knex.schema.dropTable("<%= d.tableName %>");
21
- <% } %>
22
- };
1
+ /**
2
+ * @param { import("knex").Knex } knex
3
+ * @returns { Promise<void> }
4
+ */
5
+ exports.up = function(knex) {
6
+ <% if (d.tableName) { %>
7
+ return knex.schema.createTable("<%= d.tableName %>", function(t) {
8
+ t.increments();
9
+ t.timestamp();
10
+ });
11
+ <% } %>
12
+ };
13
+
14
+ /**
15
+ * @param { import("knex").Knex } knex
16
+ * @returns { Promise<void> }
17
+ */
18
+ exports.down = function(knex) {
19
+ <% if (d.tableName) { %>
20
+ return knex.schema.dropTable("<%= d.tableName %>");
21
+ <% } %>
22
+ };
@@ -1,34 +1,34 @@
1
- # Update with your config settings.
2
-
3
- module.exports =
4
-
5
- development:
6
- client: 'sqlite3'
7
- connection:
8
- filename: './dev.sqlite3'
9
- migrations:
10
- tableName: 'knex_migrations'
11
-
12
- staging:
13
- client: 'postgresql'
14
- connection:
15
- database: 'my_db'
16
- user: 'username'
17
- password: 'password'
18
- pool:
19
- min: 2
20
- max: 10
21
- migrations:
22
- tableName: 'knex_migrations'
23
-
24
- production:
25
- client: 'postgresql'
26
- connection:
27
- database: 'my_db'
28
- user: 'username'
29
- password: 'password'
30
- pool:
31
- min: 2
32
- max: 10
33
- migrations:
34
- tableName: 'knex_migrations'
1
+ # Update with your config settings.
2
+
3
+ module.exports =
4
+
5
+ development:
6
+ client: 'sqlite3'
7
+ connection:
8
+ filename: './dev.sqlite3'
9
+ migrations:
10
+ tableName: 'knex_migrations'
11
+
12
+ staging:
13
+ client: 'postgresql'
14
+ connection:
15
+ database: 'my_db'
16
+ user: 'username'
17
+ password: 'password'
18
+ pool:
19
+ min: 2
20
+ max: 10
21
+ migrations:
22
+ tableName: 'knex_migrations'
23
+
24
+ production:
25
+ client: 'postgresql'
26
+ connection:
27
+ database: 'my_db'
28
+ user: 'username'
29
+ password: 'password'
30
+ pool:
31
+ min: 2
32
+ max: 10
33
+ migrations:
34
+ tableName: 'knex_migrations'