@lightdash/warehouses 2.470.1 → 2.472.0
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/.tsbuildinfo.build +1 -1
- package/dist/warehouseClientFromCredentials.d.ts +3 -1
- package/dist/warehouseClientFromCredentials.d.ts.map +1 -1
- package/dist/warehouseClientFromCredentials.js +6 -6
- package/dist/warehouseClients/AthenaWarehouseClient.d.ts +1 -0
- package/dist/warehouseClients/AthenaWarehouseClient.d.ts.map +1 -1
- package/dist/warehouseClients/AthenaWarehouseClient.js +1 -1
- package/dist/warehouseClients/BigqueryWarehouseClient.d.ts +4 -2
- package/dist/warehouseClients/BigqueryWarehouseClient.d.ts.map +1 -1
- package/dist/warehouseClients/BigqueryWarehouseClient.js +3 -3
- package/dist/warehouseClients/ClickhouseWarehouseClient.d.ts +1 -0
- package/dist/warehouseClients/ClickhouseWarehouseClient.d.ts.map +1 -1
- package/dist/warehouseClients/ClickhouseWarehouseClient.js +1 -1
- package/dist/warehouseClients/DatabricksWarehouseClient.d.ts +3 -1
- package/dist/warehouseClients/DatabricksWarehouseClient.d.ts.map +1 -1
- package/dist/warehouseClients/DatabricksWarehouseClient.js +2 -2
- package/dist/warehouseClients/DuckdbWarehouseClient.d.ts +1 -0
- package/dist/warehouseClients/DuckdbWarehouseClient.d.ts.map +1 -1
- package/dist/warehouseClients/DuckdbWarehouseClient.js +1 -1
- package/dist/warehouseClients/PostgresWarehouseClient.d.ts +7 -2
- package/dist/warehouseClients/PostgresWarehouseClient.d.ts.map +1 -1
- package/dist/warehouseClients/PostgresWarehouseClient.js +16 -5
- package/dist/warehouseClients/RedshiftWarehouseClient.d.ts +4 -1
- package/dist/warehouseClients/RedshiftWarehouseClient.d.ts.map +1 -1
- package/dist/warehouseClients/RedshiftWarehouseClient.js +8 -2
- package/dist/warehouseClients/SnowflakeWarehouseClient.d.ts +21 -1
- package/dist/warehouseClients/SnowflakeWarehouseClient.d.ts.map +1 -1
- package/dist/warehouseClients/SnowflakeWarehouseClient.js +119 -8
- package/dist/warehouseClients/TrinoWarehouseClient.d.ts +3 -1
- package/dist/warehouseClients/TrinoWarehouseClient.d.ts.map +1 -1
- package/dist/warehouseClients/TrinoWarehouseClient.js +10 -4
- package/dist/warehouseClients/WarehouseBaseClient.d.ts +4 -1
- package/dist/warehouseClients/WarehouseBaseClient.d.ts.map +1 -1
- package/dist/warehouseClients/WarehouseBaseClient.js +2 -1
- package/package.json +2 -2
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.SnowflakeWarehouseClient = exports.SnowflakeSqlBuilder = exports.mapFieldType = exports.getSnowflakeNumericKind = exports.SnowflakeDiagnosticError = exports.mapSnowflakeDiagnosticError = exports.snowflakeIdentifier = exports.getSnowflakeTimestampDomain = exports.SnowflakeTypes = void 0;
|
|
39
|
+
exports.SnowflakeWarehouseClient = exports.SnowflakeSqlBuilder = exports.mapFieldType = exports.getSnowflakeNumericKind = exports.SnowflakeDiagnosticError = exports.mapSnowflakeDiagnosticError = exports.snowflakeIdentifier = exports.checkSnowflakeAgentSessionWithToken = exports.checkSnowflakeAgentSession = exports.isSnowflakeAgentActivatedValue = exports.SNOWFLAKE_AGENT_SESSION_REQUIRED_MESSAGE = exports.getSnowflakeTimestampDomain = exports.SnowflakeTypes = void 0;
|
|
40
40
|
const common_1 = require("@lightdash/common");
|
|
41
41
|
const crypto = __importStar(require("crypto"));
|
|
42
42
|
const snowflake_sdk_1 = require("snowflake-sdk");
|
|
@@ -108,6 +108,91 @@ const getSnowflakeTimestampDomain = (type) => {
|
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
exports.getSnowflakeTimestampDomain = getSnowflakeTimestampDomain;
|
|
111
|
+
exports.SNOWFLAKE_AGENT_SESSION_REQUIRED_MESSAGE = 'This Snowflake sign-in is not an agent session. Ask your Snowflake admin to set IS_AGENTIC = TRUE on the security integration used for AI.';
|
|
112
|
+
const isSnowflakeAgentActivatedValue = (value) => value === true ||
|
|
113
|
+
(typeof value === 'string' && value.toUpperCase() === 'TRUE');
|
|
114
|
+
exports.isSnowflakeAgentActivatedValue = isSnowflakeAgentActivatedValue;
|
|
115
|
+
const inactiveAgentSession = () => ({
|
|
116
|
+
agentActivated: false,
|
|
117
|
+
currentRole: null,
|
|
118
|
+
activeRestrictedSessionScopes: null,
|
|
119
|
+
});
|
|
120
|
+
const disableSnowflakeCachedResult = async (connection) => new Promise((resolve, reject) => {
|
|
121
|
+
connection.execute({
|
|
122
|
+
sqlText: 'ALTER SESSION SET USE_CACHED_RESULT = FALSE',
|
|
123
|
+
complete: (error) => {
|
|
124
|
+
if (error)
|
|
125
|
+
reject(error);
|
|
126
|
+
else
|
|
127
|
+
resolve();
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
const checkSnowflakeAgentSession = async (connection, options = {}) => {
|
|
132
|
+
try {
|
|
133
|
+
const rows = await new Promise((resolve, reject) => {
|
|
134
|
+
connection.execute({
|
|
135
|
+
sqlText: "SELECT SYS_CONTEXT('SNOWFLAKE$CURRENT', 'IS_AGENT_ACTIVATED')::BOOLEAN AS IS_AGENT_ACTIVATED, CURRENT_ROLE() AS CURRENT_ROLE, SYS_CONTEXT('SNOWFLAKE$SESSION', 'ACTIVE_RESTRICTED_SESSION_SCOPES') AS ACTIVE_RESTRICTED_SESSION_SCOPES",
|
|
136
|
+
complete: (error, _statement, data) => {
|
|
137
|
+
if (error) {
|
|
138
|
+
reject(error);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
resolve(data ?? []);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
const row = rows[0];
|
|
147
|
+
if (typeof row !== 'object' || row === null)
|
|
148
|
+
return inactiveAgentSession();
|
|
149
|
+
const getValue = (key) => Object.entries(row).find(([name]) => name.toUpperCase() === key)?.[1];
|
|
150
|
+
const currentRole = getValue('CURRENT_ROLE');
|
|
151
|
+
const activeRestrictedSessionScopes = getValue('ACTIVE_RESTRICTED_SESSION_SCOPES');
|
|
152
|
+
return {
|
|
153
|
+
agentActivated: (0, exports.isSnowflakeAgentActivatedValue)(getValue('IS_AGENT_ACTIVATED')),
|
|
154
|
+
currentRole: typeof currentRole === 'string' ? currentRole : null,
|
|
155
|
+
activeRestrictedSessionScopes: typeof activeRestrictedSessionScopes === 'string'
|
|
156
|
+
? activeRestrictedSessionScopes
|
|
157
|
+
: null,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
if (options.throwOnError)
|
|
162
|
+
throw error;
|
|
163
|
+
return inactiveAgentSession();
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
exports.checkSnowflakeAgentSession = checkSnowflakeAgentSession;
|
|
167
|
+
const checkSnowflakeAgentSessionWithToken = async (account, token, options = {}) => {
|
|
168
|
+
let connection = null;
|
|
169
|
+
try {
|
|
170
|
+
connection = (0, snowflake_sdk_1.createConnection)({
|
|
171
|
+
account,
|
|
172
|
+
authenticator: 'OAUTH',
|
|
173
|
+
token,
|
|
174
|
+
});
|
|
175
|
+
await Util.promisify(connection.connect.bind(connection))();
|
|
176
|
+
const session = await (0, exports.checkSnowflakeAgentSession)(connection, options);
|
|
177
|
+
if (!session.agentActivated)
|
|
178
|
+
return session;
|
|
179
|
+
await disableSnowflakeCachedResult(connection);
|
|
180
|
+
return session;
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
if (options.throwOnError)
|
|
184
|
+
throw error;
|
|
185
|
+
return inactiveAgentSession();
|
|
186
|
+
}
|
|
187
|
+
finally {
|
|
188
|
+
if (connection) {
|
|
189
|
+
await new Promise((resolve) => {
|
|
190
|
+
connection?.destroy(() => resolve());
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
exports.checkSnowflakeAgentSessionWithToken = checkSnowflakeAgentSessionWithToken;
|
|
111
196
|
const EXTERNAL_BROWSER_AUTHENTICATOR = 'EXTERNALBROWSER';
|
|
112
197
|
const OAUTH_AUTHORIZATION_CODE_AUTHENTICATOR = 'OAUTH_AUTHORIZATION_CODE';
|
|
113
198
|
const SESSION_DISCOVERY_LIMIT = 100;
|
|
@@ -493,8 +578,9 @@ class SnowflakeWarehouseClient extends WarehouseBaseClient_1.default {
|
|
|
493
578
|
.join('')
|
|
494
579
|
.replace(/'/g, "''");
|
|
495
580
|
}
|
|
496
|
-
constructor(credentials) {
|
|
497
|
-
super(credentials, new SnowflakeSqlBuilder(credentials.startOfWeek));
|
|
581
|
+
constructor(credentials, options) {
|
|
582
|
+
super(credentials, new SnowflakeSqlBuilder(credentials.startOfWeek), options);
|
|
583
|
+
this.logger = options?.logger;
|
|
498
584
|
if (typeof credentials.quotedIdentifiersIgnoreCase !== 'undefined') {
|
|
499
585
|
this.quotedIdentifiersIgnoreCase =
|
|
500
586
|
credentials.quotedIdentifiersIgnoreCase;
|
|
@@ -588,10 +674,34 @@ class SnowflakeWarehouseClient extends WarehouseBaseClient_1.default {
|
|
|
588
674
|
console.info(`Initialized snowflake warehouse client with "requireUserCredentials" authentication type "${credentials.authenticationType}" and connection options: ${JSON.stringify(logConnectionOptions)}`);
|
|
589
675
|
}
|
|
590
676
|
async getConnection(connectionOptionsOverrides) {
|
|
591
|
-
|
|
592
|
-
|
|
677
|
+
const connection = this.isInteractiveAuthenticator()
|
|
678
|
+
? await this.createInteractiveConnection(connectionOptionsOverrides)
|
|
679
|
+
: await this.createConnection(connectionOptionsOverrides);
|
|
680
|
+
if (this.credentials.requireAgentSession) {
|
|
681
|
+
const session = await (0, exports.checkSnowflakeAgentSession)(connection);
|
|
682
|
+
if (!session.agentActivated) {
|
|
683
|
+
await this.destroyRejectedAgentConnection(connection);
|
|
684
|
+
throw new common_1.ForbiddenError(exports.SNOWFLAKE_AGENT_SESSION_REQUIRED_MESSAGE);
|
|
685
|
+
}
|
|
686
|
+
this.logger?.info('Snowflake agent session activated', {
|
|
687
|
+
currentRole: session.currentRole,
|
|
688
|
+
activeRestrictedSessionScopes: session.activeRestrictedSessionScopes,
|
|
689
|
+
});
|
|
690
|
+
try {
|
|
691
|
+
await disableSnowflakeCachedResult(connection);
|
|
692
|
+
}
|
|
693
|
+
catch {
|
|
694
|
+
await this.destroyRejectedAgentConnection(connection);
|
|
695
|
+
throw new common_1.ForbiddenError(exports.SNOWFLAKE_AGENT_SESSION_REQUIRED_MESSAGE);
|
|
696
|
+
}
|
|
593
697
|
}
|
|
594
|
-
return
|
|
698
|
+
return connection;
|
|
699
|
+
}
|
|
700
|
+
async destroyRejectedAgentConnection(connection) {
|
|
701
|
+
this.interactiveConnectionPromise = undefined;
|
|
702
|
+
await new Promise((resolve) => {
|
|
703
|
+
connection.destroy(() => resolve());
|
|
704
|
+
});
|
|
595
705
|
}
|
|
596
706
|
isInteractiveAuthenticator() {
|
|
597
707
|
return (this.connectionOptions.authenticator ===
|
|
@@ -667,11 +777,12 @@ class SnowflakeWarehouseClient extends WarehouseBaseClient_1.default {
|
|
|
667
777
|
}
|
|
668
778
|
async openDiagnosticConnection() {
|
|
669
779
|
try {
|
|
670
|
-
const connection =
|
|
671
|
-
await Util.promisify(connection.connect.bind(connection))();
|
|
780
|
+
const connection = await this.getConnection();
|
|
672
781
|
return { connection };
|
|
673
782
|
}
|
|
674
783
|
catch (error) {
|
|
784
|
+
if (error instanceof common_1.ForbiddenError)
|
|
785
|
+
throw error;
|
|
675
786
|
throw new SnowflakeDiagnosticError(error);
|
|
676
787
|
}
|
|
677
788
|
}
|
|
@@ -52,7 +52,9 @@ export declare class TrinoSqlBuilder extends WarehouseBaseSqlBuilder {
|
|
|
52
52
|
}
|
|
53
53
|
export declare class TrinoWarehouseClient extends WarehouseBaseClient<CreateTrinoCredentials> {
|
|
54
54
|
connectionOptions: ConnectionOptions;
|
|
55
|
-
constructor(credentials: CreateTrinoCredentials
|
|
55
|
+
constructor(credentials: CreateTrinoCredentials, options?: {
|
|
56
|
+
agentSession?: boolean;
|
|
57
|
+
});
|
|
56
58
|
private getSession;
|
|
57
59
|
streamQuery(sql: string, streamCallback: (data: WarehouseResults) => void | Promise<void>, options: {
|
|
58
60
|
tags?: Record<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrinoWarehouseClient.d.ts","sourceRoot":"","sources":["../../src/warehouseClients/TrinoWarehouseClient.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"TrinoWarehouseClient.d.ts","sourceRoot":"","sources":["../../src/warehouseClients/TrinoWarehouseClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,sBAAsB,EAGtB,MAAM,EAIN,mBAAmB,EACnB,gBAAgB,EAGhB,gBAAgB,EAChB,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEH,iBAAiB,EAKpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAO5C,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAiBhE,oBAAY,UAAU;IAClB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,wBAAwB;IAC/B,SAAS,cAAc;IACvB,YAAY,6BAA6B;IACzC,mBAAmB,2BAA2B;IAC9C,iBAAiB,2BAA2B;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,EAcvC;YAEa,UAAU;IAkBlB,WAAW,CACb,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAChE,OAAO,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;KACrB,GACF,OAAO,CAAC,IAAI,CAAC,CAiIf;IAEK,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA0BjE;IAED,OAAO,CAAC,aAAa;IAQf,SAAS,CACX,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,OAAO,CAAC,gBAAgB,CAAC,CA2B3B;IAEK,YAAY;;;;;SAqBjB;CACJ"}
|
|
@@ -227,8 +227,8 @@ class TrinoSqlBuilder extends WarehouseBaseSqlBuilder_1.default {
|
|
|
227
227
|
}
|
|
228
228
|
exports.TrinoSqlBuilder = TrinoSqlBuilder;
|
|
229
229
|
class TrinoWarehouseClient extends WarehouseBaseClient_1.default {
|
|
230
|
-
constructor(credentials) {
|
|
231
|
-
super(credentials, new TrinoSqlBuilder(credentials.startOfWeek));
|
|
230
|
+
constructor(credentials, options) {
|
|
231
|
+
super(credentials, new TrinoSqlBuilder(credentials.startOfWeek), options);
|
|
232
232
|
this.connectionOptions = {
|
|
233
233
|
auth: new trino_client_1.BasicAuth(credentials.user, credentials.password),
|
|
234
234
|
catalog: credentials.dbname,
|
|
@@ -276,13 +276,19 @@ class TrinoWarehouseClient extends WarehouseBaseClient_1.default {
|
|
|
276
276
|
}
|
|
277
277
|
} while (!timezoneResult.done);
|
|
278
278
|
}
|
|
279
|
-
query = await session.query(options?.tags
|
|
279
|
+
query = await session.query(options?.tags || this.agentSession
|
|
280
280
|
? {
|
|
281
281
|
query: alteredQuery,
|
|
282
282
|
extraHeaders: {
|
|
283
|
-
[TRINO_CLIENT_TAGS_HEADER]: Object.entries(options.tags)
|
|
283
|
+
[TRINO_CLIENT_TAGS_HEADER]: Object.entries(options.tags ?? {})
|
|
284
284
|
.map(([key, value]) => `${sanitizeClientTag(key)}=${sanitizeClientTag(value)}`)
|
|
285
285
|
.join(','),
|
|
286
|
+
...(this.agentSession
|
|
287
|
+
? {
|
|
288
|
+
'X-Trino-Extra-Credential': 'agent=true',
|
|
289
|
+
'User-Agent': common_1.AI_AGENT_APPLICATION_NAME,
|
|
290
|
+
}
|
|
291
|
+
: {}),
|
|
286
292
|
},
|
|
287
293
|
}
|
|
288
294
|
: alteredQuery);
|
|
@@ -3,7 +3,10 @@ import { type WarehouseClient } from '../types';
|
|
|
3
3
|
export default abstract class WarehouseBaseClient<T extends CreateWarehouseCredentials> implements WarehouseClient {
|
|
4
4
|
credentials: T;
|
|
5
5
|
protected sqlBuilder: WarehouseSqlBuilder;
|
|
6
|
-
protected
|
|
6
|
+
protected readonly agentSession: boolean;
|
|
7
|
+
protected constructor(credentials: T, sqlBuilder: WarehouseSqlBuilder, options?: {
|
|
8
|
+
agentSession?: boolean;
|
|
9
|
+
});
|
|
7
10
|
getAdapterType(): SupportedDbtAdapter;
|
|
8
11
|
supportsCteMaterialization(): boolean;
|
|
9
12
|
getStringQuoteChar(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WarehouseBaseClient.d.ts","sourceRoot":"","sources":["../../src/warehouseClients/WarehouseBaseClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,OAAO,EACP,0BAA0B,EAC1B,aAAa,EACb,MAAM,EAEN,mBAAmB,EACnB,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,wBAAwB,EAExB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe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AC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,wBAAwB,CAAC,CAInC;IAEK,oBAAoB,CACtB,SAAS,EAAE,uBAAuB,EAClC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,eAAe,CAAC,CAI1B;IAED,qBAAqB,CACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC/B,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,aAAa,EAC7C,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,eAAe,GAAG,SAAS,GACnE,gBAAgB,CAiClB;IAED,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAE9B;IAED,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElC;IAED,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAElC;IAED,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE7B;IAED,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAEvC;IAED,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAE5D;IAED,uBAAuB,CACnB,iBAAiB,EAAE,MAAM,EACzB,eAAe,EAAE,MAAM,GACxB,MAAM,CAKR;IAED,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErC;CACJ"}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const common_1 = require("@lightdash/common");
|
|
4
4
|
class WarehouseBaseClient {
|
|
5
|
-
constructor(credentials, sqlBuilder) {
|
|
5
|
+
constructor(credentials, sqlBuilder, options) {
|
|
6
|
+
this.agentSession = options?.agentSession ?? false;
|
|
6
7
|
this.credentials = credentials;
|
|
7
8
|
this.sqlBuilder = sqlBuilder;
|
|
8
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightdash/warehouses",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.472.0",
|
|
4
4
|
"description": "Warehouse connectors for Lightdash",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@databricks/sql": "1.13.0",
|
|
22
22
|
"@duckdb/node-api": "1.5.2-r.2",
|
|
23
23
|
"@google-cloud/bigquery": "8.3.1",
|
|
24
|
-
"@lightdash/common": "2.
|
|
24
|
+
"@lightdash/common": "2.472.0",
|
|
25
25
|
"node-fetch": "2.7.0",
|
|
26
26
|
"pg": "8.13.1",
|
|
27
27
|
"pg-cursor": "2.10.0",
|