@quillsql/node 0.6.2 → 0.6.3
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/db/DatabaseHelper.d.ts +0 -1
- package/dist/db/DatabaseHelper.js +1 -12
- package/dist/db/Mysql.js +1 -1
- package/dist/index.js +0 -1
- package/package.json +1 -1
- package/src/db/DatabaseHelper.ts +0 -12
- package/src/db/Mysql.ts +1 -1
- package/src/index.ts +0 -2
|
@@ -19,7 +19,6 @@ export interface QuillQueryResults {
|
|
|
19
19
|
export declare function getDatabaseCredentials(databaseType: "postgresql" | "snowflake" | "bigquery" | "mysql", connectionString: string): PostgresConnectionConfig | SnowflakeConnectionConfig | BigQueryConfig | MysqlConnectionConfig;
|
|
20
20
|
export declare function connectToDatabase(databaseType: "postgresql" | "snowflake" | "bigquery" | "mysql", config: PostgresConnectionConfig | SnowflakeConnectionConfig | BigQueryConfig | MysqlConnectionConfig): DatabaseConnection;
|
|
21
21
|
export declare function withConnection<T>(databaseType: "postgresql" | "snowflake" | "bigquery" | "mysql", connectionString: string, callback: (connection: DatabaseConnection) => T): Promise<T>;
|
|
22
|
-
export declare function withPool<T>(databaseType: "postgresql" | "snowflake" | "bigquery" | "mysql", pool: DatabaseConnection, callback: (connection: DatabaseConnection) => T): Promise<T>;
|
|
23
22
|
export declare function runQueryByDatabase(databaseType: "postgresql" | "snowflake" | "bigquery" | "mysql", connection: DatabaseConnection, sql: string): Promise<QuillQueryResults> | undefined;
|
|
24
23
|
export declare function connectAndRunQuery(databaseType: "postgresql" | "snowflake" | "bigquery" | "mysql", connectionString: string, sql: string): Promise<QuillQueryResults | undefined>;
|
|
25
24
|
export declare function disconnectFromDatabase(databaseType: "postgresql" | "snowflake" | "bigquery" | "mysql", database: DatabaseConnection): void | Promise<void>;
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.getColumnInfoBySchemaByDatabase = exports.getForiegnKeysByDatabase = exports.getColumnsByTableByDatabase = exports.getTablesBySchemaByDatabase = exports.getSchemasByDatabase = exports.disconnectFromDatabase = exports.connectAndRunQuery = exports.runQueryByDatabase = exports.
|
|
12
|
+
exports.getColumnInfoBySchemaByDatabase = exports.getForiegnKeysByDatabase = exports.getColumnsByTableByDatabase = exports.getTablesBySchemaByDatabase = exports.getSchemasByDatabase = exports.disconnectFromDatabase = exports.connectAndRunQuery = exports.runQueryByDatabase = exports.withConnection = exports.connectToDatabase = exports.getDatabaseCredentials = void 0;
|
|
13
13
|
const Postgres_1 = require("./Postgres");
|
|
14
14
|
const Snowflake_1 = require("./Snowflake");
|
|
15
15
|
const BigQuery_1 = require("./BigQuery");
|
|
@@ -61,17 +61,6 @@ function withConnection(databaseType, connectionString, callback) {
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
exports.withConnection = withConnection;
|
|
64
|
-
function withPool(databaseType, pool, callback) {
|
|
65
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
try {
|
|
67
|
-
return yield callback(pool);
|
|
68
|
-
}
|
|
69
|
-
finally {
|
|
70
|
-
yield disconnectFromDatabase(databaseType, pool);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
exports.withPool = withPool;
|
|
75
64
|
function runQueryByDatabase(databaseType, connection, sql) {
|
|
76
65
|
switch (databaseType.toLowerCase()) {
|
|
77
66
|
case "postgres":
|
package/dist/db/Mysql.js
CHANGED
|
@@ -29,7 +29,7 @@ function formatMysqlConfig(connectionString) {
|
|
|
29
29
|
}
|
|
30
30
|
exports.formatMysqlConfig = formatMysqlConfig;
|
|
31
31
|
function connectToMysql(config) {
|
|
32
|
-
const pool = mysql2_1.default.createPool(Object.assign(Object.assign({}, config), { waitForConnections: true, connectionLimit:
|
|
32
|
+
const pool = mysql2_1.default.createPool(Object.assign(Object.assign({}, config), { waitForConnections: true, connectionLimit: 24, queueLimit: 0 }));
|
|
33
33
|
return pool;
|
|
34
34
|
}
|
|
35
35
|
exports.connectToMysql = connectToMysql;
|
package/dist/index.js
CHANGED
|
@@ -245,7 +245,6 @@ const requireQuill = ({ privateKey, databaseConnectionString, databaseConfig, ca
|
|
|
245
245
|
module.exports = requireQuill;
|
|
246
246
|
module.exports.default = requireQuill;
|
|
247
247
|
module.exports.withConnection = DatabaseHelper_1.withConnection;
|
|
248
|
-
module.exports.withPool = DatabaseHelper_1.withPool;
|
|
249
248
|
module.exports.connectToDatabase = DatabaseHelper_1.connectToDatabase;
|
|
250
249
|
module.exports.connectAndRunQuery = DatabaseHelper_1.connectAndRunQuery;
|
|
251
250
|
module.exports.Quill = Quill;
|
package/package.json
CHANGED
package/src/db/DatabaseHelper.ts
CHANGED
|
@@ -124,18 +124,6 @@ export async function withConnection<T>(
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
export async function withPool<T>(
|
|
128
|
-
databaseType: "postgresql" | "snowflake" | "bigquery" | "mysql",
|
|
129
|
-
pool: DatabaseConnection,
|
|
130
|
-
callback: (connection: DatabaseConnection) => T,
|
|
131
|
-
): Promise<T> {
|
|
132
|
-
try {
|
|
133
|
-
return await callback(pool);
|
|
134
|
-
} finally {
|
|
135
|
-
await disconnectFromDatabase(databaseType, pool);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
127
|
export function runQueryByDatabase(
|
|
140
128
|
databaseType: "postgresql" | "snowflake" | "bigquery" | "mysql",
|
|
141
129
|
connection: DatabaseConnection,
|
package/src/db/Mysql.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
getTablesBySchemaByDatabase,
|
|
20
20
|
runQueryByDatabase,
|
|
21
21
|
withConnection,
|
|
22
|
-
withPool,
|
|
23
22
|
} from "./db/DatabaseHelper";
|
|
24
23
|
import { convertTypeToPostgres } from "./utils/schemaConversion";
|
|
25
24
|
|
|
@@ -362,7 +361,6 @@ const requireQuill = ({
|
|
|
362
361
|
module.exports = requireQuill;
|
|
363
362
|
module.exports.default = requireQuill;
|
|
364
363
|
module.exports.withConnection = withConnection;
|
|
365
|
-
module.exports.withPool = withPool;
|
|
366
364
|
module.exports.connectToDatabase = connectToDatabase;
|
|
367
365
|
module.exports.connectAndRunQuery = connectAndRunQuery;
|
|
368
366
|
module.exports.Quill = Quill;
|