@quillsql/node 0.5.6 → 0.5.8

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.
@@ -82,7 +82,7 @@ exports.getSchemaBigQuery = getSchemaBigQuery;
82
82
  function getTablesBySchemaBigQuery(bigQuery, schemaNames) {
83
83
  return __awaiter(this, void 0, void 0, function* () {
84
84
  const allColumns = yield Promise.all(schemaNames.map((schema) => __awaiter(this, void 0, void 0, function* () {
85
- const sql = `SELECT table_name FROM ${schema}.INFORMATION_SCHEMA.TABLES WHERE table_type = 'BASE TABLE'`;
85
+ const sql = `SELECT table_name FROM ${schema}.INFORMATION_SCHEMA.TABLES WHERE table_type = 'BASE TABLE' OR table_type = 'VIEW' OR table_type = 'MATERIALIZED VIEW'`;
86
86
  const rows = yield bigQuery.query(sql);
87
87
  return rows[0].map((row) => {
88
88
  return { tableName: row.table_name, schemaName: schema };
@@ -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,6 +24,7 @@ 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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillsql/node",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
4
4
  "description": "Quill Server SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -84,7 +84,7 @@ export async function getTablesBySchemaBigQuery(
84
84
  ): Promise<{ tableName: string; schemaName: string }[]> {
85
85
  const allColumns = await Promise.all(
86
86
  schemaNames.map(async (schema) => {
87
- const sql = `SELECT table_name FROM ${schema}.INFORMATION_SCHEMA.TABLES WHERE table_type = 'BASE TABLE'`;
87
+ const sql = `SELECT table_name FROM ${schema}.INFORMATION_SCHEMA.TABLES WHERE table_type = 'BASE TABLE' OR table_type = 'VIEW' OR table_type = 'MATERIALIZED VIEW'`;
88
88
  const rows = await bigQuery.query(sql);
89
89
  return rows[0].map((row) => {
90
90
  return { tableName: row.table_name, schemaName: schema };
package/src/db/Mysql.ts CHANGED
@@ -10,6 +10,7 @@ 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(
@@ -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
 
@@ -149,7 +151,7 @@ export async function getForeignKeysMysql(
149
151
  export async function getSchemaColumnInfoMysql(
150
152
  connection: MysqlPool,
151
153
  schemaName: string,
152
- tableNames: { tableName: string; schemaName: string }[]
154
+ tableNames: { tableName: string; schemaName: string }[]
153
155
  ): Promise<
154
156
  { tableName: string; columns: { columnName: string; dataTypeID: number }[] }[]
155
157
  > {