@holo-js/db-mysql 0.3.22 → 0.3.24
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/dist/index.d.ts +3 -3
- package/dist/index.mjs +3 -2
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PoolOptions } from 'mysql2/promise';
|
|
1
|
+
import { PoolOptions, Connection } from 'mysql2/promise';
|
|
2
2
|
import { DriverAdapter, DriverQueryResult, DriverExecutionResult, DatabaseDriverFactory } from '@holo-js/db';
|
|
3
3
|
export { DriverAdapter, DriverExecutionResult, DriverQueryResult } from '@holo-js/db';
|
|
4
4
|
|
|
@@ -16,12 +16,12 @@ interface MySQLPoolLike extends MySQLQueryableLike {
|
|
|
16
16
|
interface MySQLAdapterOptions<TConfig extends PoolOptions = PoolOptions> {
|
|
17
17
|
uri?: string;
|
|
18
18
|
config?: TConfig;
|
|
19
|
-
client?: MySQLClientLike;
|
|
19
|
+
client?: Connection | MySQLClientLike;
|
|
20
20
|
pool?: MySQLPoolLike;
|
|
21
21
|
createPool?: (config: TConfig) => MySQLPoolLike;
|
|
22
22
|
}
|
|
23
23
|
declare class MySQLAdapter<TConfig extends PoolOptions = PoolOptions> implements DriverAdapter {
|
|
24
|
-
readonly supportsConcurrentTransactionScopes
|
|
24
|
+
readonly supportsConcurrentTransactionScopes: boolean;
|
|
25
25
|
private pool?;
|
|
26
26
|
private readonly directClient?;
|
|
27
27
|
private readonly createPoolInstance?;
|
package/dist/index.mjs
CHANGED
|
@@ -76,7 +76,7 @@ function isMySQLDatabaseMissing(error) {
|
|
|
76
76
|
return typeof error === "object" && error !== null && ("code" in error && error.code === "ER_BAD_DB_ERROR" || "errno" in error && error.errno === 1049);
|
|
77
77
|
}
|
|
78
78
|
var MySQLAdapter = class {
|
|
79
|
-
supportsConcurrentTransactionScopes
|
|
79
|
+
supportsConcurrentTransactionScopes;
|
|
80
80
|
pool;
|
|
81
81
|
directClient;
|
|
82
82
|
createPoolInstance;
|
|
@@ -84,7 +84,8 @@ var MySQLAdapter = class {
|
|
|
84
84
|
connected;
|
|
85
85
|
transactionClients;
|
|
86
86
|
constructor(options = {}) {
|
|
87
|
-
this.
|
|
87
|
+
this.supportsConcurrentTransactionScopes = !options.client;
|
|
88
|
+
this.directClient = options.client ? wrapMySQLClient(options.client) : void 0;
|
|
88
89
|
this.pool = options.pool;
|
|
89
90
|
this.createPoolInstance = options.createPool ?? (options.client || options.pool ? void 0 : createNativeMySQLPool);
|
|
90
91
|
this.config = options.config ?? (options.uri ? { uri: options.uri } : {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holo-js/db-mysql",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.24",
|
|
4
4
|
"description": "Holo-JS Framework - MySQL database adapter",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"test:integration": "HOLO_MYSQL_INTEGRATION=1 vitest --run tests/mysql.test.ts"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@holo-js/db": "^0.3.
|
|
27
|
+
"@holo-js/db": "^0.3.24"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"mysql2": "^3.17.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@holo-js/db": "^0.3.
|
|
33
|
+
"@holo-js/db": "^0.3.24",
|
|
34
34
|
"tsup": "^8.3.5",
|
|
35
35
|
"typescript": "^5.7.2",
|
|
36
36
|
"vitest": "^4.1.5"
|