@malloydata/db-mysql 0.0.335 → 0.0.336
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.
|
@@ -24,6 +24,7 @@ export declare class MySQLConnection extends BaseConnection implements Connectio
|
|
|
24
24
|
test(): Promise<void>;
|
|
25
25
|
runSQL(sql: string, _options?: RunSQLOptions): Promise<MalloyQueryData>;
|
|
26
26
|
isPool(): this is PooledConnection;
|
|
27
|
+
getDigest(): string;
|
|
27
28
|
canPersist(): this is PersistSQLResults;
|
|
28
29
|
canStream(): this is StreamingConnection;
|
|
29
30
|
close(): Promise<void>;
|
package/dist/mysql_connection.js
CHANGED
|
@@ -101,7 +101,7 @@ class MySQLConnection extends connection_1.BaseConnection {
|
|
|
101
101
|
return this.connection;
|
|
102
102
|
}
|
|
103
103
|
async manifestTemporaryTable(sqlCommand) {
|
|
104
|
-
const hash = (0,
|
|
104
|
+
const hash = (0, malloy_1.makeDigest)(sqlCommand);
|
|
105
105
|
const tableName = `tt${hash}`;
|
|
106
106
|
const cmd = `CREATE TEMPORARY TABLE IF NOT EXISTS ${tableName} AS (${sqlCommand});`;
|
|
107
107
|
// console.log(cmd);
|
|
@@ -118,6 +118,11 @@ class MySQLConnection extends connection_1.BaseConnection {
|
|
|
118
118
|
isPool() {
|
|
119
119
|
return false;
|
|
120
120
|
}
|
|
121
|
+
getDigest() {
|
|
122
|
+
const { host, port, database } = this.config;
|
|
123
|
+
const data = `mysql:${host !== null && host !== void 0 ? host : ''}:${port !== null && port !== void 0 ? port : 3306}:${database !== null && database !== void 0 ? database : ''}`;
|
|
124
|
+
return (0, malloy_1.makeDigest)(data);
|
|
125
|
+
}
|
|
121
126
|
canPersist() {
|
|
122
127
|
return true;
|
|
123
128
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/db-mysql",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.336",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"prepublishOnly": "npm run build"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@malloydata/malloy": "0.0.
|
|
25
|
+
"@malloydata/malloy": "0.0.336",
|
|
26
26
|
"@types/node": "^22.7.4",
|
|
27
27
|
"fastestsmallesttextencoderdecoder": "^1.0.22",
|
|
28
28
|
"luxon": "^3.5.0",
|