@quillsql/node 0.9.18 → 0.9.20

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,13 +1,23 @@
1
1
  export interface Mappable {
2
2
  get(key: string): Promise<string | null>;
3
- set(key: string, value: string, type?: string, ttl?: number): Promise<string | null>;
4
- set(key: string, value: string, options: {
3
+ set(key: string, value: string, type?: string | {
5
4
  NX?: boolean;
6
5
  XX?: boolean;
7
6
  EX?: number;
8
7
  PX?: number;
9
- }): Promise<string | null>;
10
- del(key: string): Promise<number>;
8
+ }, ttl?: number): Promise<string | null>;
9
+ lRange(key: string, start: number, stop: number): Promise<string[]>;
10
+ rPush(key: string, ...elements: string[]): Promise<number>;
11
+ expire(key: string, seconds: number): Promise<number | boolean>;
12
+ del(...keys: string[]): Promise<number>;
13
+ multi(): CacheTransaction;
14
+ }
15
+ export interface CacheTransaction {
16
+ del(...keys: string[]): CacheTransaction;
17
+ rPush(key: string, ...elements: string[]): CacheTransaction;
18
+ expire(key: string, seconds: number): CacheTransaction;
19
+ set(key: string, value: string, type?: string, ttl?: number): CacheTransaction;
20
+ exec(): Promise<unknown>;
11
21
  }
