@aiqadam/qadam-snowflake 0.3.4
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/LICENSE +22 -0
- package/NOTICE +6 -0
- package/README.md +5 -0
- package/package.json +23 -0
- package/src/i18n/de.json +120 -0
- package/src/i18n/es.json +120 -0
- package/src/i18n/fr.json +120 -0
- package/src/i18n/ja.json +120 -0
- package/src/i18n/nl.json +120 -0
- package/src/i18n/pt.json +120 -0
- package/src/i18n/ru.json +16 -0
- package/src/i18n/translation.json +120 -0
- package/src/i18n/vi.json +14 -0
- package/src/i18n/zh.json +120 -0
- package/src/index.d.ts +11 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +63 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/create-dynamic-table.d.ts +45 -0
- package/src/lib/actions/create-dynamic-table.d.ts.map +1 -0
- package/src/lib/actions/create-dynamic-table.js +82 -0
- package/src/lib/actions/create-dynamic-table.js.map +1 -0
- package/src/lib/actions/delete-row.d.ts +43 -0
- package/src/lib/actions/delete-row.d.ts.map +1 -0
- package/src/lib/actions/delete-row.js +50 -0
- package/src/lib/actions/delete-row.js.map +1 -0
- package/src/lib/actions/execute-stored-procedure.d.ts +43 -0
- package/src/lib/actions/execute-stored-procedure.d.ts.map +1 -0
- package/src/lib/actions/execute-stored-procedure.js +97 -0
- package/src/lib/actions/execute-stored-procedure.js.map +1 -0
- package/src/lib/actions/get-row-by-id.d.ts +53 -0
- package/src/lib/actions/get-row-by-id.d.ts.map +1 -0
- package/src/lib/actions/get-row-by-id.js +72 -0
- package/src/lib/actions/get-row-by-id.js.map +1 -0
- package/src/lib/actions/get-table-schema.d.ts +42 -0
- package/src/lib/actions/get-table-schema.d.ts.map +1 -0
- package/src/lib/actions/get-table-schema.js +54 -0
- package/src/lib/actions/get-table-schema.js.map +1 -0
- package/src/lib/actions/insert-multiple-rows.d.ts +43 -0
- package/src/lib/actions/insert-multiple-rows.d.ts.map +1 -0
- package/src/lib/actions/insert-multiple-rows.js +86 -0
- package/src/lib/actions/insert-multiple-rows.js.map +1 -0
- package/src/lib/actions/insert-row.d.ts +52 -0
- package/src/lib/actions/insert-row.d.ts.map +1 -0
- package/src/lib/actions/insert-row.js +41 -0
- package/src/lib/actions/insert-row.js.map +1 -0
- package/src/lib/actions/list-tables.d.ts +32 -0
- package/src/lib/actions/list-tables.d.ts.map +1 -0
- package/src/lib/actions/list-tables.js +52 -0
- package/src/lib/actions/list-tables.js.map +1 -0
- package/src/lib/actions/load-data-from-stage.d.ts +48 -0
- package/src/lib/actions/load-data-from-stage.d.ts.map +1 -0
- package/src/lib/actions/load-data-from-stage.js +124 -0
- package/src/lib/actions/load-data-from-stage.js.map +1 -0
- package/src/lib/actions/run-multiple-queries.d.ts +17 -0
- package/src/lib/actions/run-multiple-queries.d.ts.map +1 -0
- package/src/lib/actions/run-multiple-queries.js +147 -0
- package/src/lib/actions/run-multiple-queries.js.map +1 -0
- package/src/lib/actions/run-query.d.ts +16 -0
- package/src/lib/actions/run-query.d.ts.map +1 -0
- package/src/lib/actions/run-query.js +58 -0
- package/src/lib/actions/run-query.js.map +1 -0
- package/src/lib/actions/search-rows.d.ts +45 -0
- package/src/lib/actions/search-rows.d.ts.map +1 -0
- package/src/lib/actions/search-rows.js +63 -0
- package/src/lib/actions/search-rows.js.map +1 -0
- package/src/lib/actions/update-row.d.ts +53 -0
- package/src/lib/actions/update-row.d.ts.map +1 -0
- package/src/lib/actions/update-row.js +59 -0
- package/src/lib/actions/update-row.js.map +1 -0
- package/src/lib/actions/upsert-row.d.ts +62 -0
- package/src/lib/actions/upsert-row.d.ts.map +1 -0
- package/src/lib/actions/upsert-row.js +98 -0
- package/src/lib/actions/upsert-row.js.map +1 -0
- package/src/lib/auth.d.ts +22 -0
- package/src/lib/auth.d.ts.map +1 -0
- package/src/lib/auth.js +246 -0
- package/src/lib/auth.js.map +1 -0
- package/src/lib/common/index.d.ts +93 -0
- package/src/lib/common/index.d.ts.map +1 -0
- package/src/lib/common/index.js +319 -0
- package/src/lib/common/index.js.map +1 -0
- package/src/lib/triggers/new-column.d.ts +163 -0
- package/src/lib/triggers/new-column.d.ts.map +1 -0
- package/src/lib/triggers/new-column.js +94 -0
- package/src/lib/triggers/new-column.js.map +1 -0
- package/src/lib/triggers/new-or-updated-row.d.ts +203 -0
- package/src/lib/triggers/new-or-updated-row.d.ts.map +1 -0
- package/src/lib/triggers/new-or-updated-row.js +108 -0
- package/src/lib/triggers/new-or-updated-row.js.map +1 -0
- package/src/lib/triggers/new-row.d.ts +203 -0
- package/src/lib/triggers/new-row.d.ts.map +1 -0
- package/src/lib/triggers/new-row.js +107 -0
- package/src/lib/triggers/new-row.js.map +1 -0
- package/src/lib/triggers/new-table.d.ts +123 -0
- package/src/lib/triggers/new-table.d.ts.map +1 -0
- package/src/lib/triggers/new-table.js +94 -0
- package/src/lib/triggers/new-table.js.map +1 -0
- package/src/lib/triggers/new-view.d.ts +123 -0
- package/src/lib/triggers/new-view.d.ts.map +1 -0
- package/src/lib/triggers/new-view.js +94 -0
- package/src/lib/triggers/new-view.js.map +1 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const listTablesAction: import("@aiqadam/qadams-framework").IAction<(import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
2
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
3
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
4
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
5
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
6
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
7
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
8
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
9
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
10
|
+
}>)[], {
|
|
11
|
+
database: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
12
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
13
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
14
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
15
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
16
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
17
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
18
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
19
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
20
|
+
}>)[]>;
|
|
21
|
+
schema: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
22
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
23
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
24
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
25
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
26
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
27
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
28
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
29
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
30
|
+
}>)[]>;
|
|
31
|
+
}>;
|
|
32
|
+
//# sourceMappingURL=list-tables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-tables.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-tables.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2C3B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listTablesAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const qadams_framework_1 = require("@aiqadam/qadams-framework");
|
|
6
|
+
const auth_1 = require("../auth");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
exports.listTablesAction = (0, qadams_framework_1.createAction)({
|
|
9
|
+
name: 'list_tables',
|
|
10
|
+
displayName: 'List Tables',
|
|
11
|
+
description: 'List all tables in a Snowflake schema.',
|
|
12
|
+
audience: 'both',
|
|
13
|
+
aiMetadata: {
|
|
14
|
+
description: "Lists the tables in a given Snowflake database and schema (via SHOW TABLES), returning each table's name, kind, row/byte counts, owner, and creation time. Use to discover what tables exist before querying or to enumerate a schema. Read-only and idempotent.",
|
|
15
|
+
idempotent: true,
|
|
16
|
+
},
|
|
17
|
+
auth: auth_1.snowflakeAuth,
|
|
18
|
+
props: {
|
|
19
|
+
database: common_1.snowflakeCommonProps.database,
|
|
20
|
+
schema: common_1.snowflakeCommonProps.schema,
|
|
21
|
+
},
|
|
22
|
+
run(context) {
|
|
23
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const { database, schema } = context.propsValue;
|
|
25
|
+
const connection = (0, common_1.configureConnection)(context.auth);
|
|
26
|
+
yield (0, common_1.connect)(connection);
|
|
27
|
+
try {
|
|
28
|
+
const result = yield (0, common_1.execute)(connection, `SHOW TABLES IN SCHEMA ${database}.${schema}`, []);
|
|
29
|
+
if (!result)
|
|
30
|
+
return [];
|
|
31
|
+
return result.map((t) => {
|
|
32
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
33
|
+
return ({
|
|
34
|
+
table_name: (_a = t['name']) !== null && _a !== void 0 ? _a : null,
|
|
35
|
+
database_name: (_b = t['database_name']) !== null && _b !== void 0 ? _b : null,
|
|
36
|
+
schema_name: (_c = t['schema_name']) !== null && _c !== void 0 ? _c : null,
|
|
37
|
+
kind: (_d = t['kind']) !== null && _d !== void 0 ? _d : null,
|
|
38
|
+
rows: (_e = t['rows']) !== null && _e !== void 0 ? _e : null,
|
|
39
|
+
bytes: (_f = t['bytes']) !== null && _f !== void 0 ? _f : null,
|
|
40
|
+
owner: (_g = t['owner']) !== null && _g !== void 0 ? _g : null,
|
|
41
|
+
comment: (_h = t['comment']) !== null && _h !== void 0 ? _h : null,
|
|
42
|
+
created_on: (_j = t['created_on']) !== null && _j !== void 0 ? _j : null,
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
yield (0, common_1.destroy)(connection);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=list-tables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-tables.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-tables.ts"],"names":[],"mappings":";;;;AAAA,gEAAyD;AACzD,kCAAwC;AACxC,sCAOmB;AAEN,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,wCAAwC;IACrD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,kQAAkQ;QACpQ,UAAU,EAAE,IAAI;KACjB;IACD,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE;QACL,QAAQ,EAAE,6BAAoB,CAAC,QAA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AC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare const loadDataFromStageAction: import("@aiqadam/qadams-framework").IAction<(import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
2
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
3
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
4
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
5
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
6
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
7
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
8
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
9
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
10
|
+
}>)[], {
|
|
11
|
+
database: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
12
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
13
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
14
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
15
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
16
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
17
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
18
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
19
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
20
|
+
}>)[]>;
|
|
21
|
+
schema: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
22
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
23
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
24
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
25
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
26
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
27
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
28
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
29
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
30
|
+
}>)[]>;
|
|
31
|
+
table: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
32
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
33
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
34
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
35
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
36
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
37
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
38
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
39
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
40
|
+
}>)[]>;
|
|
41
|
+
stage_path: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
42
|
+
file_format_type: import("@aiqadam/qadams-framework").StaticDropdownProperty<string, true>;
|
|
43
|
+
file_pattern: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
44
|
+
skip_header: import("@aiqadam/qadams-framework").NumberProperty<false>;
|
|
45
|
+
error_on_column_count_mismatch: import("@aiqadam/qadams-framework").CheckboxProperty<false>;
|
|
46
|
+
on_error: import("@aiqadam/qadams-framework").StaticDropdownProperty<string, false>;
|
|
47
|
+
}>;
|
|
48
|
+
//# sourceMappingURL=load-data-from-stage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-data-from-stage.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/load-data-from-stage.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqIlC,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadDataFromStageAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const qadams_framework_1 = require("@aiqadam/qadams-framework");
|
|
6
|
+
const auth_1 = require("../auth");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
exports.loadDataFromStageAction = (0, qadams_framework_1.createAction)({
|
|
9
|
+
name: 'load_data_from_stage',
|
|
10
|
+
displayName: 'Load Data from Stage',
|
|
11
|
+
description: 'Load data into a Snowflake table from a named internal or external stage using COPY INTO.',
|
|
12
|
+
audience: 'both',
|
|
13
|
+
aiMetadata: {
|
|
14
|
+
description: 'Bulk-loads files from a named internal or external Snowflake stage into a target table via COPY INTO, with configurable file format, file-name pattern, header skipping, and on-error behavior. Use to ingest staged CSV/JSON/Parquet/etc. data. By default COPY INTO skips files it has already loaded, but re-running may load newly added files; treat as a mutating load (not strictly idempotent).',
|
|
15
|
+
idempotent: false,
|
|
16
|
+
},
|
|
17
|
+
auth: auth_1.snowflakeAuth,
|
|
18
|
+
props: {
|
|
19
|
+
database: common_1.snowflakeCommonProps.database,
|
|
20
|
+
schema: common_1.snowflakeCommonProps.schema,
|
|
21
|
+
table: common_1.snowflakeCommonProps.table,
|
|
22
|
+
stage_path: qadams_framework_1.Property.ShortText({
|
|
23
|
+
displayName: 'Stage Path',
|
|
24
|
+
description: 'Path to the Snowflake stage (a staging area that holds files before loading). ' +
|
|
25
|
+
'For **internal stages**: use `@stage_name` or `@schema.stage_name/folder/`. ' +
|
|
26
|
+
'For **external stages** (S3, GCS, Azure): use `@schema.stage_name/prefix/`. ' +
|
|
27
|
+
'Example: `@my_stage/data/`. ' +
|
|
28
|
+
'You can find your stage names under **Data → Databases → [your database] → Stages**.',
|
|
29
|
+
required: true,
|
|
30
|
+
}),
|
|
31
|
+
file_format_type: qadams_framework_1.Property.StaticDropdown({
|
|
32
|
+
displayName: 'File Format',
|
|
33
|
+
description: 'The file format of the data files in the stage.',
|
|
34
|
+
required: true,
|
|
35
|
+
defaultValue: 'CSV',
|
|
36
|
+
options: {
|
|
37
|
+
options: [
|
|
38
|
+
{ label: 'CSV', value: 'CSV' },
|
|
39
|
+
{ label: 'JSON', value: 'JSON' },
|
|
40
|
+
{ label: 'PARQUET', value: 'PARQUET' },
|
|
41
|
+
{ label: 'AVRO', value: 'AVRO' },
|
|
42
|
+
{ label: 'ORC', value: 'ORC' },
|
|
43
|
+
{ label: 'XML', value: 'XML' },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
file_pattern: qadams_framework_1.Property.ShortText({
|
|
48
|
+
displayName: 'File Pattern',
|
|
49
|
+
description: 'Optional regular expression to load only files whose names match the pattern (e.g. `.*\\.csv` loads only `.csv` files, `sales_2024.*` loads files that start with `sales_2024`). Leave empty to load all files in the stage path.',
|
|
50
|
+
required: false,
|
|
51
|
+
}),
|
|
52
|
+
skip_header: qadams_framework_1.Property.Number({
|
|
53
|
+
displayName: 'Skip Header Rows',
|
|
54
|
+
description: 'Number of rows to skip at the top of each CSV file (e.g. `1` to skip a column-header row). Only applies to CSV files. Defaults to 0.',
|
|
55
|
+
required: false,
|
|
56
|
+
defaultValue: 0,
|
|
57
|
+
}),
|
|
58
|
+
error_on_column_count_mismatch: qadams_framework_1.Property.Checkbox({
|
|
59
|
+
displayName: 'Fail on Column Count Mismatch',
|
|
60
|
+
description: 'When enabled, the load fails if the number of columns in a file does not match the number of columns in the target table. Disable to allow files with fewer columns.',
|
|
61
|
+
required: false,
|
|
62
|
+
defaultValue: true,
|
|
63
|
+
}),
|
|
64
|
+
on_error: qadams_framework_1.Property.StaticDropdown({
|
|
65
|
+
displayName: 'On Error',
|
|
66
|
+
description: 'What to do when a row fails validation during loading.',
|
|
67
|
+
required: false,
|
|
68
|
+
defaultValue: 'ABORT_STATEMENT',
|
|
69
|
+
options: {
|
|
70
|
+
options: [
|
|
71
|
+
{ label: 'Abort statement (default)', value: 'ABORT_STATEMENT' },
|
|
72
|
+
{ label: 'Continue (skip bad rows)', value: 'CONTINUE' },
|
|
73
|
+
{ label: 'Skip file', value: 'SKIP_FILE' },
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
}),
|
|
77
|
+
},
|
|
78
|
+
run(context) {
|
|
79
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
const { table, stage_path, file_format_type, file_pattern, skip_header, error_on_column_count_mismatch, on_error, } = context.propsValue;
|
|
81
|
+
let fileFormatClause = `TYPE = '${file_format_type}'`;
|
|
82
|
+
if (skip_header)
|
|
83
|
+
fileFormatClause += ` SKIP_HEADER = ${Number(skip_header)}`;
|
|
84
|
+
if (error_on_column_count_mismatch !== undefined) {
|
|
85
|
+
fileFormatClause += ` ERROR_ON_COLUMN_COUNT_MISMATCH = ${error_on_column_count_mismatch ? 'TRUE' : 'FALSE'}`;
|
|
86
|
+
}
|
|
87
|
+
let sql = `COPY INTO ${table} FROM ${stage_path} FILE_FORMAT = (${fileFormatClause})`;
|
|
88
|
+
if (file_pattern)
|
|
89
|
+
sql += ` PATTERN = '${file_pattern.replace(/'/g, "''")}'`;
|
|
90
|
+
sql += ` ON_ERROR = '${on_error !== null && on_error !== void 0 ? on_error : 'ABORT_STATEMENT'}'`;
|
|
91
|
+
const connection = (0, common_1.configureConnection)(context.auth);
|
|
92
|
+
yield (0, common_1.connect)(connection);
|
|
93
|
+
try {
|
|
94
|
+
const result = yield (0, common_1.execute)(connection, sql, []);
|
|
95
|
+
if (!result || result.length === 0) {
|
|
96
|
+
return { success: true, files_processed: 0, rows_loaded: 0 };
|
|
97
|
+
}
|
|
98
|
+
const summary = result.map((row) => {
|
|
99
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
100
|
+
return ({
|
|
101
|
+
file: (_a = row['file']) !== null && _a !== void 0 ? _a : null,
|
|
102
|
+
status: (_b = row['status']) !== null && _b !== void 0 ? _b : null,
|
|
103
|
+
rows_parsed: (_c = row['rows_parsed']) !== null && _c !== void 0 ? _c : null,
|
|
104
|
+
rows_loaded: (_d = row['rows_loaded']) !== null && _d !== void 0 ? _d : null,
|
|
105
|
+
error_limit: (_e = row['error_limit']) !== null && _e !== void 0 ? _e : null,
|
|
106
|
+
errors_seen: (_f = row['errors_seen']) !== null && _f !== void 0 ? _f : null,
|
|
107
|
+
first_error: (_g = row['first_error']) !== null && _g !== void 0 ? _g : null,
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
const totalLoaded = summary.reduce((sum, r) => sum + (Number(r.rows_loaded) || 0), 0);
|
|
111
|
+
return {
|
|
112
|
+
success: true,
|
|
113
|
+
files_processed: summary.length,
|
|
114
|
+
rows_loaded: totalLoaded,
|
|
115
|
+
files: summary,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
yield (0, common_1.destroy)(connection);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
//# sourceMappingURL=load-data-from-stage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-data-from-stage.js","sourceRoot":"","sources":["../../../../src/lib/actions/load-data-from-stage.ts"],"names":[],"mappings":";;;;AAAA,gEAAmE;AACnE,kCAAwC;AACxC,sCAOmB;AAEN,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EACT,2FAA2F;IAC7F,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,yYAAyY;QAC3Y,UAAU,EAAE,KAAK;KAClB;IACD,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE;QACL,QAAQ,EAAE,6BAAoB,CAAC,QAAQ;QACvC,MAAM,EAAE,6BAAoB,CAAC,MAAM;QACnC,KAAK,EAAE,6BAAoB,CAAC,KAAK;QACjC,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EACT,gFAAgF;gBAChF,8EAA8E;gBAC9E,8EAA8E;gBAC9E,8BAA8B;gBAC9B,sFAAsF;YACxF,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,gBAAgB,EAAE,2BAAQ,CAAC,cAAc,CAAC;YACxC,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,KAAK;YACnB,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC9B,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;oBAChC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;oBACtC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;oBAChC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;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Aa,CAAC,mCAAI,IAAI;wBACvC,WAAW,EAAE,MAAA,GAAG,CAAC,aAAa,CAAC,mCAAI,IAAI;wBACvC,WAAW,EAAE,MAAA,GAAG,CAAC,aAAa,CAAC,mCAAI,IAAI;qBACxC,CAAC,CAAA;iBAAA,CAAC,CAAC;gBAEJ,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAChC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAC9C,CAAC,CACF,CAAC;gBAEF,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,eAAe,EAAE,OAAO,CAAC,MAAM;oBAC/B,WAAW,EAAE,WAAW;oBACxB,KAAK,EAAE,OAAO;iBACf,CAAC;YACJ,CAAC;oBAAS,CAAC;gBACT,MAAM,IAAA,gBAAO,EAAC,UAAU,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const runMultipleQueries: import("@aiqadam/qadams-framework").IAction<(import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
2
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
3
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
4
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
5
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
6
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
7
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
8
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
9
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
10
|
+
}>)[], {
|
|
11
|
+
sqlTexts: import("@aiqadam/qadams-framework").ArrayProperty<true>;
|
|
12
|
+
binds: import("@aiqadam/qadams-framework").ArrayProperty<false>;
|
|
13
|
+
useTransaction: import("@aiqadam/qadams-framework").CheckboxProperty<false>;
|
|
14
|
+
timeout: import("@aiqadam/qadams-framework").NumberProperty<false>;
|
|
15
|
+
application: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=run-multiple-queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-multiple-queries.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/run-multiple-queries.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAsJ7B,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runMultipleQueries = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const qadams_framework_1 = require("@aiqadam/qadams-framework");
|
|
6
|
+
const auth_1 = require("../auth");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const DEFAULT_APPLICATION_NAME = 'ActivePieces';
|
|
9
|
+
const DEFAULT_QUERY_TIMEOUT = 30000;
|
|
10
|
+
exports.runMultipleQueries = (0, qadams_framework_1.createAction)({
|
|
11
|
+
name: 'runMultipleQueries',
|
|
12
|
+
displayName: 'Run Multiple Queries',
|
|
13
|
+
description: 'Execute multiple SQL statements in sequence against your Snowflake database. Optionally wrap them in a transaction so all changes are rolled back if any statement fails.',
|
|
14
|
+
audience: 'both',
|
|
15
|
+
aiMetadata: {
|
|
16
|
+
description: 'Runs an ordered list of SQL statements against Snowflake in a single connection, with an option to wrap the whole batch in one transaction so a failure rolls back all preceding changes. Use this for multi-statement scripts or when several statements must succeed or fail together; for a single statement use Run Query. Bind shared dynamic values via numbered `:1`/`:2` placeholders (avoid `?` here). Not idempotent when the batch contains DML/DDL, since those mutate state on each call.',
|
|
17
|
+
idempotent: false,
|
|
18
|
+
},
|
|
19
|
+
auth: auth_1.snowflakeAuth,
|
|
20
|
+
props: {
|
|
21
|
+
sqlTexts: qadams_framework_1.Property.Array({
|
|
22
|
+
displayName: 'SQL Queries',
|
|
23
|
+
description: 'List of SQL statements to run in order. Use `:1`, `:2`… placeholders to reference shared **Parameters** values. Avoid `?` placeholders when running multiple queries — use numbered placeholders instead to prevent unexpected behaviour.',
|
|
24
|
+
required: true,
|
|
25
|
+
}),
|
|
26
|
+
binds: qadams_framework_1.Property.Array({
|
|
27
|
+
displayName: 'Parameters',
|
|
28
|
+
description: 'Values shared across all queries for the numbered placeholders (`:1`, `:2`…). Provide them in order. Unused parameters are allowed.',
|
|
29
|
+
required: false,
|
|
30
|
+
}),
|
|
31
|
+
useTransaction: qadams_framework_1.Property.Checkbox({
|
|
32
|
+
displayName: 'Use Transaction',
|
|
33
|
+
description: 'When enabled, all queries run inside a single transaction. If any query fails, every preceding change in this batch is rolled back automatically.',
|
|
34
|
+
required: false,
|
|
35
|
+
defaultValue: false,
|
|
36
|
+
}),
|
|
37
|
+
timeout: qadams_framework_1.Property.Number({
|
|
38
|
+
displayName: 'Query Timeout (ms)',
|
|
39
|
+
description: 'Maximum time in milliseconds to wait for each query to complete before cancelling it. Defaults to 30 000 ms (30 seconds).',
|
|
40
|
+
required: false,
|
|
41
|
+
defaultValue: DEFAULT_QUERY_TIMEOUT,
|
|
42
|
+
}),
|
|
43
|
+
application: qadams_framework_1.Property.ShortText({
|
|
44
|
+
displayName: 'Application Name',
|
|
45
|
+
description: 'An optional label sent to Snowflake to identify this client. Visible in query history under **Monitoring → Query History → Client Application**.',
|
|
46
|
+
required: false,
|
|
47
|
+
defaultValue: DEFAULT_APPLICATION_NAME,
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
run(context) {
|
|
51
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const connection = (0, common_1.configureConnection)(context.auth, context.propsValue.application, context.propsValue.timeout);
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
connection.connect(function (err) {
|
|
55
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
if (err) {
|
|
57
|
+
reject(err);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const { sqlTexts, binds, useTransaction } = context.propsValue;
|
|
61
|
+
const queryResults = [];
|
|
62
|
+
function handleError(err) {
|
|
63
|
+
if (useTransaction) {
|
|
64
|
+
connection.execute({
|
|
65
|
+
sqlText: 'ROLLBACK',
|
|
66
|
+
complete: () => {
|
|
67
|
+
connection.destroy(() => {
|
|
68
|
+
reject(err);
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
connection.destroy(() => {
|
|
75
|
+
reject(err);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function executeQueriesSequentially() {
|
|
80
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
try {
|
|
82
|
+
if (useTransaction) {
|
|
83
|
+
yield new Promise((resolveBegin, rejectBegin) => {
|
|
84
|
+
connection.execute({
|
|
85
|
+
sqlText: 'BEGIN',
|
|
86
|
+
complete: (err) => {
|
|
87
|
+
if (err)
|
|
88
|
+
rejectBegin(err);
|
|
89
|
+
else
|
|
90
|
+
resolveBegin();
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
for (const sqlText of sqlTexts) {
|
|
96
|
+
const result = yield new Promise((resolveQuery, rejectQuery) => {
|
|
97
|
+
connection.execute({
|
|
98
|
+
sqlText: sqlText,
|
|
99
|
+
binds: binds,
|
|
100
|
+
complete: (err, stmt, rows) => {
|
|
101
|
+
if (err) {
|
|
102
|
+
rejectQuery(err);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
resolveQuery(rows);
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
queryResults.push({
|
|
110
|
+
query: sqlText,
|
|
111
|
+
result,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (useTransaction) {
|
|
115
|
+
yield new Promise((resolveCommit, rejectCommit) => {
|
|
116
|
+
connection.execute({
|
|
117
|
+
sqlText: 'COMMIT',
|
|
118
|
+
complete: (err) => {
|
|
119
|
+
if (err)
|
|
120
|
+
rejectCommit(err);
|
|
121
|
+
else
|
|
122
|
+
resolveCommit();
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
connection.destroy((err) => {
|
|
128
|
+
if (err) {
|
|
129
|
+
reject(err);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
resolve(queryResults);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
catch (err) {
|
|
136
|
+
handleError(err); // Reject with the original error!
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
executeQueriesSequentially();
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
//# sourceMappingURL=run-multiple-queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-multiple-queries.js","sourceRoot":"","sources":["../../../../src/lib/actions/run-multiple-queries.ts"],"names":[],"mappings":";;;;AAAA,gEAAmE;AAEnE,kCAAwC;AACxC,sCAAoE;AAKpE,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAChD,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAEvB,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EACT,2KAA2K;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qadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
2
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
3
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
4
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
5
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
6
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
7
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
8
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
9
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
10
|
+
}>)[], {
|
|
11
|
+
sqlText: import("@aiqadam/qadams-framework").LongTextProperty<true>;
|
|
12
|
+
binds: import("@aiqadam/qadams-framework").ArrayProperty<false>;
|
|
13
|
+
timeout: import("@aiqadam/qadams-framework").NumberProperty<false>;
|
|
14
|
+
application: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=run-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-query.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/run-query.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;EAwDnB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const qadams_framework_1 = require("@aiqadam/qadams-framework");
|
|
6
|
+
const auth_1 = require("../auth");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const DEFAULT_APPLICATION_NAME = 'ActivePieces';
|
|
9
|
+
const DEFAULT_QUERY_TIMEOUT = 30000;
|
|
10
|
+
exports.runQuery = (0, qadams_framework_1.createAction)({
|
|
11
|
+
name: 'runQuery',
|
|
12
|
+
displayName: 'Run Query',
|
|
13
|
+
description: 'Execute a SQL query against your Snowflake database and return the results as rows.',
|
|
14
|
+
audience: 'both',
|
|
15
|
+
aiMetadata: {
|
|
16
|
+
description: 'Runs an arbitrary SQL statement against Snowflake (SELECT, DML, or DDL). Use this for any query the dedicated row/table actions do not cover, or when you need full SQL control. Pass dynamic values via the parameters array bound to `:1`/`?` placeholders rather than concatenating into the SQL. Idempotency depends on the statement: a SELECT is safe to repeat, but an INSERT/UPDATE/DELETE mutates state on each call.',
|
|
17
|
+
idempotent: false,
|
|
18
|
+
},
|
|
19
|
+
auth: auth_1.snowflakeAuth,
|
|
20
|
+
props: {
|
|
21
|
+
sqlText: qadams_framework_1.Property.LongText({
|
|
22
|
+
displayName: 'SQL Query',
|
|
23
|
+
description: 'The SQL statement to execute. Use `:1`, `:2`… or `?` as placeholders for the **Parameters** values below to safely pass dynamic values without SQL injection risk.',
|
|
24
|
+
required: true,
|
|
25
|
+
}),
|
|
26
|
+
binds: qadams_framework_1.Property.Array({
|
|
27
|
+
displayName: 'Parameters',
|
|
28
|
+
description: 'Values to bind to the placeholders (`:1`, `:2`…, or `?`) in the SQL query. Provide them in the same order they appear in the query. Using parameters is the safe way to pass dynamic values — never concatenate user input directly into the SQL.',
|
|
29
|
+
required: false,
|
|
30
|
+
}),
|
|
31
|
+
timeout: qadams_framework_1.Property.Number({
|
|
32
|
+
displayName: 'Query Timeout (ms)',
|
|
33
|
+
description: 'Maximum time in milliseconds to wait for the query to complete before cancelling it. Defaults to 30 000 ms (30 seconds).',
|
|
34
|
+
required: false,
|
|
35
|
+
defaultValue: DEFAULT_QUERY_TIMEOUT,
|
|
36
|
+
}),
|
|
37
|
+
application: qadams_framework_1.Property.ShortText({
|
|
38
|
+
displayName: 'Application Name',
|
|
39
|
+
description: 'An optional label sent to Snowflake to identify this client. Visible in query history under **Monitoring → Query History → Client Application**. Useful for auditing which automation triggered a query.',
|
|
40
|
+
required: false,
|
|
41
|
+
defaultValue: DEFAULT_APPLICATION_NAME,
|
|
42
|
+
}),
|
|
43
|
+
},
|
|
44
|
+
run(context) {
|
|
45
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const connection = (0, common_1.configureConnection)(context.auth, context.propsValue.application, context.propsValue.timeout);
|
|
47
|
+
const { sqlText, binds } = context.propsValue;
|
|
48
|
+
yield (0, common_1.connect)(connection);
|
|
49
|
+
try {
|
|
50
|
+
return yield (0, common_1.execute)(connection, sqlText, binds);
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
yield (0, common_1.destroy)(connection);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=run-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-query.js","sourceRoot":"","sources":["../../../../src/lib/actions/run-query.ts"],"names":[],"mappings":";;;;AAAA,gEAAmE;AAEnE,kCAAwC;AACxC,sCAMmB;AAEnB,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAChD,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAEvB,QAAA,QAAQ,GAAG,IAAA,+BAAY,EAAC;IACnC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,WAAW;IACxB,WAAW,EACT,qFAAqF;IACvF,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,gaAAga;QACla,UAAU,EAAE,KAAK;KAClB;IACD,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,WAAW,EAAE,WAAW;YACxB,WAAW,EACT,oKAAoK;YACtK,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACpB,WAAW,EAAE,YAAY;YACzB,WAAW,EACT,mPAAmP;YACrP,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACvB,WAAW,EAAE,oBAAoB;YACjC,WAAW,EACT,0HAA0H;YAC5H,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,qBAAqB;SACpC,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EACT,0MAA0M;YAC5M,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,wBAAwB;SACvC,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,UAAU,GAAG,IAAA,4BAAmB,EACpC,OAAO,CAAC,IAA0B,EAClC,OAAO,CAAC,UAAU,CAAC,WAAW,EAC9B,OAAO,CAAC,UAAU,CAAC,OAAO,CAC3B,CAAC;YAEF,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE9C,MAAM,IAAA,gBAAO,EAAC,UAAU,CAAC,CAAC;YAC1B,IAAI,CAAC;gBACH,OAAO,MAAM,IAAA,gBAAO,EAAC,UAAU,EAAE,OAAO,EAAE,KAAwB,CAAC,CAAC;YACtE,CAAC;oBAAS,CAAC;gBACT,MAAM,IAAA,gBAAO,EAAC,UAAU,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const searchRowsAction: import("@aiqadam/qadams-framework").IAction<(import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
2
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
3
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
4
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
5
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
6
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
7
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
8
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
9
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
10
|
+
}>)[], {
|
|
11
|
+
database: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
12
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
13
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
14
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
15
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
16
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
17
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
18
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
19
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
20
|
+
}>)[]>;
|
|
21
|
+
schema: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
22
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
23
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
24
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
25
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
26
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
27
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
28
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
29
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
30
|
+
}>)[]>;
|
|
31
|
+
table: import("@aiqadam/qadams-framework").DropdownProperty<string, true, (import("@aiqadam/qadams-framework").OAuth2Property<import("@aiqadam/qadams-framework").OAuth2Props> | import("@aiqadam/qadams-framework").CustomAuthProperty<{
|
|
32
|
+
account: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
33
|
+
username: import("@aiqadam/qadams-framework").ShortTextProperty<true>;
|
|
34
|
+
password: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
35
|
+
privateKey: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
36
|
+
privateKeyPassphrase: import("@aiqadam/qadams-framework").SecretTextProperty<false>;
|
|
37
|
+
database: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
38
|
+
role: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
39
|
+
warehouse: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
40
|
+
}>)[]>;
|
|
41
|
+
where_clause: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
42
|
+
order_by: import("@aiqadam/qadams-framework").ShortTextProperty<false>;
|
|
43
|
+
limit: import("@aiqadam/qadams-framework").NumberProperty<false>;
|
|
44
|
+
}>;
|
|
45
|
+
//# sourceMappingURL=search-rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-rows.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/search-rows.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuD3B,CAAC"}
|