@l-v-yonsama/multi-platform-database-drivers 0.7.1 → 0.8.7
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/built/src/drivers/AwsDriver.d.ts +17 -3
- package/built/src/drivers/AwsDriver.js +78 -0
- package/built/src/drivers/AwsDriver.js.map +1 -1
- package/built/src/drivers/DBDriverResolver.d.ts +2 -0
- package/built/src/drivers/DBDriverResolver.js +7 -0
- package/built/src/drivers/DBDriverResolver.js.map +1 -1
- package/built/src/drivers/ISQLSupportDriver.d.ts +16 -0
- package/built/src/drivers/ISQLSupportDriver.js +16 -0
- package/built/src/drivers/ISQLSupportDriver.js.map +1 -0
- package/built/src/drivers/RDSBaseDriver.d.ts +3 -4
- package/built/src/drivers/RDSBaseDriver.js +28 -34
- package/built/src/drivers/RDSBaseDriver.js.map +1 -1
- package/built/src/drivers/aws/AwsCloudwatchServiceClient.js +3 -1
- package/built/src/drivers/aws/AwsCloudwatchServiceClient.js.map +1 -1
- package/built/src/drivers/aws/AwsDynamoServiceClient.d.ts +57 -0
- package/built/src/drivers/aws/AwsDynamoServiceClient.js +369 -0
- package/built/src/drivers/aws/AwsDynamoServiceClient.js.map +1 -0
- package/built/src/drivers/aws/index.d.ts +1 -0
- package/built/src/drivers/aws/index.js +1 -0
- package/built/src/drivers/aws/index.js.map +1 -1
- package/built/src/drivers/index.d.ts +1 -0
- package/built/src/drivers/index.js +1 -0
- package/built/src/drivers/index.js.map +1 -1
- package/built/src/examples/dynamo.d.ts +1 -0
- package/built/src/examples/dynamo.js +74 -0
- package/built/src/examples/dynamo.js.map +1 -0
- package/built/src/helpers/SQLHelper.js +46 -9
- package/built/src/helpers/SQLHelper.js.map +1 -1
- package/built/src/resource/DbResource.d.ts +26 -5
- package/built/src/resource/DbResource.js +63 -1
- package/built/src/resource/DbResource.js.map +1 -1
- package/built/src/types/helpers/index.d.ts +4 -4
- package/built/src/types/helpers/index.js.map +1 -1
- package/built/src/types/resource/AwsDynamoTableAttributes.d.ts +47 -0
- package/built/src/types/resource/AwsDynamoTableAttributes.js +3 -0
- package/built/src/types/resource/AwsDynamoTableAttributes.js.map +1 -0
- package/built/src/types/resource/AwsServiceType.d.ts +2 -1
- package/built/src/types/resource/AwsServiceType.js +1 -0
- package/built/src/types/resource/AwsServiceType.js.map +1 -1
- package/built/src/types/resource/PartiQLAttrType.d.ts +2 -0
- package/built/src/types/resource/PartiQLAttrType.js +38 -0
- package/built/src/types/resource/PartiQLAttrType.js.map +1 -0
- package/built/src/types/resource/ResourceType.d.ts +2 -0
- package/built/src/types/resource/ResourceType.js +2 -0
- package/built/src/types/resource/ResourceType.js.map +1 -1
- package/built/src/types/resource/index.d.ts +2 -0
- package/built/src/types/resource/index.js +2 -0
- package/built/src/types/resource/index.js.map +1 -1
- package/built/src/utils/dbType.d.ts +2 -1
- package/built/src/utils/dbType.js +8 -1
- package/built/src/utils/dbType.js.map +1 -1
- package/built/src/utils/driverUtil.d.ts +13 -0
- package/built/src/utils/driverUtil.js +35 -0
- package/built/src/utils/driverUtil.js.map +1 -0
- package/built/src/utils/index.d.ts +1 -0
- package/built/src/utils/index.js +1 -0
- package/built/src/utils/index.js.map +1 -1
- package/package.json +7 -2
|
@@ -5,6 +5,7 @@ tslib_1.__exportStar(require("./AwsRegion"), exports);
|
|
|
5
5
|
tslib_1.__exportStar(require("./AwsServiceType"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./AwsSQSAttributes"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./AwsSupplyCredentialType"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./AwsDynamoTableAttributes"), exports);
|
|
8
9
|
tslib_1.__exportStar(require("./ConnectionSetting"), exports);
|
|
9
10
|
tslib_1.__exportStar(require("./DBType"), exports);
|
|
10
11
|
tslib_1.__exportStar(require("./ForeignKeyConstraint"), exports);
|
|
@@ -13,4 +14,5 @@ tslib_1.__exportStar(require("./ResourceType"), exports);
|
|
|
13
14
|
tslib_1.__exportStar(require("./SQLServerAuthenticationType"), exports);
|
|
14
15
|
tslib_1.__exportStar(require("./SQLServerColumnType"), exports);
|
|
15
16
|
tslib_1.__exportStar(require("./UniqueKeyConstraint"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./PartiQLAttrType"), exports);
|
|
16
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/resource/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,2DAAiC;AACjC,6DAAmC;AACnC,oEAA0C;AAC1C,8DAAoC;AACpC,mDAAyB;AACzB,iEAAuC;AACvC,yDAA+B;AAC/B,yDAA+B;AAC/B,wEAA8C;AAC9C,gEAAsC;AACtC,gEAAsC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/resource/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,2DAAiC;AACjC,6DAAmC;AACnC,oEAA0C;AAC1C,qEAA2C;AAC3C,8DAAoC;AACpC,mDAAyB;AACzB,iEAAuC;AACvC,yDAA+B;AAC/B,yDAA+B;AAC/B,wEAA8C;AAC9C,gEAAsC;AACtC,gEAAsC;AACtC,4DAAkC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { DBType } from '../types';
|
|
1
|
+
import { AwsSetting, DBType } from '../types';
|
|
2
2
|
export declare const isAws: (dbType: DBType) => boolean;
|
|
3
3
|
export declare const isRDSType: (dbType: DBType) => boolean;
|
|
4
|
+
export declare const isPartiQLType: (dbType: DBType, awsSetting?: AwsSetting) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isRDSType = exports.isAws = void 0;
|
|
3
|
+
exports.isPartiQLType = exports.isRDSType = exports.isAws = void 0;
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const isAws = (dbType) => types_1.DBType.Aws === dbType;
|
|
6
6
|
exports.isAws = isAws;
|
|
@@ -15,4 +15,11 @@ const isRDSType = (dbType) => {
|
|
|
15
15
|
return false;
|
|
16
16
|
};
|
|
17
17
|
exports.isRDSType = isRDSType;
|
|
18
|
+
const isPartiQLType = (dbType, awsSetting) => {
|
|
19
|
+
if (dbType !== types_1.DBType.Aws || awsSetting === undefined) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return awsSetting.services.includes(types_1.AwsServiceType.DynamoDB);
|
|
23
|
+
};
|
|
24
|
+
exports.isPartiQLType = isPartiQLType;
|
|
18
25
|
//# sourceMappingURL=dbType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dbType.js","sourceRoot":"","sources":["../../../src/utils/dbType.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"dbType.js","sourceRoot":"","sources":["../../../src/utils/dbType.ts"],"names":[],"mappings":";;;AAAA,oCAA8D;AAEvD,MAAM,KAAK,GAAG,CAAC,MAAc,EAAW,EAAE,CAAC,cAAM,CAAC,GAAG,KAAK,MAAM,CAAC;AAA3D,QAAA,KAAK,SAAsD;AAEjE,MAAM,SAAS,GAAG,CAAC,MAAc,EAAW,EAAE;IACnD,QAAQ,MAAM,EAAE;QACd,KAAK,cAAM,CAAC,KAAK,CAAC;QAClB,KAAK,cAAM,CAAC,QAAQ,CAAC;QACrB,KAAK,cAAM,CAAC,SAAS,CAAC;QACtB,KAAK,cAAM,CAAC,MAAM;YAChB,OAAO,IAAI,CAAC;KACf;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AATW,QAAA,SAAS,aASpB;AAEK,MAAM,aAAa,GAAG,CAC3B,MAAc,EACd,UAAuB,EACd,EAAE;IACX,IAAI,MAAM,KAAK,cAAM,CAAC,GAAG,IAAI,UAAU,KAAK,SAAS,EAAE;QACrD,OAAO,KAAK,CAAC;KACd;IACD,OAAO,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,sBAAc,CAAC,QAAQ,CAAC,CAAC;AAC/D,CAAC,CAAC;AARW,QAAA,aAAa,iBAQxB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ResultSetDataBuilder } from '@l-v-yonsama/rdh';
|
|
2
|
+
import { QStatement, QueryParams } from '../types';
|
|
3
|
+
import { ITableComparable } from '../resource';
|
|
4
|
+
import { Statement } from 'pgsql-ast-parser';
|
|
5
|
+
export declare const setRdhMetaAndStatement: ({ connectionName, params, rdb, type, qst, tableComment, dbTable, }: {
|
|
6
|
+
connectionName: string;
|
|
7
|
+
params: QueryParams;
|
|
8
|
+
rdb: ResultSetDataBuilder;
|
|
9
|
+
type: Statement['type'];
|
|
10
|
+
qst: QStatement;
|
|
11
|
+
tableComment?: string;
|
|
12
|
+
dbTable?: ITableComparable;
|
|
13
|
+
}) => void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setRdhMetaAndStatement = void 0;
|
|
4
|
+
const setRdhMetaAndStatement = ({ connectionName, params, rdb, type, qst, tableComment, dbTable, }) => {
|
|
5
|
+
var _a, _b, _c;
|
|
6
|
+
const { sql, conditions, meta } = params;
|
|
7
|
+
rdb.setSqlStatement(sql);
|
|
8
|
+
let schemaName = meta === null || meta === void 0 ? void 0 : meta.schemaName;
|
|
9
|
+
let tableName = meta === null || meta === void 0 ? void 0 : meta.tableName;
|
|
10
|
+
const comment = (_a = meta === null || meta === void 0 ? void 0 : meta.comment) !== null && _a !== void 0 ? _a : tableComment;
|
|
11
|
+
let compareKeys = meta === null || meta === void 0 ? void 0 : meta.compareKeys;
|
|
12
|
+
if (!schemaName) {
|
|
13
|
+
schemaName = (_b = qst === null || qst === void 0 ? void 0 : qst.names) === null || _b === void 0 ? void 0 : _b.schemaName;
|
|
14
|
+
}
|
|
15
|
+
if (!tableName) {
|
|
16
|
+
tableName = (_c = qst === null || qst === void 0 ? void 0 : qst.names) === null || _c === void 0 ? void 0 : _c.tableName;
|
|
17
|
+
}
|
|
18
|
+
if (!rdb.rs.meta.compareKeys && !compareKeys) {
|
|
19
|
+
if (dbTable) {
|
|
20
|
+
compareKeys = dbTable.getCompareKeys(rdb.keynames());
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
rdb.updateMeta({
|
|
24
|
+
connectionName,
|
|
25
|
+
comment,
|
|
26
|
+
schemaName,
|
|
27
|
+
tableName,
|
|
28
|
+
compareKeys,
|
|
29
|
+
type,
|
|
30
|
+
editable: meta === null || meta === void 0 ? void 0 : meta.editable,
|
|
31
|
+
});
|
|
32
|
+
rdb.rs.queryConditions = conditions;
|
|
33
|
+
};
|
|
34
|
+
exports.setRdhMetaAndStatement = setRdhMetaAndStatement;
|
|
35
|
+
//# sourceMappingURL=driverUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driverUtil.js","sourceRoot":"","sources":["../../../src/utils/driverUtil.ts"],"names":[],"mappings":";;;AAKO,MAAM,sBAAsB,GAAG,CAAC,EACrC,cAAc,EACd,MAAM,EACN,GAAG,EACH,IAAI,EACJ,GAAG,EACH,YAAY,EACZ,OAAO,GASR,EAAQ,EAAE;;IACT,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IACzC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IACzB,IAAI,UAAU,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,CAAC;IAClC,IAAI,SAAS,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS,CAAC;IAChC,MAAM,OAAO,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,mCAAI,YAAY,CAAC;IAC9C,IAAI,WAAW,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,CAAC;IAEpC,IAAI,CAAC,UAAU,EAAE;QACf,UAAU,GAAG,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,0CAAE,UAAU,CAAC;KACrC;IACD,IAAI,CAAC,SAAS,EAAE;QACd,SAAS,GAAG,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,0CAAE,SAAS,CAAC;KACnC;IAED,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,EAAE;QAC5C,IAAI,OAAO,EAAE;YACX,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;SACtD;KACF;IACD,GAAG,CAAC,UAAU,CAAC;QACb,cAAc;QACd,OAAO;QACP,UAAU;QACV,SAAS;QACT,WAAW;QACX,IAAI;QACJ,QAAQ,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ;KACzB,CAAC,CAAC;IACH,GAAG,CAAC,EAAE,CAAC,eAAe,GAAG,UAAU,CAAC;AACtC,CAAC,CAAC;AA9CW,QAAA,sBAAsB,0BA8CjC"}
|
package/built/src/utils/index.js
CHANGED
|
@@ -5,4 +5,5 @@ tslib_1.__exportStar(require("./base"), exports);
|
|
|
5
5
|
tslib_1.__exportStar(require("./csv"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./dbType"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./jwt"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./driverUtil"), exports);
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,iDAAuB;AACvB,gDAAsB;AACtB,mDAAyB;AACzB,gDAAsB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,iDAAuB;AACvB,gDAAsB;AACtB,mDAAyB;AACzB,gDAAsB;AACtB,uDAA6B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@l-v-yonsama/multi-platform-database-drivers",
|
|
3
|
-
"version": "0.7
|
|
3
|
+
"version": "0.8.7",
|
|
4
4
|
"description": "multi-platform database drivers in TypeScript.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">= 18"
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"@types/humanize-duration": "^3.27.2",
|
|
13
13
|
"@types/jest": "~29.2",
|
|
14
14
|
"@types/json-rules-engine": "^4.1.0",
|
|
15
|
+
"@types/lodash.chunk": "^4.2.9",
|
|
15
16
|
"@types/lodash.isequal": "^4.5.6",
|
|
16
17
|
"@types/mssql": "^9.1.5",
|
|
17
18
|
"@types/node": "~18",
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
"prepublishOnly": "npm run build:release",
|
|
45
46
|
"lint": "eslint . --ext .ts --ext .mts",
|
|
46
47
|
"lint:fix": "eslint --fix . --ext .ts --ext .mts",
|
|
48
|
+
"examples:dynamo": "npm run build && node built/src/examples/dynamo.js",
|
|
47
49
|
"examples:mysql": "npm run build && node built/src/examples/mysql.js",
|
|
48
50
|
"examples:mysql2": "npm run build && node built/src/examples/mysql2.js",
|
|
49
51
|
"examples:mssql": "npm run build && node built/src/examples/mssql.js",
|
|
@@ -79,12 +81,14 @@
|
|
|
79
81
|
"license": "MIT",
|
|
80
82
|
"dependencies": {
|
|
81
83
|
"@aws-sdk/client-cloudwatch-logs": "^3.306.0",
|
|
84
|
+
"@aws-sdk/client-dynamodb": "^3.654.0",
|
|
82
85
|
"@aws-sdk/client-s3": "^3.279.0",
|
|
83
86
|
"@aws-sdk/client-ses": "^3.398.0",
|
|
84
87
|
"@aws-sdk/client-sqs": "^3.398.0",
|
|
85
88
|
"@aws-sdk/credential-providers": "^3.279.0",
|
|
89
|
+
"@aws-sdk/lib-dynamodb": "^3.656.0",
|
|
86
90
|
"@aws-sdk/s3-request-presigner": "^3.427.0",
|
|
87
|
-
"@l-v-yonsama/rdh": "^0.1.
|
|
91
|
+
"@l-v-yonsama/rdh": "^0.1.13",
|
|
88
92
|
"auth0": "^3.7.1",
|
|
89
93
|
"axios": "^1.6.0",
|
|
90
94
|
"bytes": "^3.1.2",
|
|
@@ -96,6 +100,7 @@
|
|
|
96
100
|
"ioredis": "^5.3.1",
|
|
97
101
|
"json-rules-engine": "^6.5.0",
|
|
98
102
|
"jwt-decode": "^4.0.0",
|
|
103
|
+
"lodash.chunk": "^4.2.0",
|
|
99
104
|
"mime-lite": "^1.0.3",
|
|
100
105
|
"mssql": "^11.0.1",
|
|
101
106
|
"mysql2": "^3.1.2",
|