12
22
  export interface CacheCredentials {
13
23
  username: string;
@@ -1,11 +1,12 @@
1
1
  import { Mappable, CacheCredentials } from "../models/Cache";
2
2
  import { DatabaseConnection, DatabaseConnectionConfig, DatabaseConnectionType } from "./DatabaseHelper";
3
3
  export declare class CachedConnection {
4
+ private static sharedRedisClients;
4
5
  databaseType: DatabaseConnectionType;
5
6
  readonly pool: DatabaseConnection;
7
+ tenantIds: (string | number)[] | null;
6
8
  ttl: number;
7
9
  cache: Mappable | null;
8
- isCacheJobRunning: boolean;
9
10
  private _isClosed;
10
11
  get isClosed(): boolean;
11
12
  /** Private constructor; use CachedConnection.create(...) */
@@ -13,6 +14,9 @@ export declare class CachedConnection {
13
14
  /** Async factory initializer */
14
15
  static create(databaseType: DatabaseConnectionType, config: DatabaseConnectionConfig, cacheConfig?: Partial<CacheCredentials>): Promise<CachedConnection>;
15
16
  query(text: string, overwriteCache?: boolean): Promise<any>;
17
+ getCachedValue(key: string): Promise<string | null>;
18
+ setCachedValue(key: string, value: string): Promise<void>;
19
+ deleteCachedValue(key: string): Promise<void>;
16
20
  /**
17
21
  * Configures and returns a cache instance or null if none could be created.
18
22
  */
@@ -19,7 +19,7 @@ export class CachedConnection {
19
19
  /** Private constructor; use CachedConnection.create(...) */
20
20
  constructor(databaseType, config, cacheConfig = {}) {
21
21
  var _a;
22
- this.isCacheJobRunning = false;
22
+ this.tenantIds = null;
23
23
  this._isClosed = false;
24
24
  this.databaseType = databaseType;
25
25
  this.pool = connectToDatabase(databaseType, config);
@@ -43,27 +43,27 @@ export class CachedConnection {
43
43
  if (!this.cache) {
44
44
  return yield runQueryByDatabase(this.databaseType, this.pool, text);
45
45
  }
46
- // `text` must be a tenant-scoped SQL query.
47
- // Since runQueryByDatabase doesn't receive tenant information from any
48
- // of its other parameters
49
- const key = text;
50
46
  if (!overwriteCache) {
51
- let cachedResult = yield this.cache.get(key);
52
- if (cachedResult)
53
- return JSON.parse(cachedResult);
47
+ try {
48
+ const cached = yield this.cache.get(text);
49
+ if (cached)
50
+ return JSON.parse(cached);
51
+ }
52
+ catch (_a) {
53
+ // cache read fail. corrupted
54
+ }
55
+ }
56
+ const newResult = yield runQueryByDatabase(this.databaseType, this.pool, text);
57
+ if (!newResult) {
58
+ return newResult;
54
59
  }
55
- const result = yield runQueryByDatabase(this.databaseType, this.pool, text);
56
60
  try {
57
- yield this.cache.set(key, JSON.stringify(result), "EX", this.ttl);
61
+ yield this.cache.set(text, JSON.stringify(newResult));
58
62
  }
59
63
  catch (error) {
60
- const message = "Redis Cache Set Failed: " + String(error);
61
- if (this.isCacheJobRunning) {
62
- throw new Error(message);
63
- }
64
- console.warn(message); // This runs for general data fetching by customers
64
+ console.warn("Redis Cache Set Failed: ", error);
65
65
  }
66
- return result;
66
+ return newResult;
67
67
  }
68
68
  catch (err) {
69
69
  if (isSuperset(err, PgError)) {
@@ -75,22 +75,56 @@ export class CachedConnection {
75
75
  }
76
76
  });
77
77
  }
78
+ getCachedValue(key) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ if (!this.cache || this.isClosed)
81
+ return null;
82
+ return yield this.cache.get(key);
83
+ });
84
+ }
85
+ setCachedValue(key, value) {
86
+ return __awaiter(this, void 0, void 0, function* () {
87
+ if (!this.cache || this.isClosed)
88
+ return;
89
+ yield this.cache.set(key, value, "EX", this.ttl);
90
+ });
91
+ }
92
+ deleteCachedValue(key) {
93
+ return __awaiter(this, void 0, void 0, function* () {
94
+ if (!this.cache || this.isClosed)
95
+ return;
96
+ yield this.cache.del(key);
97
+ });
98
+ }
78
99
  /**
79
100
  * Configures and returns a cache instance or null if none could be created.
80
101
  */
81
102
  getCache(_a) {
82
103
  return __awaiter(this, arguments, void 0, function* ({ username, password, host, port, cacheType, }) {
83
104
  if (cacheType === "redis" || cacheType === "rediss") {
105
+ const sharedKey = JSON.stringify({
106
+ cacheType,
107
+ username: username || "",
108
+ password: password || "",
109
+ host: host || "",
110
+ port: port || "",
111
+ });
112
+ const existingClient = CachedConnection.sharedRedisClients.get(sharedKey);
113
+ if (existingClient) {
114
+ return existingClient;
115
+ }
84
116
  const client = createClient({
85
- username: username || '',
86
- password: password || '',
117
+ username: username || "",
118
+ password: password || "",
87
119
  socket: {
88
- host: host || '',
89
- port: port ? parseInt(port) : 0
120
+ host: host || "",
121
+ port: port ? parseInt(port) : 0,
90
122
  },
91
123
  });
92
124
  client.on("error", (err) => console.log("Redis Client Error", err));
93
125
  yield client.connect();
126
+ console.log("Redis connected to host:", host);
127
+ CachedConnection.sharedRedisClients.set(sharedKey, client);
94
128
  return client;
95
129
  }
96
130
  return null;
@@ -106,4 +140,5 @@ export class CachedConnection {
106
140
  });
107
141
  }
108
142
  }
143
+ CachedConnection.sharedRedisClients = new Map();
109
144
  //# sourceMappingURL=CachedConnection.js.map
@@ -1 +1 @@
1
- {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GAAG,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;gBAC1E,IAAI,cAAc,EAAE,CAAC;oBACnB,OAAO,cAAc,CAAC;gBACxB,CAAC;gBAED,MAAM,MAAM,GAAG,YAAY,CAAC;oBAC1B,QAAQ,EAAE,QAAQ,IAAI,EAAE;oBACxB,QAAQ,EAAE,QAAQ,IAAI,EAAE;oBACxB,MAAM,EAAE;wBACN,IAAI,EAAE,IAAI,IAAI,EAAE;wBAChB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;qBAChC;iBACF,CAAC,CAAC;gBACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC,CAAC;gBAEpE,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;gBACvB,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,IAAI,CAAC,CAAA;gBAC7C,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,CAAC,SAAS,EAAE,MAAkB,CAAC,CAAC;gBACvE,OAAO,MAAkB,CAAC;YAC5B,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEK,KAAK;;YACT,sBAAsB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACrD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACxB,CAAC;KAAA;;AArJc,mCAAkB,GAAG,IAAI,GAAG,EAAoB,AAA9B,CAA+B"}
@@ -19,21 +19,6 @@ export interface QuillQueryResult {
19
19
  fields: any[];
20
20
  };
21
21
  }
22
- export type QuillCacheResult = {
23
- status: "failed";
24
- error: string;
25
- } | {
26
- status: "complete";
27
- cachedDashboards: string[];
28
- failedDashboards: string[];
29
- };
30
- export interface QuillCacheParams {
31
- tenants: QuillQueryParams["tenants"];
32
- dashboards?: string[];
33
- signal?: AbortSignal;
34
- parallelQueries?: number;
35
- maxRowsPerReport?: number;
36
- }
37
22
  export type QuillStreamEvent = {
38
23
  type: "start";
39
24
  } | {
@@ -89,7 +74,6 @@ export declare class Quill implements AsyncDisposable {
89
74
  private baseUrl;
90
75
  private config;
91
76
  private initPromise;
92
- private lock;
93
77
  constructor(data: {
94
78
  privateKey: string;
95
79
  databaseType: "snowflake";
@@ -123,7 +107,9 @@ export declare class Quill implements AsyncDisposable {
123
107
  metadataServerURL?: string;
124
108
  });
125
109
  private ensureReady;
126
- cache({ tenants, dashboards, signal, parallelQueries, maxRowsPerReport, }: QuillCacheParams): Promise<QuillCacheResult>;
110
+ private getTenantMappedFlagsCacheKey;
111
+ private getTenantMappedFlagsFromCache;
112
+ private setTenantMappedFlagsCache;
127
113
  query({ tenants, flags, metadata, filters, adminEnabled, }: QuillQueryParams): Promise<QuillQueryResult>;
128
114
  stream({ tenants, flags, metadata, filters, adminEnabled, signal, }: QuillStreamOptions): Promise<AsyncIterable<QuillStreamEvent>>;
129
115
  private applyLimit;