@naturalcycles/mysql-lib 3.14.3 → 3.14.4

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.
@@ -1,5 +1,4 @@
1
- import { DBPatch } from '@naturalcycles/db-lib';
2
- import { BaseCommonDB, CommonDB, CommonDBCreateOptions, CommonDBOptions, CommonDBSaveOptions, DBQuery, RunQueryResult } from '@naturalcycles/db-lib';
1
+ import { DBPatch, BaseCommonDB, CommonDB, CommonDBCreateOptions, CommonDBOptions, CommonDBSaveOptions, DBQuery, RunQueryResult } from '@naturalcycles/db-lib';
3
2
  import { AnyObjectWithId, CommonLogger, JsonSchemaObject, JsonSchemaRootObject, ObjectWithId } from '@naturalcycles/js-lib';
4
3
  import { ReadableTyped } from '@naturalcycles/nodejs-lib';
5
4
  import { Connection, Pool, PoolConfig, PoolConnection, QueryOptions } from 'mysql';
package/dist/mysql.db.js CHANGED
@@ -7,7 +7,7 @@ const node_util_1 = require("node:util");
7
7
  const db_lib_1 = require("@naturalcycles/db-lib");
8
8
  const js_lib_1 = require("@naturalcycles/js-lib");
9
9
  const nodejs_lib_1 = require("@naturalcycles/nodejs-lib");
10
- const mysql = require("mysql");
10
+ const mysql = tslib_1.__importStar(require("mysql"));
11
11
  const query_util_1 = require("./query.util");
12
12
  const mysql_schema_util_1 = require("./schema/mysql.schema.util");
13
13
  const BOOLEAN_TYPES = new Set(['TINY', 'TINYINT', 'INT']);
@@ -205,7 +205,7 @@ class MysqlDB extends db_lib_1.BaseCommonDB {
205
205
  const sql = (0, query_util_1.insertSQL)(table, [row], 'INSERT', this.cfg.logger)[0];
206
206
  const { insertId } = await this.runSQL({ sql });
207
207
  // Mutate the input row with insertIt
208
- rowsInput[i].id = insertId;
208
+ rowsInput[i].id = insertId; // this is because we no longer support number ids in CommonDB
209
209
  }
210
210
  }
211
211
  return;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dbQueryToSQLUpdate = exports.insertSQLSetSingle = exports.insertSQLSingle = exports.insertSQL = exports.dbQueryToSQLDelete = exports.dbQueryToSQLSelect = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const js_lib_1 = require("@naturalcycles/js-lib");
5
6
  const nodejs_lib_1 = require("@naturalcycles/nodejs-lib");
6
- const mysql = require("mysql");
7
+ const mysql = tslib_1.__importStar(require("mysql"));
7
8
  const mysql_schema_util_1 = require("./schema/mysql.schema.util");
8
9
  const MAX_PACKET_SIZE = 1024 * 1024; // 1Mb
9
10
  const MAX_ROW_SIZE = 800 * 1024; // 1Mb - margin
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mapNameFromMySQL = exports.mapNameToMySQL = exports.mysqlTableStatsToJsonSchemaField = exports.jsonSchemaToMySQLDDL = void 0;
4
- const mysql = require("mysql");
4
+ const tslib_1 = require("tslib");
5
+ const mysql = tslib_1.__importStar(require("mysql"));
5
6
  /**
6
7
  * It currently skips nullability and declares everything as "DEFAULT NULL".
7
8
  */
package/package.json CHANGED
@@ -36,7 +36,7 @@
36
36
  "engines": {
37
37
  "node": ">=16.15.0"
38
38
  },
39
- "version": "3.14.3",
39
+ "version": "3.14.4",
40
40
  "description": "MySQL client implementing CommonDB interface",
41
41
  "keywords": [
42
42
  "mysql",
package/src/mysql.db.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Readable, Transform } from 'node:stream'
2
2
  import { promisify } from 'node:util'
3
- import { DBPatch } from '@naturalcycles/db-lib'
4
3
  import {
4
+ DBPatch,
5
5
  BaseCommonDB,
6
6
  CommonDB,
7
7
  CommonDBCreateOptions,
@@ -24,8 +24,7 @@ import {
24
24
  JsonSchemaRootObject,
25
25
  ObjectWithId,
26
26
  } from '@naturalcycles/js-lib'
27
- import { ReadableTyped } from '@naturalcycles/nodejs-lib'
28
- import { white } from '@naturalcycles/nodejs-lib'
27
+ import { ReadableTyped, white } from '@naturalcycles/nodejs-lib'
29
28
  import {
30
29
  Connection,
31
30
  OkPacket,
@@ -322,7 +321,7 @@ export class MysqlDB extends BaseCommonDB implements CommonDB {
322
321
  const { insertId } = await this.runSQL<OkPacket>({ sql })
323
322
 
324
323
  // Mutate the input row with insertIt
325
- rowsInput[i]!.id = insertId
324
+ rowsInput[i]!.id = insertId as any // this is because we no longer support number ids in CommonDB
326
325
  }
327
326
  }
328
327