@bytebase/dbhub 1.2.3 → 1.2.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.
package/dist/index.js
CHANGED
|
@@ -2068,11 +2068,11 @@ See documentation for more details on configuring database connections.
|
|
|
2068
2068
|
|
|
2069
2069
|
// src/index.ts
|
|
2070
2070
|
var connectorModules = [
|
|
2071
|
-
{ load: () => import("./postgres-
|
|
2071
|
+
{ load: () => import("./postgres-M3W3Y6F5.js"), name: "PostgreSQL", driver: "pg" },
|
|
2072
2072
|
{ load: () => import("./sqlserver-WNVSBFJ3.js"), name: "SQL Server", driver: "mssql" },
|
|
2073
2073
|
{ load: () => import("./sqlite-ASYMU5BI.js"), name: "SQLite", driver: "node:sqlite" },
|
|
2074
2074
|
{ load: () => import("./mysql-GXDUNLJ6.js"), name: "MySQL", driver: "mysql2" },
|
|
2075
|
-
{ load: () => import("./mariadb-
|
|
2075
|
+
{ load: () => import("./mariadb-EVJ5HLYH.js"), name: "MariaDB", driver: "mariadb" }
|
|
2076
2076
|
];
|
|
2077
2077
|
loadConnectors(connectorModules).then(() => main()).catch((error) => {
|
|
2078
2078
|
console.error("Fatal error:", error);
|
|
@@ -125,6 +125,12 @@ var MariaDBConnector = class _MariaDBConnector {
|
|
|
125
125
|
try {
|
|
126
126
|
const connectionConfig = await this.dsnParser.parse(dsn, config);
|
|
127
127
|
this.pool = mariadb.createPool(connectionConfig);
|
|
128
|
+
this.pool.on("error", (err) => {
|
|
129
|
+
console.error(
|
|
130
|
+
`MariaDB pool (source "${this.sourceId}"): background connection error, pool will retry:`,
|
|
131
|
+
err.message
|
|
132
|
+
);
|
|
133
|
+
});
|
|
128
134
|
const rows = await this.pool.query("SELECT VERSION() AS version");
|
|
129
135
|
this.supportsReadOnlyTransaction = !isTiDBVersion(rows?.[0]?.version);
|
|
130
136
|
} catch (err) {
|
|
@@ -179,6 +179,12 @@ var PostgresConnector = class _PostgresConnector {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
this.pool = new Pool(poolConfig);
|
|
182
|
+
this.pool.on("error", (err) => {
|
|
183
|
+
console.error(
|
|
184
|
+
`PostgreSQL pool (source "${this.sourceId}"): idle connection dropped, will reconnect on next query:`,
|
|
185
|
+
err.message
|
|
186
|
+
);
|
|
187
|
+
});
|
|
182
188
|
const client = await this.pool.connect();
|
|
183
189
|
client.release();
|
|
184
190
|
} catch (err) {
|
|
@@ -226,7 +232,7 @@ var PostgresConnector = class _PostgresConnector {
|
|
|
226
232
|
SELECT table_name
|
|
227
233
|
FROM information_schema.tables
|
|
228
234
|
WHERE table_schema = $1
|
|
229
|
-
AND table_type
|
|
235
|
+
AND table_type IN ('BASE TABLE', 'FOREIGN')
|
|
230
236
|
ORDER BY table_name
|
|
231
237
|
`,
|
|
232
238
|
[schemaToUse]
|
|
@@ -305,7 +311,7 @@ var PostgresConnector = class _PostgresConnector {
|
|
|
305
311
|
AND i.oid = ix.indexrelid
|
|
306
312
|
AND a.attrelid = t.oid
|
|
307
313
|
AND a.attnum = ANY(ix.indkey)
|
|
308
|
-
AND t.relkind
|
|
314
|
+
AND t.relkind IN ('r','p')
|
|
309
315
|
AND t.relname = $1
|
|
310
316
|
AND ns.oid = t.relnamespace
|
|
311
317
|
AND ns.nspname = $2
|
package/package.json
CHANGED