@quillsql/node 0.5.7 → 0.5.9
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/CachedConnection.d.ts +3 -1
- package/dist/db/CachedConnection.js +17 -1
- package/dist/db/Mysql.d.ts +1 -0
- package/dist/db/Mysql.js +9 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
- package/src/db/CachedConnection.ts +23 -6
- package/src/db/Mysql.ts +20 -12
- package/src/index.ts +16 -15
|
@@ -2,15 +2,17 @@ import { Mapable, CacheCredentials } from "../models/Cache";
|
|
|
2
2
|
import { DatabaseConnection } from "./DatabaseHelper";
|
|
3
3
|
export declare class CachedConnection {
|
|
4
4
|
databaseType: "postgresql" | "snowflake" | "bigquery" | "mysql";
|
|
5
|
-
pool: DatabaseConnection;
|
|
5
|
+
pool: DatabaseConnection | null;
|
|
6
6
|
orgId: any;
|
|
7
7
|
ttl: number;
|
|
8
8
|
cache: Mapable | null;
|
|
9
|
+
private config;
|
|
9
10
|
constructor(databaseType: "postgresql" | "snowflake" | "bigquery" | "mysql", config: any, cacheConfig?: Partial<CacheCredentials>);
|
|
10
11
|
query(text: string, values?: any[]): Promise<any>;
|
|
11
12
|
/**
|
|
12
13
|
* Configures and returns a cache instance or null if none could be created.
|
|
13
14
|
*/
|
|
14
15
|
private getCache;
|
|
16
|
+
getPool(): DatabaseConnection;
|
|
15
17
|
close(): Promise<void>;
|
|
16
18
|
}
|
|
@@ -29,12 +29,14 @@ class CachedConnection {
|
|
|
29
29
|
var _a;
|
|
30
30
|
this.databaseType = databaseType;
|
|
31
31
|
this.pool = (0, DatabaseHelper_1.connectToDatabase)(databaseType, config);
|
|
32
|
+
this.config = config;
|
|
32
33
|
this.ttl = (_a = cacheConfig === null || cacheConfig === void 0 ? void 0 : cacheConfig.ttl) !== null && _a !== void 0 ? _a : DEFAULT_CACHE_TTL;
|
|
33
34
|
this.cache = this.getCache(cacheConfig);
|
|
34
35
|
}
|
|
35
36
|
query(text, values) {
|
|
36
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37
38
|
try {
|
|
39
|
+
this.pool = this.getPool();
|
|
38
40
|
if (!this.cache) {
|
|
39
41
|
return yield (0, DatabaseHelper_1.runQueryByDatabase)(this.databaseType, this.pool, text);
|
|
40
42
|
}
|
|
@@ -58,6 +60,11 @@ class CachedConnection {
|
|
|
58
60
|
throw new Error(err.message);
|
|
59
61
|
}
|
|
60
62
|
}
|
|
63
|
+
finally {
|
|
64
|
+
if (this.databaseType.toLowerCase() === "mysql") {
|
|
65
|
+
this.close();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
61
68
|
});
|
|
62
69
|
}
|
|
63
70
|
/**
|
|
@@ -72,9 +79,18 @@ class CachedConnection {
|
|
|
72
79
|
}
|
|
73
80
|
return null;
|
|
74
81
|
}
|
|
82
|
+
getPool() {
|
|
83
|
+
if (!this.pool) {
|
|
84
|
+
this.pool = (0, DatabaseHelper_1.connectToDatabase)(this.databaseType, this.config);
|
|
85
|
+
}
|
|
86
|
+
return this.pool;
|
|
87
|
+
}
|
|
75
88
|
close() {
|
|
76
89
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
|
|
90
|
+
if (this.pool) {
|
|
91
|
+
(0, DatabaseHelper_1.disconnectFromDatabase)(this.databaseType, this.pool);
|
|
92
|
+
this.pool = null;
|
|
93
|
+
}
|
|
78
94
|
});
|
|
79
95
|
}
|
|
80
96
|
}
|
package/dist/db/Mysql.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface MysqlConnectionConfig {
|
|
|
5
5
|
user: string;
|
|
6
6
|
password: string;
|
|
7
7
|
database: string;
|
|
8
|
+
port: number;
|
|
8
9
|
}
|
|
9
10
|
export declare function formatMysqlConfig(connectionString: string): MysqlConnectionConfig;
|
|
10
11
|
export declare function connectToMysql(config: MysqlConnectionConfig): MysqlPool;
|
package/dist/db/Mysql.js
CHANGED
|
@@ -24,11 +24,12 @@ function formatMysqlConfig(connectionString) {
|
|
|
24
24
|
user: user || "",
|
|
25
25
|
password: password || "",
|
|
26
26
|
database: (parsedUrl.pathname || "").slice(1),
|
|
27
|
+
port: parsedUrl.port ? parseInt(parsedUrl.port) : 3306,
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
30
|
exports.formatMysqlConfig = formatMysqlConfig;
|
|
30
31
|
function connectToMysql(config) {
|
|
31
|
-
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: 128, queueLimit: 0 }));
|
|
32
33
|
return pool;
|
|
33
34
|
}
|
|
34
35
|
exports.connectToMysql = connectToMysql;
|
|
@@ -166,6 +167,10 @@ function mysqlTextDataTypeToPostgresOID(type) {
|
|
|
166
167
|
return 1043;
|
|
167
168
|
case "timestamp": // date
|
|
168
169
|
return 1082;
|
|
170
|
+
case "date": // date
|
|
171
|
+
return 1082;
|
|
172
|
+
case "datetime": // date
|
|
173
|
+
return 1082;
|
|
169
174
|
default: // varchar
|
|
170
175
|
return 1043;
|
|
171
176
|
}
|
|
@@ -184,7 +189,9 @@ function mysqlDataTypeIdToPostgresType(type) {
|
|
|
184
189
|
return 1043;
|
|
185
190
|
case 7: // date
|
|
186
191
|
return 1082;
|
|
187
|
-
case
|
|
192
|
+
case 10: // date
|
|
193
|
+
return 1082;
|
|
194
|
+
case 12: // date
|
|
188
195
|
return 1082;
|
|
189
196
|
default: // varchar
|
|
190
197
|
return 1043;
|
package/dist/index.js
CHANGED
|
@@ -167,8 +167,9 @@ class Quill {
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
else if (runQueryConfig === null || runQueryConfig === void 0 ? void 0 : runQueryConfig.getTables) {
|
|
170
|
-
const queryResult = yield (0, DatabaseHelper_1.getTablesBySchemaByDatabase)(this.targetConnection.databaseType, this.targetConnection.
|
|
171
|
-
const schemaInfo = yield (0, DatabaseHelper_1.getColumnInfoBySchemaByDatabase)(this.targetConnection.databaseType, this.targetConnection.
|
|
170
|
+
const queryResult = yield (0, DatabaseHelper_1.getTablesBySchemaByDatabase)(this.targetConnection.databaseType, this.targetConnection.getPool(), runQueryConfig.schemaNames || runQueryConfig.schema);
|
|
171
|
+
const schemaInfo = yield (0, DatabaseHelper_1.getColumnInfoBySchemaByDatabase)(this.targetConnection.databaseType, this.targetConnection.getPool(), runQueryConfig.schema, queryResult);
|
|
172
|
+
this.targetConnection.close();
|
|
172
173
|
return schemaInfo;
|
|
173
174
|
}
|
|
174
175
|
else {
|
package/package.json
CHANGED
|
@@ -29,24 +29,27 @@ const DEFAULT_CACHE_TTL = 24 * 60 * 60;
|
|
|
29
29
|
|
|
30
30
|
export class CachedConnection {
|
|
31
31
|
public databaseType: "postgresql" | "snowflake" | "bigquery" | "mysql";
|
|
32
|
-
public pool: DatabaseConnection;
|
|
32
|
+
public pool: DatabaseConnection | null;
|
|
33
33
|
public orgId: any;
|
|
34
34
|
public ttl: number;
|
|
35
35
|
public cache: Mapable | null;
|
|
36
|
+
private config: any;
|
|
36
37
|
|
|
37
38
|
constructor(
|
|
38
39
|
databaseType: "postgresql" | "snowflake" | "bigquery" | "mysql",
|
|
39
40
|
config: any,
|
|
40
|
-
cacheConfig: Partial<CacheCredentials> = {}
|
|
41
|
+
cacheConfig: Partial<CacheCredentials> = {},
|
|
41
42
|
) {
|
|
42
43
|
this.databaseType = databaseType;
|
|
43
44
|
this.pool = connectToDatabase(databaseType, config);
|
|
45
|
+
this.config = config;
|
|
44
46
|
this.ttl = cacheConfig?.ttl ?? DEFAULT_CACHE_TTL;
|
|
45
47
|
this.cache = this.getCache(cacheConfig);
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
public async query(text: string, values?: any[]): Promise<any> {
|
|
49
51
|
try {
|
|
52
|
+
this.pool = this.getPool();
|
|
50
53
|
if (!this.cache) {
|
|
51
54
|
return await runQueryByDatabase(this.databaseType, this.pool, text);
|
|
52
55
|
}
|
|
@@ -58,7 +61,7 @@ export class CachedConnection {
|
|
|
58
61
|
const newResult = await runQueryByDatabase(
|
|
59
62
|
this.databaseType,
|
|
60
63
|
this.pool,
|
|
61
|
-
text
|
|
64
|
+
text,
|
|
62
65
|
);
|
|
63
66
|
const newResultString: string = JSON.stringify(newResult);
|
|
64
67
|
await this.cache.set(key, newResultString, "EX", DEFAULT_CACHE_TTL);
|
|
@@ -69,11 +72,15 @@ export class CachedConnection {
|
|
|
69
72
|
throw new PgError(
|
|
70
73
|
(err as any).detail,
|
|
71
74
|
(err as any).hint,
|
|
72
|
-
(err as any).position
|
|
75
|
+
(err as any).position,
|
|
73
76
|
);
|
|
74
77
|
} else if (err instanceof Error) {
|
|
75
78
|
throw new Error(err.message);
|
|
76
79
|
}
|
|
80
|
+
} finally {
|
|
81
|
+
if (this.databaseType.toLowerCase() === "mysql") {
|
|
82
|
+
this.close();
|
|
83
|
+
}
|
|
77
84
|
}
|
|
78
85
|
}
|
|
79
86
|
|
|
@@ -89,14 +96,24 @@ export class CachedConnection {
|
|
|
89
96
|
}: QuillConfig["cache"]): Mapable | null {
|
|
90
97
|
if (cacheType === "redis" || cacheType === "rediss") {
|
|
91
98
|
const redisURL = `${cacheType}://${username}:${password}@${host}:${port}`;
|
|
92
|
-
const client =
|
|
99
|
+
const client = createClient({ url: redisURL });
|
|
93
100
|
client.connect();
|
|
94
101
|
return client as Mapable;
|
|
95
102
|
}
|
|
96
103
|
return null;
|
|
97
104
|
}
|
|
98
105
|
|
|
106
|
+
public getPool() {
|
|
107
|
+
if (!this.pool) {
|
|
108
|
+
this.pool = connectToDatabase(this.databaseType, this.config);
|
|
109
|
+
}
|
|
110
|
+
return this.pool;
|
|
111
|
+
}
|
|
112
|
+
|
|
99
113
|
async close() {
|
|
100
|
-
|
|
114
|
+
if (this.pool) {
|
|
115
|
+
disconnectFromDatabase(this.databaseType, this.pool);
|
|
116
|
+
this.pool = null;
|
|
117
|
+
}
|
|
101
118
|
}
|
|
102
119
|
}
|
package/src/db/Mysql.ts
CHANGED
|
@@ -10,10 +10,11 @@ export interface MysqlConnectionConfig {
|
|
|
10
10
|
user: string;
|
|
11
11
|
password: string;
|
|
12
12
|
database: string;
|
|
13
|
+
port: number;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export function formatMysqlConfig(
|
|
16
|
-
connectionString: string
|
|
17
|
+
connectionString: string,
|
|
17
18
|
): MysqlConnectionConfig {
|
|
18
19
|
const parsedUrl = url.parse(connectionString);
|
|
19
20
|
const [user, password] = (parsedUrl.auth || "").split(":");
|
|
@@ -22,6 +23,7 @@ export function formatMysqlConfig(
|
|
|
22
23
|
user: user || "",
|
|
23
24
|
password: password || "",
|
|
24
25
|
database: (parsedUrl.pathname || "").slice(1),
|
|
26
|
+
port: parsedUrl.port ? parseInt(parsedUrl.port) : 3306,
|
|
25
27
|
};
|
|
26
28
|
}
|
|
27
29
|
|
|
@@ -29,7 +31,7 @@ export function connectToMysql(config: MysqlConnectionConfig): MysqlPool {
|
|
|
29
31
|
const pool = mysql.createPool({
|
|
30
32
|
...config,
|
|
31
33
|
waitForConnections: true,
|
|
32
|
-
connectionLimit:
|
|
34
|
+
connectionLimit: 128,
|
|
33
35
|
queueLimit: 0,
|
|
34
36
|
});
|
|
35
37
|
return pool;
|
|
@@ -41,7 +43,7 @@ export function disconnectFromMysql(connection: MysqlPool) {
|
|
|
41
43
|
|
|
42
44
|
export async function runQueryMysql(
|
|
43
45
|
sql: string,
|
|
44
|
-
connection: MysqlPool
|
|
46
|
+
connection: MysqlPool,
|
|
45
47
|
): Promise<QuillQueryResults> {
|
|
46
48
|
const result: QuillQueryResults = await new Promise((resolve, reject) => {
|
|
47
49
|
connection.query(sql, (error, results, fields) => {
|
|
@@ -70,7 +72,7 @@ export async function runQueryMysql(
|
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
export async function getSchemasMysql(
|
|
73
|
-
connection: MysqlPool
|
|
75
|
+
connection: MysqlPool,
|
|
74
76
|
): Promise<string[]> {
|
|
75
77
|
const sql = `SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA
|
|
76
78
|
WHERE schema_name != 'information_schema'
|
|
@@ -82,7 +84,7 @@ export async function getSchemasMysql(
|
|
|
82
84
|
|
|
83
85
|
export async function getTablesBySchemaMysql(
|
|
84
86
|
connection: MysqlPool,
|
|
85
|
-
schemaNames: string[]
|
|
87
|
+
schemaNames: string[],
|
|
86
88
|
): Promise<{ tableName: string; schemaName: string }[]> {
|
|
87
89
|
const allColumns = await Promise.all(
|
|
88
90
|
schemaNames.map(async (schema) => {
|
|
@@ -91,7 +93,7 @@ export async function getTablesBySchemaMysql(
|
|
|
91
93
|
return results.rows.map((row) => {
|
|
92
94
|
return { tableName: row.TABLE_NAME, schemaName: row.TABLE_SCHEMA };
|
|
93
95
|
});
|
|
94
|
-
})
|
|
96
|
+
}),
|
|
95
97
|
);
|
|
96
98
|
return allColumns.flat();
|
|
97
99
|
}
|
|
@@ -99,7 +101,7 @@ export async function getTablesBySchemaMysql(
|
|
|
99
101
|
export async function getColumnsByTableMysql(
|
|
100
102
|
connection: MysqlPool,
|
|
101
103
|
schemaName: string,
|
|
102
|
-
tableName: string
|
|
104
|
+
tableName: string,
|
|
103
105
|
): Promise<string[]> {
|
|
104
106
|
const sql = `SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '${schemaName}' AND TABLE_NAME = '${tableName}'`;
|
|
105
107
|
const results = await runQueryMysql(sql, connection);
|
|
@@ -110,7 +112,7 @@ export async function getForeignKeysMysql(
|
|
|
110
112
|
connection: MysqlPool,
|
|
111
113
|
schemaName: string,
|
|
112
114
|
tableName: string,
|
|
113
|
-
primaryKey: string
|
|
115
|
+
primaryKey: string,
|
|
114
116
|
): Promise<string[]> {
|
|
115
117
|
const depluralizedTableName = depluralize(tableName);
|
|
116
118
|
let sql = `SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
|
|
@@ -125,7 +127,7 @@ export async function getForeignKeysMysql(
|
|
|
125
127
|
});
|
|
126
128
|
// remove any foreignKeyStrings that are just 'id'
|
|
127
129
|
foreignKeysString = foreignKeysString.filter(
|
|
128
|
-
(key) => key !== "id" && key !== "_id_"
|
|
130
|
+
(key) => key !== "id" && key !== "_id_",
|
|
129
131
|
);
|
|
130
132
|
foreignKeysString = [...new Set(foreignKeysString)];
|
|
131
133
|
if (foreignKeysString.length === 0) {
|
|
@@ -149,7 +151,7 @@ export async function getForeignKeysMysql(
|
|
|
149
151
|
export async function getSchemaColumnInfoMysql(
|
|
150
152
|
connection: MysqlPool,
|
|
151
153
|
schemaName: string,
|
|
152
|
-
tableNames:
|
|
154
|
+
tableNames: { tableName: string; schemaName: string }[],
|
|
153
155
|
): Promise<
|
|
154
156
|
{ tableName: string; columns: { columnName: string; dataTypeID: number }[] }[]
|
|
155
157
|
> {
|
|
@@ -172,7 +174,7 @@ export async function getSchemaColumnInfoMysql(
|
|
|
172
174
|
fieldType: row.dataType,
|
|
173
175
|
})),
|
|
174
176
|
};
|
|
175
|
-
})
|
|
177
|
+
}),
|
|
176
178
|
);
|
|
177
179
|
return allColumns;
|
|
178
180
|
}
|
|
@@ -189,6 +191,10 @@ function mysqlTextDataTypeToPostgresOID(type: string): number {
|
|
|
189
191
|
return 1043;
|
|
190
192
|
case "timestamp": // date
|
|
191
193
|
return 1082;
|
|
194
|
+
case "date": // date
|
|
195
|
+
return 1082;
|
|
196
|
+
case "datetime": // date
|
|
197
|
+
return 1082;
|
|
192
198
|
default: // varchar
|
|
193
199
|
return 1043;
|
|
194
200
|
}
|
|
@@ -208,7 +214,9 @@ function mysqlDataTypeIdToPostgresType(type: number): number {
|
|
|
208
214
|
return 1043;
|
|
209
215
|
case 7: // date
|
|
210
216
|
return 1082;
|
|
211
|
-
case
|
|
217
|
+
case 10: // date
|
|
218
|
+
return 1082;
|
|
219
|
+
case 12: // date
|
|
212
220
|
return 1082;
|
|
213
221
|
default: // varchar
|
|
214
222
|
return 1043;
|
package/src/index.ts
CHANGED
|
@@ -76,13 +76,13 @@ export class Quill {
|
|
|
76
76
|
if (databaseConnectionString) {
|
|
77
77
|
credentials = getDatabaseCredentials(
|
|
78
78
|
databaseType,
|
|
79
|
-
databaseConnectionString
|
|
79
|
+
databaseConnectionString,
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
82
|
this.targetConnection = new CachedConnection(
|
|
83
83
|
databaseType,
|
|
84
84
|
credentials,
|
|
85
|
-
cache || {}
|
|
85
|
+
cache || {},
|
|
86
86
|
);
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -98,7 +98,7 @@ export class Quill {
|
|
|
98
98
|
metadata.preQueries,
|
|
99
99
|
this.targetConnection.databaseType,
|
|
100
100
|
metadata.databaseType,
|
|
101
|
-
metadata.runQueryConfig
|
|
101
|
+
metadata.runQueryConfig,
|
|
102
102
|
)
|
|
103
103
|
: {};
|
|
104
104
|
if (metadata.runQueryConfig?.overridePost) {
|
|
@@ -124,7 +124,7 @@ export class Quill {
|
|
|
124
124
|
response.queries,
|
|
125
125
|
this.targetConnection.databaseType,
|
|
126
126
|
metadata.databaseType,
|
|
127
|
-
responseMetadata.runQueryConfig
|
|
127
|
+
responseMetadata.runQueryConfig,
|
|
128
128
|
);
|
|
129
129
|
// QUICK JANKY FIX TO UPDATE METADATA AFTER GETTING MAPPED ARRAYS
|
|
130
130
|
if (results.mappedArray && responseMetadata.runQueryConfig?.arrayToMap) {
|
|
@@ -163,7 +163,7 @@ export class Quill {
|
|
|
163
163
|
queries: any[] | undefined,
|
|
164
164
|
pkDatabaseType: "postgresql" | "snowflake" | "bigquery" | "mysql",
|
|
165
165
|
databaseType?: string,
|
|
166
|
-
runQueryConfig?: AdditionalProcessing
|
|
166
|
+
runQueryConfig?: AdditionalProcessing,
|
|
167
167
|
) {
|
|
168
168
|
let results: any;
|
|
169
169
|
if (!queries) return { ...results, queryResults: [] };
|
|
@@ -182,7 +182,7 @@ export class Quill {
|
|
|
182
182
|
return { ...results, queryResults: [], mappedArray };
|
|
183
183
|
} else if (runQueryConfig?.getColumns) {
|
|
184
184
|
const queryResult = await this.targetConnection.query(
|
|
185
|
-
`${queries[0].replace(/;/, "")} limit 1
|
|
185
|
+
`${queries[0].replace(/;/, "")} limit 1`,
|
|
186
186
|
);
|
|
187
187
|
const columns = queryResult.fields.map((field: any) => {
|
|
188
188
|
return {
|
|
@@ -209,7 +209,7 @@ export class Quill {
|
|
|
209
209
|
}
|
|
210
210
|
try {
|
|
211
211
|
const queryResult = await this.targetConnection.query(
|
|
212
|
-
`${table.viewQuery.replace(/;/, "")} ${limit}
|
|
212
|
+
`${table.viewQuery.replace(/;/, "")} ${limit}`,
|
|
213
213
|
);
|
|
214
214
|
const columns = queryResult.fields.map((field: any) => {
|
|
215
215
|
return {
|
|
@@ -224,7 +224,7 @@ export class Quill {
|
|
|
224
224
|
} catch (err) {
|
|
225
225
|
return { ...table, error: "Error fetching columns" };
|
|
226
226
|
}
|
|
227
|
-
})
|
|
227
|
+
}),
|
|
228
228
|
);
|
|
229
229
|
results = { ...results, queryResults };
|
|
230
230
|
if (runQueryConfig?.fieldsToRemove) {
|
|
@@ -241,15 +241,16 @@ export class Quill {
|
|
|
241
241
|
} else if (runQueryConfig?.getTables) {
|
|
242
242
|
const queryResult = await getTablesBySchemaByDatabase(
|
|
243
243
|
this.targetConnection.databaseType,
|
|
244
|
-
this.targetConnection.
|
|
245
|
-
runQueryConfig.schemaNames! || runQueryConfig.schema
|
|
244
|
+
this.targetConnection.getPool(),
|
|
245
|
+
runQueryConfig.schemaNames! || runQueryConfig.schema,
|
|
246
246
|
);
|
|
247
247
|
const schemaInfo = await getColumnInfoBySchemaByDatabase(
|
|
248
248
|
this.targetConnection.databaseType,
|
|
249
|
-
this.targetConnection.
|
|
249
|
+
this.targetConnection.getPool(),
|
|
250
250
|
runQueryConfig.schema!,
|
|
251
|
-
queryResult
|
|
251
|
+
queryResult!,
|
|
252
252
|
);
|
|
253
|
+
this.targetConnection.close();
|
|
253
254
|
return schemaInfo;
|
|
254
255
|
} else {
|
|
255
256
|
if (runQueryConfig?.limitThousand) {
|
|
@@ -264,7 +265,7 @@ export class Quill {
|
|
|
264
265
|
const queryResults = await Promise.all(
|
|
265
266
|
queries.map(async (query) => {
|
|
266
267
|
return await this.targetConnection.query(query);
|
|
267
|
-
})
|
|
268
|
+
}),
|
|
268
269
|
);
|
|
269
270
|
results = { ...results, queryResults };
|
|
270
271
|
if (runQueryConfig?.fieldsToRemove) {
|
|
@@ -298,12 +299,12 @@ export class Quill {
|
|
|
298
299
|
|
|
299
300
|
private async postQuill(
|
|
300
301
|
path: string,
|
|
301
|
-
payload: any
|
|
302
|
+
payload: any,
|
|
302
303
|
): Promise<QuillClientResponse> {
|
|
303
304
|
const response = await axios.post(
|
|
304
305
|
`${this.baseUrl}/sdk/${path}`,
|
|
305
306
|
payload,
|
|
306
|
-
this.config
|
|
307
|
+
this.config,
|
|
307
308
|
);
|
|
308
309
|
return response.data;
|
|
309
310
|
}
|