@zintrust/db-mysql 0.1.20 → 0.1.23

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @zintrust/db-mysql
2
2
 
3
- MySQL / MariaDB database adapter package for Zintrust (uses `mysql2`).
3
+ MySQL / MariaDB database adapter package for ZinTrust (uses `mysql2`).
4
4
 
5
5
  ## Install
6
6
 
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@zintrust/db-mysql",
3
+ "version": "0.1.15",
4
+ "buildDate": "2026-01-21T12:26:21.522Z",
5
+ "buildEnvironment": {
6
+ "node": "v20.19.6",
7
+ "platform": "linux",
8
+ "arch": "x64"
9
+ },
10
+ "git": {
11
+ "commit": "ae2c0a6",
12
+ "branch": "master"
13
+ },
14
+ "package": {
15
+ "engines": {
16
+ "node": ">=20.0.0"
17
+ },
18
+ "dependencies": [
19
+ "mysql2"
20
+ ],
21
+ "peerDependencies": [
22
+ "@zintrust/core"
23
+ ]
24
+ },
25
+ "files": {
26
+ "index.d.ts": {
27
+ "size": 1380,
28
+ "sha256": "0e9961f469b7a5a2ab8a2f33eaaa6220b8a9b382e6c552e2a7320399ed9de9f4"
29
+ },
30
+ "index.js": {
31
+ "size": 7548,
32
+ "sha256": "a10b6dc1bf2a6dbb2bc5de86ff26ffafdd57d409c94f0c1ee20745d89528cd7b"
33
+ },
34
+ "register.d.ts": {
35
+ "size": 180,
36
+ "sha256": "1ac7cca6cfbda8e5a65153917d4bbb4dd4fbe309dcabf9d9bdfb1eea6e97e52e"
37
+ },
38
+ "register.js": {
39
+ "size": 1063,
40
+ "sha256": "11fa6c4311766321ac9bd080ea6234756dd2fffcd767e5e69cea44bd9e8ea8fd"
41
+ }
42
+ }
43
+ }
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export type DatabaseConfig = {
12
12
  export type QueryResult = {
13
13
  rows: Record<string, unknown>[];
14
14
  rowCount: number;
15
+ lastInsertId?: string | number | bigint;
15
16
  };
16
17
  export interface IDatabaseAdapter {
17
18
  connect(): Promise<void>;
@@ -30,3 +31,9 @@ export declare const MySQLAdapter: Readonly<{
30
31
  create: (config: DatabaseConfig) => IDatabaseAdapter;
31
32
  }>;
32
33
  export default MySQLAdapter;
34
+ /**
35
+ * Package version and build metadata
36
+ * Available at runtime for debugging and health checks
37
+ */
38
+ export declare const _ZINTRUST_DB_MYSQL_VERSION = "0.1.15";
39
+ export declare const _ZINTRUST_DB_MYSQL_BUILD_DATE = "__BUILD_DATE__";
package/dist/index.js CHANGED
@@ -46,7 +46,13 @@ function normalizeQueryResult(raw) {
46
46
  const affectedRows = typeof maybe.affectedRows === 'number' && Number.isFinite(maybe.affectedRows)
47
47
  ? maybe.affectedRows
48
48
  : 0;
49
- return { rows: [], rowCount: affectedRows };
49
+ const insertId = (typeof maybe.insertId === 'number' ||
50
+ typeof maybe.insertId === 'string' ||
51
+ typeof maybe.insertId === 'bigint') &&
52
+ maybe.insertId !== 0 // Only return if valid ID
53
+ ? maybe.insertId
54
+ : undefined;
55
+ return { rows: [], rowCount: affectedRows, lastInsertId: insertId };
50
56
  }
51
57
  return { rows: [], rowCount: 0 };
52
58
  }
@@ -192,3 +198,9 @@ export const MySQLAdapter = Object.freeze({
192
198
  create: (config) => createMySqlAdapter(config),
193
199
  });
194
200
  export default MySQLAdapter;
201
+ /**
202
+ * Package version and build metadata
203
+ * Available at runtime for debugging and health checks
204
+ */
205
+ export const _ZINTRUST_DB_MYSQL_VERSION = '0.1.15';
206
+ export const _ZINTRUST_DB_MYSQL_BUILD_DATE = '__BUILD_DATE__';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zintrust/db-mysql",
3
- "version": "0.1.20",
3
+ "version": "0.1.23",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -22,7 +22,7 @@
22
22
  "node": ">=20.0.0"
23
23
  },
24
24
  "peerDependencies": {
25
- "@zintrust/core": "^0.1.20"
25
+ "@zintrust/core": "^0.1.23"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public"