@quillsql/node 0.4.4 → 0.4.6

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.
@@ -1,5 +1,6 @@
1
1
  import { Mapable, CacheCredentials } from "../models/Cache";
2
- import { DatabaseConnection, DatabaseType } from "./DatabaseHelper";
2
+ import { DatabaseConnection } from "./DatabaseHelper";
3
+ import { DatabaseType } from "..";
3
4
  export declare class CachedConnection {
4
5
  databaseType: DatabaseType;
5
6
  pool: DatabaseConnection;
@@ -6,12 +6,7 @@ import { PostgresConnectionConfig } from "./Postgres";
6
6
  import { SnowflakeConnectionConfig } from "./Snowflake";
7
7
  import { BigQueryConfig } from "./BigQuery";
8
8
  import { MysqlConnectionConfig } from "./Mysql";
9
- export declare enum DatabaseType {
10
- postgresql = "postgresql",
11
- snowflake = "snowflake",
12
- bigquery = "bigquery",
13
- mysql = "mysql"
14
- }
9
+ import { DatabaseType } from "..";
15
10
  export type DatabaseConnection = Pool | snowflake.Connection | BigQuery | MysqlPool;
16
11
  export interface QuillQueryResults {
17
12
  fields: {
@@ -9,18 +9,11 @@ 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.runQueryByDatabase = exports.connectToDatabase = exports.getDatabaseCredentials = exports.DatabaseType = void 0;
12
+ exports.getColumnInfoBySchemaByDatabase = exports.getForiegnKeysByDatabase = exports.getColumnsByTableByDatabase = exports.getTablesBySchemaByDatabase = exports.getSchemasByDatabase = exports.disconnectFromDatabase = exports.runQueryByDatabase = 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");
16
16
  const Mysql_1 = require("./Mysql");
17
- var DatabaseType;
18
- (function (DatabaseType) {
19
- DatabaseType["postgresql"] = "postgresql";
20
- DatabaseType["snowflake"] = "snowflake";
21
- DatabaseType["bigquery"] = "bigquery";
22
- DatabaseType["mysql"] = "mysql";
23
- })(DatabaseType || (exports.DatabaseType = DatabaseType = {}));
24
17
  function getDatabaseCredentials(databaseType, connectionString) {
25
18
  switch (databaseType.toLowerCase()) {
26
19
  case "postgres":
package/dist/index.d.ts CHANGED
@@ -2,7 +2,6 @@ import { CacheCredentials } from "./models/Cache";
2
2
  import { QuillQueryParams } from "./models/Quill";
3
3
  import { CachedConnection } from "./db/CachedConnection";
4
4
  import "dotenv/config";
5
- import { DatabaseType } from "./db/DatabaseHelper";
6
5
  /**
7
6
  * Quill - Fullstack API Platform for Dashboards and Reporting.
8
7
  */
@@ -15,6 +14,12 @@ export interface QuillQueryResult {
15
14
  fields: any[];
16
15
  };
17
16
  }
17
+ export declare enum DatabaseType {
18
+ postgresql = "postgresql",
19
+ snowflake = "snowflake",
20
+ bigquery = "bigquery",
21
+ mysql = "mysql"
22
+ }
18
23
  export default class QuillClass {
19
24
  targetConnection: CachedConnection;
20
25
  private baseUrl;
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.DatabaseType = void 0;
15
16
  const CachedConnection_1 = require("./db/CachedConnection");
16
17
  const axios_1 = __importDefault(require("axios"));
17
18
  require("dotenv/config");
@@ -21,6 +22,13 @@ const schemaConversion_1 = require("./utils/schemaConversion");
21
22
  const HOST = process.env.ENV === "development"
22
23
  ? "http://localhost:8080"
23
24
  : "https://quill-344421.uc.r.appspot.com";
25
+ var DatabaseType;
26
+ (function (DatabaseType) {
27
+ DatabaseType["postgresql"] = "postgresql";
28
+ DatabaseType["snowflake"] = "snowflake";
29
+ DatabaseType["bigquery"] = "bigquery";
30
+ DatabaseType["mysql"] = "mysql";
31
+ })(DatabaseType || (exports.DatabaseType = DatabaseType = {}));
24
32
  class QuillClass {
25
33
  constructor(data) {
26
34
  const { privateKey, databaseType, databaseConnectionString, databaseConfig, cache, metadataServerURL, } = data;
@@ -188,4 +196,4 @@ module.exports.getColumnInfoBySchemaByDatabase =
188
196
  DatabaseHelper_1.getColumnInfoBySchemaByDatabase;
189
197
  module.exports.connectToDatabase = DatabaseHelper_1.connectToDatabase;
190
198
  module.exports.runQueryByDatabase = DatabaseHelper_1.runQueryByDatabase;
191
- module.exports.DatabaseType = DatabaseHelper_1.DatabaseType;
199
+ module.exports.DatabaseType = DatabaseType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillsql/node",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "Quill's client SDK for node backends.",
5
5
  "main": "dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -5,11 +5,11 @@ import { createClient } from "redis";
5
5
  import { isSuperset } from "../utils/Error";
6
6
  import {
7
7
  DatabaseConnection,
8
- DatabaseType,
9
8
  connectToDatabase,
10
9
  disconnectFromDatabase,
11
10
  runQueryByDatabase,
12
11
  } from "./DatabaseHelper";
12
+ import { DatabaseType } from "..";
13
13
 
14
14
  class PgError extends Error {
15
15
  code?: string;
@@ -50,13 +50,7 @@ import {
50
50
  getSchemaColumnInfoMysql,
51
51
  getSchemasMysql,
52
52
  } from "./Mysql";
53
-
54
- export enum DatabaseType {
55
- postgresql = "postgresql",
56
- snowflake = "snowflake",
57
- bigquery = "bigquery",
58
- mysql = "mysql",
59
- }
53
+ import { DatabaseType } from "..";
60
54
 
61
55
  // export all database connections types
62
56
  export type DatabaseConnection =
package/src/index.ts CHANGED
@@ -10,7 +10,6 @@ import axios from "axios";
10
10
  import "dotenv/config";
11
11
  import { mapQueries, removeFields } from "./utils/RunQueryProcesses";
12
12
  import {
13
- DatabaseType,
14
13
  connectToDatabase,
15
14
  getColumnInfoBySchemaByDatabase,
16
15
  getColumnsByTableByDatabase,
@@ -38,6 +37,13 @@ export interface QuillQueryResult {
38
37
  queries?: { rows: any[]; fields: any[] };
39
38
  }
40
39
 
40
+ export enum DatabaseType {
41
+ postgresql = "postgresql",
42
+ snowflake = "snowflake",
43
+ bigquery = "bigquery",
44
+ mysql = "mysql",
45
+ }
46
+
41
47
  export default class QuillClass {
42
48
  // Configure cached connection pools with the given config.
43
49
  public targetConnection;
@@ -296,4 +302,4 @@ module.exports.getColumnInfoBySchemaByDatabase =
296
302
  getColumnInfoBySchemaByDatabase;
297
303
  module.exports.connectToDatabase = connectToDatabase;
298
304
  module.exports.runQueryByDatabase = runQueryByDatabase;
299
- module.exports.DatabaseType = DatabaseType;
305
+ module.exports.DatabaseType = DatabaseType;