@onivoro/server-aws-redshift 22.0.2 → 22.0.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/dist/cjs/lib/services/redshift.service.d.ts +5 -1
- package/dist/cjs/lib/services/redshift.service.js +12 -2
- package/dist/esm/lib/services/redshift.service.d.ts +5 -1
- package/dist/esm/lib/services/redshift.service.js +12 -2
- package/dist/types/lib/services/redshift.service.d.ts +5 -1
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ export declare class RedshiftDataService {
|
|
|
16
16
|
database: string;
|
|
17
17
|
workgroupName: string;
|
|
18
18
|
user: string;
|
|
19
|
-
}): Promise<
|
|
19
|
+
}): Promise<string>;
|
|
20
20
|
grantUsageOnSchema(_: {
|
|
21
21
|
database: string;
|
|
22
22
|
workgroupName: string;
|
|
@@ -28,4 +28,8 @@ export declare class RedshiftDataService {
|
|
|
28
28
|
database: string;
|
|
29
29
|
workgroupName: string;
|
|
30
30
|
}): Promise<any>;
|
|
31
|
+
query(_: {
|
|
32
|
+
database: string;
|
|
33
|
+
workgroupName: string;
|
|
34
|
+
}, Sql: string): Promise<void>;
|
|
31
35
|
}
|
|
@@ -81,15 +81,16 @@ let RedshiftDataService = class RedshiftDataService {
|
|
|
81
81
|
const createResult = await this.redshiftDataClient.send(createUserCommand);
|
|
82
82
|
await this.waitForStatement(createResult.Id);
|
|
83
83
|
console.log(`Created user: ${_.user}`);
|
|
84
|
+
return placeholderPassword;
|
|
84
85
|
}
|
|
85
86
|
else {
|
|
86
87
|
console.log(`User "${_.user} already exists`);
|
|
88
|
+
return '';
|
|
87
89
|
}
|
|
88
|
-
return true;
|
|
89
90
|
}
|
|
90
91
|
catch (error) {
|
|
91
92
|
console.warn({ detail: `Warning creating user ${_.user}`, error });
|
|
92
|
-
|
|
93
|
+
throw error;
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
async grantUsageOnSchema(_) {
|
|
@@ -149,6 +150,15 @@ let RedshiftDataService = class RedshiftDataService {
|
|
|
149
150
|
throw error;
|
|
150
151
|
}
|
|
151
152
|
}
|
|
153
|
+
async query(_, Sql) {
|
|
154
|
+
const result = await this.redshiftDataClient.send(new client_redshift_data_1.ExecuteStatementCommand({
|
|
155
|
+
Database: _.database,
|
|
156
|
+
Sql,
|
|
157
|
+
WorkgroupName: _.workgroupName
|
|
158
|
+
}));
|
|
159
|
+
return await this.waitForStatement(result.Id);
|
|
160
|
+
// return await this.redshiftDataClient.send(new DescribeStatementCommand({ Id: result.Id }));
|
|
161
|
+
}
|
|
152
162
|
};
|
|
153
163
|
exports.RedshiftDataService = RedshiftDataService;
|
|
154
164
|
exports.RedshiftDataService = RedshiftDataService = __decorate([
|
|
@@ -16,7 +16,7 @@ export declare class RedshiftDataService {
|
|
|
16
16
|
database: string;
|
|
17
17
|
workgroupName: string;
|
|
18
18
|
user: string;
|
|
19
|
-
}): Promise<
|
|
19
|
+
}): Promise<string>;
|
|
20
20
|
grantUsageOnSchema(_: {
|
|
21
21
|
database: string;
|
|
22
22
|
workgroupName: string;
|
|
@@ -28,4 +28,8 @@ export declare class RedshiftDataService {
|
|
|
28
28
|
database: string;
|
|
29
29
|
workgroupName: string;
|
|
30
30
|
}): Promise<any>;
|
|
31
|
+
query(_: {
|
|
32
|
+
database: string;
|
|
33
|
+
workgroupName: string;
|
|
34
|
+
}, Sql: string): Promise<void>;
|
|
31
35
|
}
|
|
@@ -81,15 +81,16 @@ let RedshiftDataService = class RedshiftDataService {
|
|
|
81
81
|
const createResult = await this.redshiftDataClient.send(createUserCommand);
|
|
82
82
|
await this.waitForStatement(createResult.Id);
|
|
83
83
|
console.log(`Created user: ${_.user}`);
|
|
84
|
+
return placeholderPassword;
|
|
84
85
|
}
|
|
85
86
|
else {
|
|
86
87
|
console.log(`User "${_.user} already exists`);
|
|
88
|
+
return '';
|
|
87
89
|
}
|
|
88
|
-
return true;
|
|
89
90
|
}
|
|
90
91
|
catch (error) {
|
|
91
92
|
console.warn({ detail: `Warning creating user ${_.user}`, error });
|
|
92
|
-
|
|
93
|
+
throw error;
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
async grantUsageOnSchema(_) {
|
|
@@ -149,6 +150,15 @@ let RedshiftDataService = class RedshiftDataService {
|
|
|
149
150
|
throw error;
|
|
150
151
|
}
|
|
151
152
|
}
|
|
153
|
+
async query(_, Sql) {
|
|
154
|
+
const result = await this.redshiftDataClient.send(new client_redshift_data_1.ExecuteStatementCommand({
|
|
155
|
+
Database: _.database,
|
|
156
|
+
Sql,
|
|
157
|
+
WorkgroupName: _.workgroupName
|
|
158
|
+
}));
|
|
159
|
+
return await this.waitForStatement(result.Id);
|
|
160
|
+
// return await this.redshiftDataClient.send(new DescribeStatementCommand({ Id: result.Id }));
|
|
161
|
+
}
|
|
152
162
|
};
|
|
153
163
|
exports.RedshiftDataService = RedshiftDataService;
|
|
154
164
|
exports.RedshiftDataService = RedshiftDataService = __decorate([
|
|
@@ -16,7 +16,7 @@ export declare class RedshiftDataService {
|
|
|
16
16
|
database: string;
|
|
17
17
|
workgroupName: string;
|
|
18
18
|
user: string;
|
|
19
|
-
}): Promise<
|
|
19
|
+
}): Promise<string>;
|
|
20
20
|
grantUsageOnSchema(_: {
|
|
21
21
|
database: string;
|
|
22
22
|
workgroupName: string;
|
|
@@ -28,4 +28,8 @@ export declare class RedshiftDataService {
|
|
|
28
28
|
database: string;
|
|
29
29
|
workgroupName: string;
|
|
30
30
|
}): Promise<any>;
|
|
31
|
+
query(_: {
|
|
32
|
+
database: string;
|
|
33
|
+
workgroupName: string;
|
|
34
|
+
}, Sql: string): Promise<void>;
|
|
31
35
|
}
|