knex 3.0.0 → 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
@@ -2,6 +2,10 @@
2
2
 
3
3
  # 3.0.0 - 6 October, 2023
4
4
 
5
+ - Build fix
6
+
7
+ # 3.0.0 - 6 October, 2023
8
+
5
9
  - Fix raw bindings typing (#5401)
6
10
  - Fix migrate:unlock when used with custom identifier wrapping. (#5353)
7
11
  - Fix driver options specified with .options() method being ignored for oracledb dialect (#5123)
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ exports.getDialectByNameOrAlias = void 0;
4
+ const { resolveClientNameWithAliases } = require('../util/helpers');
5
+ const dbNameToDialectLoader = Object.freeze({
6
+ 'better-sqlite3': () => require('./better-sqlite3'),
7
+ cockroachdb: () => require('./cockroachdb'),
8
+ mssql: () => require('./mssql'),
9
+ mysql: () => require('./mysql'),
10
+ mysql2: () => require('./mysql2'),
11
+ oracle: () => require('./oracle'),
12
+ oracledb: () => require('./oracledb'),
13
+ pgnative: () => require('./pgnative'),
14
+ postgres: () => require('./postgres'),
15
+ redshift: () => require('./redshift'),
16
+ sqlite3: () => require('./sqlite3'),
17
+ });
18
+ /**
19
+ * Gets the Dialect object with the given client name or throw an
20
+ * error if not found.
21
+ *
22
+ * NOTE: This is a replacement for prior practice of doing dynamic
23
+ * string construction for imports of Dialect objects.
24
+ */
25
+ function getDialectByNameOrAlias(clientName) {
26
+ const resolvedClientName = resolveClientNameWithAliases(clientName);
27
+ const dialectLoader = dbNameToDialectLoader[resolvedClientName];
28
+ if (!dialectLoader) {
29
+ throw new Error(`Invalid clientName given: ${clientName}`);
30
+ }
31
+ return dialectLoader();
32
+ }
33
+ exports.getDialectByNameOrAlias = getDialectByNameOrAlias;
34
+ //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knex",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "A batteries-included SQL query & schema builder for PostgresSQL, MySQL, CockroachDB, MSSQL and SQLite3",
5
5
  "main": "knex",
6
6
  "types": "types/index.d.ts",
@@ -58,9 +58,7 @@
58
58
  "db:stop:oracle": "docker-compose -f scripts/docker-compose.yml down",
59
59
  "stress:init": "docker-compose -f scripts/stress-test/docker-compose.yml up --no-start && docker-compose -f scripts/stress-test/docker-compose.yml start",
60
60
  "stress:test": "node scripts/stress-test/knex-stress-test.js | grep -A 5 -B 60 -- '- STATS '",
61
- "stress:destroy": "docker-compose -f scripts/stress-test/docker-compose.yml stop",
62
- "prepare": "husky install && npm run clean && npm run build",
63
- "prepublishOnly": "npm run format:check && npm run lint:everything && npm run clean && npm run build"
61
+ "stress:destroy": "docker-compose -f scripts/stress-test/docker-compose.yml stop"
64
62
  },
65
63
  "dependencies": {
66
64
  "colorette": "2.0.19",