@deepnote/database-integrations 1.0.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/README.md +221 -0
- package/dist/index.cjs +734 -0
- package/dist/index.d.cts +398 -0
- package/dist/index.d.ts +398 -0
- package/dist/index.js +696 -0
- package/package.json +42 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/database-integration-types.d.ts
|
|
4
|
+
declare const sqlIntegrationTypes: readonly ["alloydb", "athena", "big-query", "clickhouse", "databricks", "dremio", "mariadb", "materialize", "mindsdb", "mysql", "pandas-dataframe", "pgsql", "redshift", "snowflake", "spanner", "sql-server", "trino"];
|
|
5
|
+
type SqlIntegrationType = (typeof sqlIntegrationTypes)[number];
|
|
6
|
+
declare const databaseIntegrationTypes: readonly ["alloydb", "athena", "big-query", "clickhouse", "databricks", "dremio", "mariadb", "materialize", "mindsdb", "mysql", "pandas-dataframe", "pgsql", "redshift", "snowflake", "spanner", "sql-server", "trino", "mongodb"];
|
|
7
|
+
type DatabaseIntegrationType = (typeof databaseIntegrationTypes)[number];
|
|
8
|
+
declare const databaseIntegrationTypesWithSslSupport: readonly ["clickhouse", "dremio", "mariadb", "mindsdb", "mongodb", "mysql", "pgsql", "redshift", "trino"];
|
|
9
|
+
type DatabaseIntegrationTypeWithSslSupport = (typeof databaseIntegrationTypesWithSslSupport)[number];
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/database-integration-metadata-schemas.d.ts
|
|
12
|
+
declare const databaseMetadataSchemasByType: {
|
|
13
|
+
readonly alloydb: z.ZodObject<{
|
|
14
|
+
host: z.ZodString;
|
|
15
|
+
user: z.ZodString;
|
|
16
|
+
password: z.ZodString;
|
|
17
|
+
database: z.ZodString;
|
|
18
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
20
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
21
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
22
|
+
port: z.ZodOptional<z.ZodString>;
|
|
23
|
+
sslEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
caCertificateName: z.ZodOptional<z.ZodString>;
|
|
25
|
+
caCertificateText: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
readonly athena: z.ZodObject<{
|
|
28
|
+
access_key_id: z.ZodString;
|
|
29
|
+
region: z.ZodString;
|
|
30
|
+
s3_output_path: z.ZodString;
|
|
31
|
+
secret_access_key: z.ZodString;
|
|
32
|
+
workgroup: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
readonly 'big-query': z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
35
|
+
authMethod: z.ZodLiteral<"service-account">;
|
|
36
|
+
service_account: z.ZodString;
|
|
37
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
38
|
+
authMethod: z.ZodLiteral<"google-oauth">;
|
|
39
|
+
project: z.ZodString;
|
|
40
|
+
clientId: z.ZodString;
|
|
41
|
+
clientSecret: z.ZodString;
|
|
42
|
+
}, z.core.$strip>], "authMethod">;
|
|
43
|
+
readonly clickhouse: z.ZodObject<{
|
|
44
|
+
host: z.ZodString;
|
|
45
|
+
user: z.ZodString;
|
|
46
|
+
password: z.ZodOptional<z.ZodString>;
|
|
47
|
+
database: z.ZodString;
|
|
48
|
+
port: z.ZodOptional<z.ZodString>;
|
|
49
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
51
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
52
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
53
|
+
sslEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
caCertificateName: z.ZodOptional<z.ZodString>;
|
|
55
|
+
caCertificateText: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
readonly databricks: z.ZodObject<{
|
|
58
|
+
host: z.ZodString;
|
|
59
|
+
httpPath: z.ZodString;
|
|
60
|
+
token: z.ZodString;
|
|
61
|
+
port: z.ZodString;
|
|
62
|
+
schema: z.ZodOptional<z.ZodString>;
|
|
63
|
+
catalog: z.ZodOptional<z.ZodString>;
|
|
64
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
66
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
67
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
readonly dremio: z.ZodObject<{
|
|
70
|
+
schema: z.ZodString;
|
|
71
|
+
host: z.ZodString;
|
|
72
|
+
port: z.ZodString;
|
|
73
|
+
token: z.ZodString;
|
|
74
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
76
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
77
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
readonly mariadb: z.ZodObject<{
|
|
80
|
+
host: z.ZodString;
|
|
81
|
+
user: z.ZodString;
|
|
82
|
+
password: z.ZodString;
|
|
83
|
+
database: z.ZodString;
|
|
84
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
86
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
87
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
88
|
+
port: z.ZodOptional<z.ZodString>;
|
|
89
|
+
caCertificateName: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
readonly materialize: z.ZodObject<{
|
|
92
|
+
host: z.ZodString;
|
|
93
|
+
user: z.ZodString;
|
|
94
|
+
password: z.ZodString;
|
|
95
|
+
database: z.ZodString;
|
|
96
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
98
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
99
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
100
|
+
port: z.ZodOptional<z.ZodString>;
|
|
101
|
+
sslEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
caCertificateName: z.ZodOptional<z.ZodString>;
|
|
103
|
+
caCertificateText: z.ZodOptional<z.ZodString>;
|
|
104
|
+
cluster: z.ZodString;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
readonly mindsdb: z.ZodObject<{
|
|
107
|
+
host: z.ZodString;
|
|
108
|
+
user: z.ZodString;
|
|
109
|
+
password: z.ZodString;
|
|
110
|
+
database: z.ZodString;
|
|
111
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
112
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
113
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
114
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
115
|
+
port: z.ZodOptional<z.ZodString>;
|
|
116
|
+
caCertificateName: z.ZodOptional<z.ZodString>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
readonly mongodb: z.ZodObject<{
|
|
119
|
+
connection_string: z.ZodString;
|
|
120
|
+
rawConnectionString: z.ZodOptional<z.ZodString>;
|
|
121
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
122
|
+
host: z.ZodOptional<z.ZodString>;
|
|
123
|
+
port: z.ZodOptional<z.ZodString>;
|
|
124
|
+
user: z.ZodOptional<z.ZodString>;
|
|
125
|
+
password: z.ZodOptional<z.ZodString>;
|
|
126
|
+
database: z.ZodOptional<z.ZodString>;
|
|
127
|
+
options: z.ZodOptional<z.ZodString>;
|
|
128
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
129
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
130
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
131
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
132
|
+
sslEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
133
|
+
caCertificateName: z.ZodOptional<z.ZodString>;
|
|
134
|
+
caCertificateText: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
readonly mysql: z.ZodObject<{
|
|
137
|
+
host: z.ZodString;
|
|
138
|
+
user: z.ZodString;
|
|
139
|
+
password: z.ZodString;
|
|
140
|
+
database: z.ZodString;
|
|
141
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
143
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
144
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
145
|
+
port: z.ZodOptional<z.ZodString>;
|
|
146
|
+
caCertificateName: z.ZodOptional<z.ZodString>;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
readonly 'pandas-dataframe': z.ZodObject<{}, z.core.$strip>;
|
|
149
|
+
readonly pgsql: z.ZodObject<{
|
|
150
|
+
host: z.ZodString;
|
|
151
|
+
user: z.ZodString;
|
|
152
|
+
password: z.ZodString;
|
|
153
|
+
database: z.ZodString;
|
|
154
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
155
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
156
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
157
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
158
|
+
port: z.ZodOptional<z.ZodString>;
|
|
159
|
+
sslEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
160
|
+
caCertificateName: z.ZodOptional<z.ZodString>;
|
|
161
|
+
caCertificateText: z.ZodOptional<z.ZodString>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
readonly redshift: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
164
|
+
database: z.ZodString;
|
|
165
|
+
host: z.ZodString;
|
|
166
|
+
port: z.ZodOptional<z.ZodString>;
|
|
167
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
168
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
169
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
170
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
171
|
+
sslEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
+
caCertificateName: z.ZodOptional<z.ZodString>;
|
|
173
|
+
caCertificateText: z.ZodOptional<z.ZodString>;
|
|
174
|
+
authMethod: z.ZodLiteral<"username-and-password">;
|
|
175
|
+
user: z.ZodString;
|
|
176
|
+
password: z.ZodString;
|
|
177
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
178
|
+
database: z.ZodString;
|
|
179
|
+
host: z.ZodString;
|
|
180
|
+
port: z.ZodOptional<z.ZodString>;
|
|
181
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
183
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
184
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
185
|
+
sslEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
186
|
+
caCertificateName: z.ZodOptional<z.ZodString>;
|
|
187
|
+
caCertificateText: z.ZodOptional<z.ZodString>;
|
|
188
|
+
authMethod: z.ZodLiteral<"iam-role">;
|
|
189
|
+
roleArn: z.ZodString;
|
|
190
|
+
roleExternalId: z.ZodString;
|
|
191
|
+
roleNonce: z.ZodString;
|
|
192
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
193
|
+
database: z.ZodString;
|
|
194
|
+
host: z.ZodString;
|
|
195
|
+
port: z.ZodOptional<z.ZodString>;
|
|
196
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
197
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
198
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
199
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
200
|
+
sslEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
201
|
+
caCertificateName: z.ZodOptional<z.ZodString>;
|
|
202
|
+
caCertificateText: z.ZodOptional<z.ZodString>;
|
|
203
|
+
authMethod: z.ZodLiteral<"individual-credentials">;
|
|
204
|
+
}, z.core.$strip>], "authMethod">;
|
|
205
|
+
readonly snowflake: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
206
|
+
accountName: z.ZodString;
|
|
207
|
+
warehouse: z.ZodOptional<z.ZodString>;
|
|
208
|
+
database: z.ZodOptional<z.ZodString>;
|
|
209
|
+
role: z.ZodOptional<z.ZodString>;
|
|
210
|
+
authMethod: z.ZodLiteral<"password">;
|
|
211
|
+
username: z.ZodString;
|
|
212
|
+
password: z.ZodString;
|
|
213
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
214
|
+
accountName: z.ZodString;
|
|
215
|
+
warehouse: z.ZodOptional<z.ZodString>;
|
|
216
|
+
database: z.ZodOptional<z.ZodString>;
|
|
217
|
+
role: z.ZodOptional<z.ZodString>;
|
|
218
|
+
authMethod: z.ZodLiteral<"okta">;
|
|
219
|
+
clientId: z.ZodString;
|
|
220
|
+
clientSecret: z.ZodString;
|
|
221
|
+
oktaSubdomain: z.ZodString;
|
|
222
|
+
identityProvider: z.ZodString;
|
|
223
|
+
authorizationServer: z.ZodString;
|
|
224
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
225
|
+
accountName: z.ZodString;
|
|
226
|
+
warehouse: z.ZodOptional<z.ZodString>;
|
|
227
|
+
database: z.ZodOptional<z.ZodString>;
|
|
228
|
+
role: z.ZodOptional<z.ZodString>;
|
|
229
|
+
authMethod: z.ZodLiteral<"snowflake">;
|
|
230
|
+
clientId: z.ZodString;
|
|
231
|
+
clientSecret: z.ZodString;
|
|
232
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
233
|
+
accountName: z.ZodString;
|
|
234
|
+
warehouse: z.ZodOptional<z.ZodString>;
|
|
235
|
+
database: z.ZodOptional<z.ZodString>;
|
|
236
|
+
role: z.ZodOptional<z.ZodString>;
|
|
237
|
+
authMethod: z.ZodLiteral<"azure">;
|
|
238
|
+
clientId: z.ZodString;
|
|
239
|
+
clientSecret: z.ZodString;
|
|
240
|
+
resource: z.ZodString;
|
|
241
|
+
tenant: z.ZodString;
|
|
242
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
243
|
+
accountName: z.ZodString;
|
|
244
|
+
warehouse: z.ZodOptional<z.ZodString>;
|
|
245
|
+
database: z.ZodOptional<z.ZodString>;
|
|
246
|
+
role: z.ZodOptional<z.ZodString>;
|
|
247
|
+
authMethod: z.ZodLiteral<"key-pair">;
|
|
248
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
249
|
+
accountName: z.ZodString;
|
|
250
|
+
warehouse: z.ZodOptional<z.ZodString>;
|
|
251
|
+
database: z.ZodOptional<z.ZodString>;
|
|
252
|
+
role: z.ZodOptional<z.ZodString>;
|
|
253
|
+
authMethod: z.ZodLiteral<"service-account-key-pair">;
|
|
254
|
+
username: z.ZodString;
|
|
255
|
+
privateKey: z.ZodString;
|
|
256
|
+
privateKeyPassphrase: z.ZodOptional<z.ZodString>;
|
|
257
|
+
}, z.core.$strip>], "authMethod">;
|
|
258
|
+
readonly spanner: z.ZodObject<{
|
|
259
|
+
service_account: z.ZodString;
|
|
260
|
+
dataBoostEnabled: z.ZodBoolean;
|
|
261
|
+
instance: z.ZodString;
|
|
262
|
+
database: z.ZodString;
|
|
263
|
+
}, z.core.$strip>;
|
|
264
|
+
readonly 'sql-server': z.ZodObject<{
|
|
265
|
+
host: z.ZodString;
|
|
266
|
+
user: z.ZodString;
|
|
267
|
+
password: z.ZodString;
|
|
268
|
+
database: z.ZodString;
|
|
269
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
270
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
271
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
272
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
273
|
+
port: z.ZodString;
|
|
274
|
+
}, z.core.$strip>;
|
|
275
|
+
readonly trino: z.ZodObject<{
|
|
276
|
+
host: z.ZodString;
|
|
277
|
+
user: z.ZodString;
|
|
278
|
+
password: z.ZodString;
|
|
279
|
+
database: z.ZodString;
|
|
280
|
+
port: z.ZodString;
|
|
281
|
+
sshEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
282
|
+
sshHost: z.ZodOptional<z.ZodString>;
|
|
283
|
+
sshPort: z.ZodOptional<z.ZodString>;
|
|
284
|
+
sshUser: z.ZodOptional<z.ZodString>;
|
|
285
|
+
sslEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
286
|
+
caCertificateName: z.ZodOptional<z.ZodString>;
|
|
287
|
+
caCertificateText: z.ZodOptional<z.ZodString>;
|
|
288
|
+
}, z.core.$strip>;
|
|
289
|
+
};
|
|
290
|
+
type DatabaseIntegrationMetadataByType = { [integrationType in DatabaseIntegrationType]: z.infer<(typeof databaseMetadataSchemasByType)[integrationType]> };
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region src/sql-alchemy-types.d.ts
|
|
293
|
+
/** see https://www.python.org/dev/peps/pep-0249/#paramstyle */
|
|
294
|
+
type ParamStyle = 'pyformat' | 'qmark' | 'numeric' | 'named' | 'format';
|
|
295
|
+
interface SqlAlchemyInput {
|
|
296
|
+
url: string;
|
|
297
|
+
params: Record<string, unknown>;
|
|
298
|
+
param_style: ParamStyle;
|
|
299
|
+
ssh_options?: {
|
|
300
|
+
enabled?: string | undefined;
|
|
301
|
+
host?: string | undefined;
|
|
302
|
+
port?: string | undefined;
|
|
303
|
+
user?: string | undefined;
|
|
304
|
+
};
|
|
305
|
+
sslParams?: {
|
|
306
|
+
caCertificateText: string;
|
|
307
|
+
caCertificateName: string;
|
|
308
|
+
};
|
|
309
|
+
iamParams?: {
|
|
310
|
+
integrationId: string;
|
|
311
|
+
type: string;
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region src/sql-integration-auth-methods.d.ts
|
|
316
|
+
declare const AwsAuthMethods: {
|
|
317
|
+
readonly AccessKeys: "access-keys";
|
|
318
|
+
readonly IamRole: "iam-role";
|
|
319
|
+
};
|
|
320
|
+
type AwsAuthMethod = (typeof AwsAuthMethods)[keyof typeof AwsAuthMethods];
|
|
321
|
+
declare const SnowflakeAuthMethods: {
|
|
322
|
+
readonly AzureAd: "azure";
|
|
323
|
+
readonly KeyPair: "key-pair";
|
|
324
|
+
readonly ServiceAccountKeyPair: "service-account-key-pair";
|
|
325
|
+
readonly NativeSnowflake: "snowflake";
|
|
326
|
+
readonly Okta: "okta";
|
|
327
|
+
readonly Password: "password";
|
|
328
|
+
};
|
|
329
|
+
type SnowflakeAuthMethod = (typeof SnowflakeAuthMethods)[keyof typeof SnowflakeAuthMethods];
|
|
330
|
+
declare const BigQueryAuthMethods: {
|
|
331
|
+
readonly ServiceAccount: "service-account";
|
|
332
|
+
readonly GoogleOauth: "google-oauth";
|
|
333
|
+
};
|
|
334
|
+
type BigQueryAuthMethod = (typeof BigQueryAuthMethods)[keyof typeof BigQueryAuthMethods];
|
|
335
|
+
declare const DatabaseAuthMethods: {
|
|
336
|
+
readonly UsernameAndPassword: "username-and-password";
|
|
337
|
+
readonly IndividualCredentials: "individual-credentials";
|
|
338
|
+
};
|
|
339
|
+
type DatabaseAuthMethod = (typeof DatabaseAuthMethods)[keyof typeof DatabaseAuthMethods];
|
|
340
|
+
declare const federatedAuthMethods: readonly ["okta", "snowflake", "azure", "key-pair", "google-oauth", "individual-credentials"];
|
|
341
|
+
type FederatedAuthMethod = (typeof federatedAuthMethods)[number];
|
|
342
|
+
declare function isFederatedAuthMethod(authMethod: string): authMethod is FederatedAuthMethod;
|
|
343
|
+
declare function isFederatedAuthMetadata<M extends {
|
|
344
|
+
authMethod: string;
|
|
345
|
+
}>(metadata: M): metadata is Extract<M, {
|
|
346
|
+
authMethod: FederatedAuthMethod;
|
|
347
|
+
}>;
|
|
348
|
+
//#endregion
|
|
349
|
+
//#region src/database-integration-env-vars.d.ts
|
|
350
|
+
interface EnvVar {
|
|
351
|
+
name: string;
|
|
352
|
+
value: string;
|
|
353
|
+
}
|
|
354
|
+
type DatabaseIntegrationConfig = { [integrationType in DatabaseIntegrationType]: {
|
|
355
|
+
type: integrationType;
|
|
356
|
+
id: string;
|
|
357
|
+
name: string;
|
|
358
|
+
metadata: DatabaseIntegrationMetadataByType[integrationType];
|
|
359
|
+
federated_auth_method?: FederatedAuthMethod;
|
|
360
|
+
} }[DatabaseIntegrationType];
|
|
361
|
+
type SqlIntegrationConfig = Extract<DatabaseIntegrationConfig, {
|
|
362
|
+
type: SqlIntegrationType;
|
|
363
|
+
}>;
|
|
364
|
+
declare function getIntegrationListEnv(sqlIntegrations: Array<DatabaseIntegrationConfig>, params: {
|
|
365
|
+
projectRootDirectory: string;
|
|
366
|
+
snowflakePartnerIdentifier?: string;
|
|
367
|
+
}): {
|
|
368
|
+
envVars: Array<EnvVar>;
|
|
369
|
+
errors: Array<Error>;
|
|
370
|
+
};
|
|
371
|
+
/**
|
|
372
|
+
* @returns sql alchemy input, or undefined if there is an error.
|
|
373
|
+
*
|
|
374
|
+
* The URL and the params are passed to SQL Alchemy's create_engine function as arguments. The params are
|
|
375
|
+
* passed as keyword arguments to the function.
|
|
376
|
+
* https://docs.sqlalchemy.org/en/20/core/engines.html#sqlalchemy.create_engine
|
|
377
|
+
*
|
|
378
|
+
* See the `query_data_source` method in Deepnote Toolkit for more details:
|
|
379
|
+
* https://github.com/deepnote/deepnote-toolkit/blob/main/deepnote_toolkit/sql/sql_execution.py#L321
|
|
380
|
+
*/
|
|
381
|
+
declare function getSqlAlchemyInput(integration: SqlIntegrationConfig, params: {
|
|
382
|
+
projectRootDirectory: string;
|
|
383
|
+
snowflakePartnerIdentifier?: string;
|
|
384
|
+
}): SqlAlchemyInput | null;
|
|
385
|
+
declare class BigQueryServiceAccountParseError extends Error {
|
|
386
|
+
cause: Error;
|
|
387
|
+
constructor(message: string, params: {
|
|
388
|
+
cause: Error;
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
declare class SpannerServiceAccountParseError extends Error {
|
|
392
|
+
cause: Error;
|
|
393
|
+
constructor(message: string, params: {
|
|
394
|
+
cause: Error;
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
//#endregion
|
|
398
|
+
export { type AwsAuthMethod, AwsAuthMethods, type BigQueryAuthMethod, BigQueryAuthMethods, BigQueryServiceAccountParseError, type DatabaseAuthMethod, DatabaseAuthMethods, type DatabaseIntegrationConfig, type DatabaseIntegrationMetadataByType, type DatabaseIntegrationType, type DatabaseIntegrationTypeWithSslSupport, type EnvVar, type FederatedAuthMethod, type SnowflakeAuthMethod, SnowflakeAuthMethods, SpannerServiceAccountParseError, type SqlAlchemyInput, type SqlIntegrationConfig, type SqlIntegrationType, databaseIntegrationTypes, databaseIntegrationTypesWithSslSupport, databaseMetadataSchemasByType, getIntegrationListEnv, getSqlAlchemyInput, isFederatedAuthMetadata, isFederatedAuthMethod, sqlIntegrationTypes };
|