@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.
@@ -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.withPool = exports.withConnection = exports.connectToDatabase = exports.getDatabaseCredentials = void 0;
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: 128, queueLimit: 0 }));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillsql/node",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Quill Server SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -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
@@ -29,7 +29,7 @@ export function connectToMysql(config: MysqlConnectionConfig): MysqlPool {
29
29
  const pool = mysql.createPool({
30
30
  ...config,
31
31
  waitForConnections: true,
32
- connectionLimit: 128,
32
+ connectionLimit: 24,
33
33
  queueLimit: 0,
34
34
  });
35
35
  return pool;
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;