knex 2.5.1 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Master (Unreleased)
2
2
 
3
+ # 3.0.0 - 6 October, 2023
4
+
5
+ - Build fix
6
+
7
+ # 3.0.0 - 6 October, 2023
8
+
9
+ - Fix raw bindings typing (#5401)
10
+ - Fix migrate:unlock when used with custom identifier wrapping. (#5353)
11
+ - Fix driver options specified with .options() method being ignored for oracledb dialect (#5123)
12
+ - Drop compatibility for Node < 16
13
+ - Fix knex d.ts to work with mixed modules (#5659)
14
+ - Fix Lexical error from "Instaed" to "Instead" (#5655)
15
+
16
+ ### Bug fixes
17
+
18
+ - Fix Linting #5455 - #5460
19
+
3
20
  # 2.5.1 - 12 July, 2023
4
21
 
5
22
  ### Bug fixes
@@ -1495,7 +1512,7 @@ Note: there are many breaking changes in this version, particularly in TypeScrip
1495
1512
  - Drop support for strong-oracle #2487
1496
1513
  - Timeout errors doesn't silently ignore the passed errors anymore #2626
1497
1514
  - Removed WebSQL dialect #2647
1498
- - Various fixes to mssql dialect to make it compatible with other dialects #2653, Unique constraint now allow multiple null values, float type is now float instaed of decimal, rolling back transaction with undefined rejects with Error, select for update and select for share actually locks selected row, so basically old schema migrations will work a lot different and produce different schema like before. Also now MSSQL is included in CI tests.
1515
+ - Various fixes to mssql dialect to make it compatible with other dialects #2653, Unique constraint now allow multiple null values, float type is now float instead of decimal, rolling back transaction with undefined rejects with Error, select for update and select for share actually locks selected row, so basically old schema migrations will work a lot different and produce different schema like before. Also now MSSQL is included in CI tests.
1499
1516
 
1500
1517
  ### Bug fixes:
1501
1518
 
package/LICENSE CHANGED
@@ -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.
@@ -170,7 +170,7 @@ class Client_Oracledb extends Client_Oracle {
170
170
  _query(connection, obj) {
171
171
  if (!obj.sql) throw new Error('The query is empty');
172
172
 
173
- const options = { autoCommit: false };
173
+ const options = Object.assign({}, obj.options, { autoCommit: false });
174
174
  if (obj.method === 'select') {
175
175
  options.resultSet = true;
176
176
  }
@@ -294,6 +294,7 @@ class Migrator {
294
294
  }
295
295
 
296
296
  async forceFreeMigrationsLock(config) {
297
+ this._disableProcessing();
297
298
  this.config = getMergedConfig(config, this.config, this.knex.client.logger);
298
299
  const { schemaName, tableName } = this.config;
299
300
  const lockTableName = getLockTableName(tableName);
@@ -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'
@@ -1,43 +1,43 @@
1
- ;; Update with your config settings.
2
-
3
- module.exports = {
4
- development = {
5
- client = 'sqlite3'
6
- connection = {
7
- filename = './dev.sqlite3'
8
- }
9
- migrations = {
10
- tableName = 'knex_migrations'
11
- }
12
- }
13
- staging = {
14
- client = 'postgresql'
15
- connection = {
16
- database = 'my_db'
17
- user = 'username'
18
- password = 'password'
19
- }
20
- pool = {
21
- min = 2
22
- max = 10
23
- }
24
- migrations = {
25
- tableName = 'knex_migrations'
26
- }
27
- }
28
- production = {
29
- client = 'postgresql'
30
- connection = {
31
- database = 'my_db'
32
- user = 'username'
33
- password = 'password'
34
- }
35
- pool = {
36
- min = 2
37
- max = 10
38
- }
39
- migrations = {
40
- tableName = 'knex_migrations'
41
- }
42
- }
43
- }
1
+ ;; Update with your config settings.
2
+
3
+ module.exports = {
4
+ development = {
5
+ client = 'sqlite3'
6
+ connection = {
7
+ filename = './dev.sqlite3'
8
+ }
9
+ migrations = {
10
+ tableName = 'knex_migrations'
11
+ }
12
+ }
13
+ staging = {
14
+ client = 'postgresql'
15
+ connection = {
16
+ database = 'my_db'
17
+ user = 'username'
18
+ password = 'password'
19
+ }
20
+ pool = {
21
+ min = 2
22
+ max = 10
23
+ }
24
+ migrations = {
25
+ tableName = 'knex_migrations'
26
+ }
27
+ }
28
+ production = {
29
+ client = 'postgresql'
30
+ connection = {
31
+ database = 'my_db'
32
+ user = 'username'
33
+ password = 'password'
34
+ }
35
+ pool = {
36
+ min = 2
37
+ max = 10
38
+ }
39
+ migrations = {
40
+ tableName = 'knex_migrations'
41
+ }
42
+ }
43
+ }
@@ -1,47 +1,47 @@
1
- // Update with your config settings.
2
-
3
- /**
4
- * @type { Object.<string, import("knex").Knex.Config> }
5
- */
6
- module.exports = {
7
-
8
- development: {
9
- client: 'sqlite3',
10
- connection: {
11
- filename: './dev.sqlite3'
12
- }
13
- },
14
-
15
- staging: {
16
- client: 'postgresql',
17
- connection: {
18
- database: 'my_db',
19
- user: 'username',
20
- password: 'password'
21
- },
22
- pool: {
23
- min: 2,
24
- max: 10
25
- },
26
- migrations: {
27
- tableName: 'knex_migrations'
28
- }
29
- },
30
-
31
- production: {
32
- client: 'postgresql',
33
- connection: {
34
- database: 'my_db',
35
- user: 'username',
36
- password: 'password'
37
- },
38
- pool: {
39
- min: 2,
40
- max: 10
41
- },
42
- migrations: {
43
- tableName: 'knex_migrations'
44
- }
45
- }
46
-
47
- };
1
+ // Update with your config settings.
2
+
3
+ /**
4
+ * @type { Object.<string, import("knex").Knex.Config> }
5
+ */
6
+ module.exports = {
7
+
8
+ development: {
9
+ client: 'sqlite3',
10
+ connection: {
11
+ filename: './dev.sqlite3'
12
+ }
13
+ },
14
+
15
+ staging: {
16
+ client: 'postgresql',
17
+ connection: {
18
+ database: 'my_db',
19
+ user: 'username',
20
+ password: 'password'
21
+ },
22
+ pool: {
23
+ min: 2,
24
+ max: 10
25
+ },
26
+ migrations: {
27
+ tableName: 'knex_migrations'
28
+ }
29
+ },
30
+
31
+ production: {
32
+ client: 'postgresql',
33
+ connection: {
34
+ database: 'my_db',
35
+ user: 'username',
36
+ password: 'password'
37
+ },
38
+ pool: {
39
+ min: 2,
40
+ max: 10
41
+ },
42
+ migrations: {
43
+ tableName: 'knex_migrations'
44
+ }
45
+ }
46
+
47
+ };
@@ -1,35 +1,35 @@
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'
35
-
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'
35
+