@l-v-yonsama/multi-platform-database-drivers 0.10.24 → 0.10.25
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/package.json +3 -2
- package/built/src/examples/auth0.d.ts +0 -1
- package/built/src/examples/auth0.js +0 -37
- package/built/src/examples/auth0.js.map +0 -1
- package/built/src/examples/aws.d.ts +0 -1
- package/built/src/examples/aws.js +0 -37
- package/built/src/examples/aws.js.map +0 -1
- package/built/src/examples/cw.d.ts +0 -1
- package/built/src/examples/cw.js +0 -46
- package/built/src/examples/cw.js.map +0 -1
- package/built/src/examples/dynamo.d.ts +0 -1
- package/built/src/examples/dynamo.js +0 -73
- package/built/src/examples/dynamo.js.map +0 -1
- package/built/src/examples/keycloak.d.ts +0 -1
- package/built/src/examples/keycloak.js +0 -35
- package/built/src/examples/keycloak.js.map +0 -1
- package/built/src/examples/mssql.d.ts +0 -1
- package/built/src/examples/mssql.js +0 -36
- package/built/src/examples/mssql.js.map +0 -1
- package/built/src/examples/mssql2.d.ts +0 -1
- package/built/src/examples/mssql2.js +0 -42
- package/built/src/examples/mssql2.js.map +0 -1
- package/built/src/examples/mysql.d.ts +0 -1
- package/built/src/examples/mysql.js +0 -42
- package/built/src/examples/mysql.js.map +0 -1
- package/built/src/examples/mysql2.d.ts +0 -1
- package/built/src/examples/mysql2.js +0 -50
- package/built/src/examples/mysql2.js.map +0 -1
- package/built/src/examples/postgres.d.ts +0 -1
- package/built/src/examples/postgres.js +0 -47
- package/built/src/examples/postgres.js.map +0 -1
- package/built/src/examples/rules.d.ts +0 -1
- package/built/src/examples/rules.js +0 -31
- package/built/src/examples/rules.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@l-v-yonsama/multi-platform-database-drivers",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.25",
|
|
4
4
|
"description": "multi-platform database drivers in TypeScript.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">= 18"
|
|
@@ -37,11 +37,12 @@
|
|
|
37
37
|
"scripts": {
|
|
38
38
|
"start": "node built/src/index.js",
|
|
39
39
|
"clean": "rimraf coverage built tmp",
|
|
40
|
+
"clean:examples": "rimraf built/src/examples",
|
|
40
41
|
"prebuild": "npm run lint",
|
|
41
42
|
"doc": "typedoc --cleanOutputDir --excludePrivate --plugin typedoc-plugin-markdown --out doc src",
|
|
42
43
|
"build": "npm run clean && tsc -p tsconfig.json",
|
|
43
44
|
"build:watch": "npm run clean && tsc -w -p tsconfig.json",
|
|
44
|
-
"build:release": "npm run clean && tsc -p tsconfig.release.json && npm run doc",
|
|
45
|
+
"build:release": "npm run clean && tsc -p tsconfig.release.json && npm run clean:examples && npm run doc",
|
|
45
46
|
"prepublishOnly": "npm run build:release",
|
|
46
47
|
"lint": "eslint . --ext .ts --ext .mts",
|
|
47
48
|
"lint:fix": "eslint --fix . --ext .ts --ext .mts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'dotenv/config';
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a, _b, _c;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const rdh_1 = require("@l-v-yonsama/rdh");
|
|
6
|
-
require("dotenv/config");
|
|
7
|
-
const drivers_1 = require("../drivers");
|
|
8
|
-
const types_1 = require("../types");
|
|
9
|
-
const domain = (_a = process.env.TEST_AUTH0_DOMAIN) !== null && _a !== void 0 ? _a : '';
|
|
10
|
-
const clientId = (_b = process.env.TEST_AUTH0_CLIENT_ID) !== null && _b !== void 0 ? _b : '';
|
|
11
|
-
const clientSecret = (_c = process.env.TEST_AUTH0_CLIENT_SECRET) !== null && _c !== void 0 ? _c : '';
|
|
12
|
-
const connectOption = {
|
|
13
|
-
name: 'localAuth0',
|
|
14
|
-
dbType: types_1.DBType.Auth0,
|
|
15
|
-
host: domain,
|
|
16
|
-
iamSolution: {
|
|
17
|
-
clientId,
|
|
18
|
-
clientSecret,
|
|
19
|
-
grantType: 'client_credentials',
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
const { ok, message, result } = yield drivers_1.DBDriverResolver.getInstance().workflow(connectOption, (driver) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
return yield driver.scan({
|
|
25
|
-
target: '',
|
|
26
|
-
limit: 100,
|
|
27
|
-
targetResourceType: 'IamUser',
|
|
28
|
-
});
|
|
29
|
-
}));
|
|
30
|
-
console.log('ok', ok);
|
|
31
|
-
console.log('message', message);
|
|
32
|
-
console.log(rdh_1.ResultSetDataBuilder.from(result).toString({
|
|
33
|
-
withType: true,
|
|
34
|
-
withComment: true,
|
|
35
|
-
}));
|
|
36
|
-
}))();
|
|
37
|
-
//# sourceMappingURL=auth0.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth0.js","sourceRoot":"","sources":["../../../src/examples/auth0.ts"],"names":[],"mappings":";;;;AAAA,0CAAwD;AACxD,yBAAuB;AACvB,wCAA2D;AAC3D,oCAAqD;AAErD,MAAM,MAAM,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,iBAAiB,mCAAI,EAAE,CAAC;AACnD,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,oBAAoB,mCAAI,EAAE,CAAC;AACxD,MAAM,YAAY,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,wBAAwB,mCAAI,EAAE,CAAC;AAEhE,MAAM,aAAa,GAAsB;IACvC,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,cAAM,CAAC,KAAK;IAEpB,IAAI,EAAE,MAAM;IAGZ,WAAW,EAAE;QACX,QAAQ;QACR,YAAY;QACZ,SAAS,EAAE,oBAAoB;KAChC;CACF,CAAC;AAEF,CAAC,GAAwB,EAAE;IACzB,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAC3B,MAAM,0BAAgB,CAAC,WAAW,EAAE,CAAC,QAAQ,CAC3C,aAAa,EACb,CAAO,MAAM,EAAE,EAAE;QASf,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC;YACvB,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,GAAG;YACV,kBAAkB,EAAE,SAAS;SAC9B,CAAC,CAAC;IACL,CAAC,CAAA,CACF,CAAC;IAEJ,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACtB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAEhC,OAAO,CAAC,GAAG,CACT,0BAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC;QACzC,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,IAAI;KAClB,CAAC,CACH,CAAC;AACJ,CAAC,CAAA,CAAC,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const rdh_1 = require("@l-v-yonsama/rdh");
|
|
5
|
-
const drivers_1 = require("../drivers");
|
|
6
|
-
const types_1 = require("../types");
|
|
7
|
-
const connectOption = {
|
|
8
|
-
dbType: types_1.DBType.Aws,
|
|
9
|
-
name: 'localAws',
|
|
10
|
-
awsSetting: {
|
|
11
|
-
supplyCredentialType: types_1.SupplyCredentialType.sharedCredentialsFile,
|
|
12
|
-
services: [types_1.AwsServiceType.S3],
|
|
13
|
-
region: types_1.AwsRegion.apNortheast1,
|
|
14
|
-
profile: 'cloudberry',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const { ok, message, result } = yield drivers_1.DBDriverResolver.getInstance().workflow(connectOption, (driver) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
yield driver.getInfomationSchemas();
|
|
20
|
-
console.log('L64');
|
|
21
|
-
const rs = yield driver.s3Client.scan({
|
|
22
|
-
targetResourceType: 'Bucket',
|
|
23
|
-
target: 'aas.hikari-tech-labo.work',
|
|
24
|
-
keyword: '',
|
|
25
|
-
limit: 100,
|
|
26
|
-
startTime: 976114800,
|
|
27
|
-
endTime: 1733065200,
|
|
28
|
-
withValue: { limitSize: 100000 },
|
|
29
|
-
});
|
|
30
|
-
console.log('L73');
|
|
31
|
-
return rs;
|
|
32
|
-
}));
|
|
33
|
-
console.log('ok', ok);
|
|
34
|
-
console.log('message', message);
|
|
35
|
-
console.log(rdh_1.ResultSetDataBuilder.from(result).toString({ withType: true }));
|
|
36
|
-
}))();
|
|
37
|
-
//# sourceMappingURL=aws.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aws.js","sourceRoot":"","sources":["../../../src/examples/aws.ts"],"names":[],"mappings":";;;AAAA,0CAA8E;AAC9E,wCAAyD;AACzD,oCAMkB;AAIlB,MAAM,aAAa,GAAsB;IAIvC,MAAM,EAAE,cAAM,CAAC,GAAG;IAClB,IAAI,EAAE,UAAU;IAChB,UAAU,EAAE;QACV,oBAAoB,EAAE,4BAAoB,CAAC,qBAAqB;QAChE,QAAQ,EAAE,CAAC,sBAAc,CAAC,EAAE,CAAC;QAC7B,MAAM,EAAE,iBAAS,CAAC,YAAY;QAC9B,OAAO,EAAE,YAAY;KACtB;CACF,CAAC;AAaF,CAAC,GAAwB,EAAE;IACzB,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,0BAAgB,CAAC,WAAW,EAAE,CAAC,QAAQ,CAG3E,aAAa,EAAE,CAAO,MAAM,EAAE,EAAE;QAChC,MAAM,MAAM,CAAC,oBAAoB,EAAE,CAAC;QAqBpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAwBnB,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YACpC,kBAAkB,EAAE,QAAQ;YAC5B,MAAM,EAAE,2BAA2B;YACnC,OAAO,EAAE,EAAE;YACX,KAAK,EAAE,GAAG;YACV,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,UAAU;YACnB,SAAS,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE;SACjC,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,OAAO,EAAE,CAAC;IAyEZ,CAAC,CAAA,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACtB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,0BAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC9E,CAAC,CAAA,CAAC,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/built/src/examples/cw.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const drivers_1 = require("../drivers");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
const connectOption = {
|
|
7
|
-
url: 'http://localhost:6005',
|
|
8
|
-
user: 'test',
|
|
9
|
-
password: 'test',
|
|
10
|
-
dbType: types_1.DBType.Aws,
|
|
11
|
-
name: 'localAws',
|
|
12
|
-
awsSetting: {
|
|
13
|
-
supplyCredentialType: types_1.SupplyCredentialType.ExplicitInProperty,
|
|
14
|
-
services: [types_1.AwsServiceType.Cloudwatch],
|
|
15
|
-
region: types_1.AwsRegion.apNortheast1,
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const { ok, message, result } = yield drivers_1.DBDriverResolver.getInstance().workflow(connectOption, (driver) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
const r = yield driver.getInfomationSchemas();
|
|
21
|
-
console.log(JSON.stringify(r, null, 2));
|
|
22
|
-
const logStreams = yield driver.cloudwatchClient.getLogStreams({
|
|
23
|
-
logGroupName: '/aws/lambda/helloWorld',
|
|
24
|
-
});
|
|
25
|
-
console.log(logStreams);
|
|
26
|
-
const logEvents = yield driver.cloudwatchClient.getLogEvents({
|
|
27
|
-
logGroupName: '/aws/lambda/helloWorld',
|
|
28
|
-
logStreamName: logStreams[0].logStreamName,
|
|
29
|
-
});
|
|
30
|
-
console.log(logEvents.map((e) => `[${e.timestamp}] ${e.message}`));
|
|
31
|
-
const rdh = yield driver.cloudwatchClient.query({
|
|
32
|
-
logGroupName: '/aws/lambda/helloWorld',
|
|
33
|
-
limit: 100,
|
|
34
|
-
queryString: `fields @timestamp, @message
|
|
35
|
-
| filter @message like /"status": "500"/
|
|
36
|
-
| sort @timestamp asc`,
|
|
37
|
-
startTime: 1729609200,
|
|
38
|
-
endTime: undefined,
|
|
39
|
-
});
|
|
40
|
-
console.log(JSON.stringify(rdh.results, null, 2));
|
|
41
|
-
return null;
|
|
42
|
-
}));
|
|
43
|
-
console.log('ok', ok);
|
|
44
|
-
console.log('message', message);
|
|
45
|
-
}))();
|
|
46
|
-
//# sourceMappingURL=cw.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cw.js","sourceRoot":"","sources":["../../../src/examples/cw.ts"],"names":[],"mappings":";;;AACA,wCAAyD;AACzD,oCAMkB;AAElB,MAAM,aAAa,GAAsB;IACvC,GAAG,EAAE,uBAAuB;IAC5B,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AE;;sBAEG;YAChB,SAAS,EAAE,UAAU;YACrB,OAAO,EAAE,SAAS;SACnB,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;IAEd,CAAC,CAAA,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACtB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAIlC,CAAC,CAAA,CAAC,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
-
const client = new client_dynamodb_1.DynamoDBClient({
|
|
6
|
-
region: 'us-east-1',
|
|
7
|
-
endpoint: 'http://localhost:6005',
|
|
8
|
-
credentials: {
|
|
9
|
-
accessKeyId: 'test',
|
|
10
|
-
secretAccessKey: 'test',
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
function listTables() {
|
|
14
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
15
|
-
let lastEvaluatedTableName = undefined;
|
|
16
|
-
const command = new client_dynamodb_1.ListTablesCommand({
|
|
17
|
-
ExclusiveStartTableName: lastEvaluatedTableName,
|
|
18
|
-
});
|
|
19
|
-
const tableNames = [];
|
|
20
|
-
do {
|
|
21
|
-
const response = yield client.send(command);
|
|
22
|
-
lastEvaluatedTableName = response.LastEvaluatedTableName;
|
|
23
|
-
tableNames.push(...response.TableNames);
|
|
24
|
-
} while (lastEvaluatedTableName);
|
|
25
|
-
yield Promise.all(tableNames.map((it) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
const res = yield client.send(new client_dynamodb_1.DescribeTableCommand({
|
|
27
|
-
TableName: tableNames[0],
|
|
28
|
-
}));
|
|
29
|
-
console.log(res.Table);
|
|
30
|
-
})));
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
function createTable() {
|
|
34
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
const command = new client_dynamodb_1.CreateTableCommand({
|
|
36
|
-
TableName: 'EspressoDrinks',
|
|
37
|
-
AttributeDefinitions: [
|
|
38
|
-
{
|
|
39
|
-
AttributeName: 'DrinkName',
|
|
40
|
-
AttributeType: 'S',
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
KeySchema: [
|
|
44
|
-
{
|
|
45
|
-
AttributeName: 'DrinkName',
|
|
46
|
-
KeyType: 'HASH',
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
ProvisionedThroughput: {
|
|
50
|
-
ReadCapacityUnits: 1,
|
|
51
|
-
WriteCapacityUnits: 1,
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
const response = yield client.send(command);
|
|
55
|
-
console.log(response);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function putItem() {
|
|
59
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
const command = new client_dynamodb_1.PutItemCommand({
|
|
61
|
-
TableName: 'EspressoDrinks',
|
|
62
|
-
Item: {
|
|
63
|
-
DrinkName: { S: 'Shiba Inu' },
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
const response = yield client.send(command);
|
|
67
|
-
console.log(response);
|
|
68
|
-
return response;
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
72
|
-
}))();
|
|
73
|
-
//# sourceMappingURL=dynamo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamo.js","source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BAC1B,OAAO,EAAE,MAAM;iBAChB;aACF;YACD,qBAAqB,EAAE;gBACrB,iBAAiB,EAAE,CAAC;gBACpB,kBAAkB,EAAE,CAAC;aACtB;SACF,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxB,CAAC;CAAA;AAED,SAAe,OAAO;;QACpB,MAAM,OAAO,GAAG,IAAI,gCAAc,CAAC;YACjC,SAAS,EAAE,gBAAgB;YAC3B,IAAI,EAAE;gBACJ,SAAS,EAAE,EAAE,CAAC,EAAE,WAAW,EAAE;aAC9B;SACF,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,OAAO,QAAQ,CAAC;IAClB,CAAC;CAAA;AAED,CAAC,GAAS,EAAE;AAKZ,CAAC,CAAA,CAAC,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'dotenv/config';
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const rdh_1 = require("@l-v-yonsama/rdh");
|
|
5
|
-
require("dotenv/config");
|
|
6
|
-
const drivers_1 = require("../drivers");
|
|
7
|
-
const types_1 = require("../types");
|
|
8
|
-
const connectOption = {
|
|
9
|
-
name: 'localKeycloak',
|
|
10
|
-
dbType: types_1.DBType.Keycloak,
|
|
11
|
-
database: 'master',
|
|
12
|
-
url: 'http://localhost:6100',
|
|
13
|
-
user: 'admin',
|
|
14
|
-
password: 'admin',
|
|
15
|
-
iamSolution: {
|
|
16
|
-
clientId: 'admin-cli',
|
|
17
|
-
grantType: 'password',
|
|
18
|
-
retrieveClientResOnConnection: true,
|
|
19
|
-
retrieveGroupOrOrgResOnConnection: true,
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
const { ok, message } = yield drivers_1.DBDriverResolver.getInstance().workflow(connectOption, (driver) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
const a = yield driver.scan({
|
|
25
|
-
limit: 100,
|
|
26
|
-
target: 'test-realm-99',
|
|
27
|
-
targetResourceType: 'IamUser',
|
|
28
|
-
jsonExpansion: true,
|
|
29
|
-
});
|
|
30
|
-
console.log(rdh_1.ResultSetDataBuilder.from(a).toString());
|
|
31
|
-
}));
|
|
32
|
-
console.log('ok', ok);
|
|
33
|
-
console.log('message', message);
|
|
34
|
-
}))();
|
|
35
|
-
//# sourceMappingURL=keycloak.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keycloak.js","sourceRoot":"","sources":["../../../src/examples/keycloak.ts"],"names":[],"mappings":";;;AAAA,0CAAwD;AACxD,yBAAuB;AACvB,wCAA8D;AAC9D,oCAAqD;AAErD,MAAM,aAAa,GAAsB;IACvC,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,cAAM,CAAC,QAAQ;IACvB,QAAQ,EAAE,QAAQ;IAClB,GAAG,EAAE,uBAAuB;IAC5B,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,OAAO;IACjB,WAAW,EAAE;QACX,QAAQ,EAAE,WAAW;QACrB,SAAS,EAAE,UAAU;QACrB,6BAA6B,EAAE,IAAI;QACnC,iCAAiC,EAAE,IAAI;KACxC;CACF,CAAC;AAEF,CAAC,GAAwB,EAAE;IACzB,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,GACnB,MAAM,0BAAgB,CAAC,WAAW,EAAE,CAAC,QAAQ,CAC3C,aAAa,EACb,CAAO,MAAM,EAAE,EAAE;QASf,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC;YAC1B,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,eAAe;YACvB,kBAAkB,EAAE,SAAS;YAC7B,aAAa,EAAE,IAAI;SACpB,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,0BAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IACvD,CAAC,CAAA,CACF,CAAC;IAEJ,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACtB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAClC,CAAC,CAAA,CAAC,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const rdh_1 = require("@l-v-yonsama/rdh");
|
|
5
|
-
const drivers_1 = require("../drivers");
|
|
6
|
-
const types_1 = require("../types");
|
|
7
|
-
const connectOption = {
|
|
8
|
-
host: '127.0.0.1',
|
|
9
|
-
port: 6433,
|
|
10
|
-
user: 'testuser',
|
|
11
|
-
password: 'Pass123zxcv!2',
|
|
12
|
-
database: 'testdb',
|
|
13
|
-
dbType: types_1.DBType.SQLServer,
|
|
14
|
-
name: 'mssql',
|
|
15
|
-
sqlServer: {
|
|
16
|
-
encrypt: false,
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
const { ok, message, result } = yield drivers_1.DBDriverResolver.getInstance().workflow(connectOption, (driver) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
-
yield driver.getInfomationSchemas();
|
|
22
|
-
const rdh0 = yield driver.requestSql({
|
|
23
|
-
sql: `select STRING_AGG(name, ',') WITHIN GROUP (ORDER BY country_code) AS names from city`,
|
|
24
|
-
});
|
|
25
|
-
console.log('----- rdh0 ----');
|
|
26
|
-
console.log(rdh_1.ResultSetDataBuilder.from(rdh0).toMarkdown({
|
|
27
|
-
withType: true,
|
|
28
|
-
withComment: true,
|
|
29
|
-
}));
|
|
30
|
-
return rdh0;
|
|
31
|
-
}));
|
|
32
|
-
console.log('ok', ok);
|
|
33
|
-
console.log('message', message);
|
|
34
|
-
console.log(result === null || result === void 0 ? void 0 : result.meta);
|
|
35
|
-
}))();
|
|
36
|
-
//# sourceMappingURL=mssql.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mssql.js","sourceRoot":"","sources":["../../../src/examples/mssql.ts"],"names":[],"mappings":";;;AAAA,0CAAwD;AACxD,wCAA6D;AAC7D,oCAAqD;AA0BrD,MAAM,aAAa,GAAsB;IACvC,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,eAAe;IACzB,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,cAAM,CAAC,SAAS;IACxB,IAAI,EAAE,OAAO;IACb,SAAS,EAAE;QAET,OAAO,EAAE,KAAK;KAGf;CACF,CAAC;AAQF,CAAC,GAAwB,EAAE;IACzB,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAC3B,MAAM,0BAAgB,CAAC,WAAW,EAAE,CAAC,QAAQ,CAC3C,aAAa,EACb,CAAO,MAAM,EAAE,EAAE;QACf,MAAM,MAAM,CAAC,oBAAoB,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC;YACnC,GAAG,EAAE,sFAAsF;SAC5F,CAAC,CAAC;QAIH,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,CACT,0BAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC;YACzC,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,IAAI;SAClB,CAAC,CACH,CAAC;QAQF,OAAO,IAAI,CAAC;IAKd,CAAC,CAAA,CACF,CAAC;IAEJ,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACtB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAEhC,OAAO,CAAC,GAAG,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAA,CAAC,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const tedious_1 = require("tedious");
|
|
5
|
-
const username = process.env.AZURE_SQL_USERNAME || 'alice@lvyoshiokagmail.onmicrosoft.com';
|
|
6
|
-
const password = process.env.AZURE_SQL_PASSWORD || 'Gogo8190';
|
|
7
|
-
const clientId = process.env.AZURE_CLIENT_ID || '09fdd30b-d878-4fd1-8918-0025792028cf';
|
|
8
|
-
const tenantId = process.env.AZURE_TENANT_ID || 'a6e3d477-81b5-433b-ae9f-aa2ef0c00ed5';
|
|
9
|
-
(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
10
|
-
try {
|
|
11
|
-
const config = {
|
|
12
|
-
server: 'testyo3.database.windows.net',
|
|
13
|
-
database: 'testyo3',
|
|
14
|
-
options: {
|
|
15
|
-
encrypt: true,
|
|
16
|
-
},
|
|
17
|
-
authentication: {
|
|
18
|
-
type: 'azure-active-directory-service-principal-secret',
|
|
19
|
-
options: {
|
|
20
|
-
clientId: clientId,
|
|
21
|
-
tenantId: tenantId,
|
|
22
|
-
clientSecret: '_OR8Q~bGCvLnV2slEvLaS62OG0wBXkGTSaufsaXk',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
console.log(config);
|
|
27
|
-
const connection = new tedious_1.Connection(config);
|
|
28
|
-
connection.on('connect', (err) => {
|
|
29
|
-
if (err) {
|
|
30
|
-
console.error('Connection failed', err);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
console.log('Connected to Azure SQL Database');
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
connection.connect();
|
|
37
|
-
}
|
|
38
|
-
catch (err) {
|
|
39
|
-
console.error('Error:', err);
|
|
40
|
-
}
|
|
41
|
-
}))();
|
|
42
|
-
//# sourceMappingURL=mssql2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mssql2.js","sourceRoot":"","sources":["../../../src/examples/mssql2.ts"],"names":[],"mappings":";;;AA6BA,qCAA8C;AAG9C,MAAM,QAAQ,GACZ,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,uCAAuC,CAAC;AAC5E,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,UAAU,CAAC;AAC9D,MAAM,QAAQ,GACZ,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,sCAAsC,CAAC;AACxE,MAAM,QAAQ,GACZ,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,sCAAsC,CAAC;AAExE,CAAC,GAAwB,EAAE;IACzB,IAAI;QACF,MAAM,MAAM,GAAG;YACb,MAAM,EAAE,8BAA8B;YACtC,QAAQ,EAAE,SAAS;YACnB,OAAO,EAAE;gBACP,OAAO,EAAE,IAAI;aACd;YACD,cAAc,EAAE;gBACd,IAAI,EAAE,iDAAiD;gBACvD,OAAO,EAAE;oBAGP,QAAQ,EAAE,QAAQ;oBAClB,QAAQ,EAAE,QAAQ;oBAClB,YAAY,EAAE,0CAA0C;iBACzD;aACF;SACF,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAEpB,MAAM,UAAU,GAAG,IAAI,oBAAU,CAAC,MAAa,CAAC,CAAC;QAEjD,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE;YAC/B,IAAI,GAAG,EAAE;gBACP,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC;aACzC;iBAAM;gBACL,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;aAEhD;QACH,CAAC,CAAC,CAAC;QAEH,UAAU,CAAC,OAAO,EAAE,CAAC;KACtB;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;KAC9B;AACH,CAAC,CAAA,CAAC,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const rdh_1 = require("@l-v-yonsama/rdh");
|
|
5
|
-
const drivers_1 = require("../drivers");
|
|
6
|
-
const types_1 = require("../types");
|
|
7
|
-
const connectOption = {
|
|
8
|
-
host: '127.0.0.1',
|
|
9
|
-
port: 6001,
|
|
10
|
-
user: 'root',
|
|
11
|
-
password: 'p@ssw0rd',
|
|
12
|
-
database: 'testdb',
|
|
13
|
-
dbType: types_1.DBType.MySQL,
|
|
14
|
-
name: 'mysql',
|
|
15
|
-
};
|
|
16
|
-
(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
console.log('start mysql');
|
|
18
|
-
const { ok, message, result } = yield drivers_1.DBDriverResolver.getInstance().workflow(connectOption, (driver) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
console.log('L25');
|
|
20
|
-
const rdh0 = yield driver.requestSql({
|
|
21
|
-
sql: `show variables like 'log_bin_trust_function_creators'`,
|
|
22
|
-
});
|
|
23
|
-
console.log('L29');
|
|
24
|
-
console.log('----- rdh0 ----');
|
|
25
|
-
console.log(rdh_1.ResultSetDataBuilder.from(rdh0).toString());
|
|
26
|
-
console.log('L32');
|
|
27
|
-
const rdh1 = yield driver.requestSql({
|
|
28
|
-
sql: `SET GLOBAL log_bin_trust_function_creators = 1`,
|
|
29
|
-
});
|
|
30
|
-
console.log('----- rdh1 ----');
|
|
31
|
-
console.log(rdh_1.ResultSetDataBuilder.from(rdh1).toString());
|
|
32
|
-
const rdh2 = yield driver.requestSql({
|
|
33
|
-
sql: `show variables like 'log_bin_trust_function_creators'`,
|
|
34
|
-
});
|
|
35
|
-
console.log('----- rdh2 ----');
|
|
36
|
-
console.log(rdh_1.ResultSetDataBuilder.from(rdh2).toString());
|
|
37
|
-
}));
|
|
38
|
-
console.log('ok', ok);
|
|
39
|
-
console.log('message', message);
|
|
40
|
-
console.log(result.meta);
|
|
41
|
-
}))();
|
|
42
|
-
//# sourceMappingURL=mysql.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mysql.js","sourceRoot":"","sources":["../../../src/examples/mysql.ts"],"names":[],"mappings":";;;AAAA,0CAAwD;AACxD,wCAA2D;AAC3D,oCAAqD;AAYrD,MAAM,aAAa,GAAsB;IACvC,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,cAAM,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO;CACd,CAAC;AAEF,CAAC,GAAwB,EAAE;IACzB,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC3B,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAC3B,MAAM,0BAAgB,CAAC,WAAW,EAAE,CAAC,QAAQ,CAC3C,aAAa,EACb,CAAO,MAAM,EAAE,EAAE;QAKf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,C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
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const rdh_1 = require("@l-v-yonsama/rdh");
|
|
5
|
-
const drivers_1 = require("../drivers");
|
|
6
|
-
const types_1 = require("../types");
|
|
7
|
-
const connectOption = {
|
|
8
|
-
host: '127.0.0.1',
|
|
9
|
-
port: 6001,
|
|
10
|
-
user: 'root',
|
|
11
|
-
password: 'p@ssw0rd',
|
|
12
|
-
database: 'testdb',
|
|
13
|
-
dbType: types_1.DBType.MySQL,
|
|
14
|
-
name: 'mysql',
|
|
15
|
-
};
|
|
16
|
-
(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
console.log('start mysql');
|
|
18
|
-
const driver1 = drivers_1.DBDriverResolver.getInstance().createRDSDriver(connectOption);
|
|
19
|
-
const driver2 = drivers_1.DBDriverResolver.getInstance().createRDSDriver(Object.assign(Object.assign({}, connectOption), { name: 'mysql2' }));
|
|
20
|
-
yield driver1.connect();
|
|
21
|
-
yield driver2.connect();
|
|
22
|
-
try {
|
|
23
|
-
yield driver1.begin();
|
|
24
|
-
yield driver2.begin();
|
|
25
|
-
const rs1 = yield driver1.requestSql({
|
|
26
|
-
sql: 'select * from test where id=15 for update;',
|
|
27
|
-
});
|
|
28
|
-
console.log('rs1', rdh_1.ResultSetDataBuilder.from(rs1).toString());
|
|
29
|
-
const locks = yield driver2.getLocks('testdb');
|
|
30
|
-
console.log('locks', rdh_1.ResultSetDataBuilder.from(locks).toMarkdown());
|
|
31
|
-
const rs2 = yield driver2.requestSql({
|
|
32
|
-
sql: 'insert into test (id,value) value(11, 20);',
|
|
33
|
-
});
|
|
34
|
-
console.log('rs2', rdh_1.ResultSetDataBuilder.from(rs2).toString());
|
|
35
|
-
yield driver1.commit();
|
|
36
|
-
yield driver2.commit();
|
|
37
|
-
console.log('ok');
|
|
38
|
-
}
|
|
39
|
-
catch (e) {
|
|
40
|
-
console.error(e);
|
|
41
|
-
yield driver1.rollback();
|
|
42
|
-
yield driver2.rollback();
|
|
43
|
-
}
|
|
44
|
-
finally {
|
|
45
|
-
yield driver1.disconnect();
|
|
46
|
-
yield driver2.disconnect();
|
|
47
|
-
}
|
|
48
|
-
console.log('end');
|
|
49
|
-
}))();
|
|
50
|
-
//# sourceMappingURL=mysql2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mysql2.js","sourceRoot":"","sources":["../../../src/examples/mysql2.ts"],"names":[],"mappings":";;;AAAA,0CAAwD;AACxD,wCAA2D;AAC3D,oCAAqD;AAErD,MAAM,aAAa,GAAsB;IACvC,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,cAAM,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO;CACd,CAAC;AAEF,CAAC,GAAwB,EAAE;IACzB,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAE3B,MAAM,OAAO,GACX,0BAAgB,CAAC,WAAW,EAAE,CAAC,eAAe,CAAc,aAAa,CAAC,CAAC;IAC7E,MAAM,OAAO,GAAG,0BAAgB,CAAC,WAAW,EAAE,CAAC,eAAe,iCACzD,aAAa,KAChB,IAAI,EAAE,QAAQ,IACd,CAAC;IAEH,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IACxB,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IAExB,IAAI;QACF,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACtB,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QAEtB,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC;YACnC,GAAG,EAAE,4CAA4C;SAClD,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,0BAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAE9D,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC/C,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,0BAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;QAEpE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC;YACnC,GAAG,EAAE,4CAA4C;SAClD,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,0BAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAE9D,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC;QACvB,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;KACnB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjB,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzB,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC;KAC1B;YAAS;QACR,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;QAC3B,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;KAC5B;IAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACrB,CAAC,CAAA,CAAC,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function setupMassiveData(): Promise<void>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupMassiveData = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
const pg_1 = tslib_1.__importDefault(require("pg"));
|
|
7
|
-
const baseConnectOption = {
|
|
8
|
-
host: '127.0.0.1',
|
|
9
|
-
port: 6002,
|
|
10
|
-
user: 'testuser',
|
|
11
|
-
password: 'testpass',
|
|
12
|
-
database: 'testdb',
|
|
13
|
-
};
|
|
14
|
-
const connectOption = Object.assign(Object.assign({}, baseConnectOption), { dbType: types_1.DBType.Postgres, name: 'postgres' });
|
|
15
|
-
function setupMassiveData() {
|
|
16
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const options = Object.assign({}, Object.assign({ max: 1, idleTimeoutMillis: 3000, connectionTimeoutMillis: 1000 }, baseConnectOption));
|
|
18
|
-
const pool = new pg_1.default.Pool(options);
|
|
19
|
-
yield pool.query('DROP TABLE IF EXISTS massive_data');
|
|
20
|
-
yield pool.query(`CREATE TABLE massive_data (
|
|
21
|
-
ID SERIAL NOT NULL PRIMARY KEY,
|
|
22
|
-
note VARCHAR(16),
|
|
23
|
-
n BIGINT,
|
|
24
|
-
dt DATE,
|
|
25
|
-
tm TIMESTAMP
|
|
26
|
-
)`);
|
|
27
|
-
const dt = new Date(2023, 10, 11, 12, 13, 14, 0);
|
|
28
|
-
const start = 0;
|
|
29
|
-
for (let i = start; i < start + 1000000; i++) {
|
|
30
|
-
const dt2 = new Date(dt.getTime() + i * 1000 * 60 * 60 * 12);
|
|
31
|
-
const binds = [`${i + 1}件目のデータ`, i + 1, dt2, dt2];
|
|
32
|
-
yield pool.query(`INSERT INTO massive_data (note, n, dt, tm) VALUES($1, $2, $3, $4)`, binds);
|
|
33
|
-
if (i % 500 === 0) {
|
|
34
|
-
yield pool.query(`COMMIT`);
|
|
35
|
-
console.log(`inserted ${i} rows`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (pool) {
|
|
39
|
-
yield pool.end();
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
exports.setupMassiveData = setupMassiveData;
|
|
44
|
-
(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
-
yield setupMassiveData();
|
|
46
|
-
}))();
|
|
47
|
-
//# sourceMappingURL=postgres.js.map
|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C,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YAElD,MAAM,IAAI,CAAC,KAAK,CACd,mEAAmE,EACnE,KAAK,CACN,CAAC;YAEF,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,EAAE;gBACjB,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAC3B,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;aACnC;SACF;QACD,IAAI,IAAI,EAAE;YACR,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;SAClB;IACH,CAAC;CAAA;AA5CD,4CA4CC;AAED,CAAC,GAAwB,EAAE;IACzB,MAAM,gBAAgB,EAAE,CAAC;AA4B3B,CAAC,CAAA,CAAC,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const drivers_1 = require("../drivers");
|
|
5
|
-
const helpers_1 = require("../helpers");
|
|
6
|
-
const types_1 = require("../types");
|
|
7
|
-
const connectOption = {
|
|
8
|
-
host: '127.0.0.1',
|
|
9
|
-
port: 6001,
|
|
10
|
-
user: 'testuser',
|
|
11
|
-
password: 'testpass',
|
|
12
|
-
database: 'testdb',
|
|
13
|
-
dbType: types_1.DBType.MySQL,
|
|
14
|
-
name: 'mysql',
|
|
15
|
-
};
|
|
16
|
-
(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
const { ok, message, result } = yield drivers_1.DBDriverResolver.getInstance().workflow(connectOption, (driver) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const query = 'select id,n1,n2,n3,n4,d1,d2,s4,s8 from testtable where id>=:id and n1>=:n1';
|
|
19
|
-
const r = (0, helpers_1.normalizeQuery)({ query, bindParams: { id: 3, n1: 4 } });
|
|
20
|
-
return yield driver.requestSql({
|
|
21
|
-
sql: r.query,
|
|
22
|
-
conditions: {
|
|
23
|
-
binds: r.binds,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
}));
|
|
27
|
-
console.log('ok', ok);
|
|
28
|
-
console.log('message', message);
|
|
29
|
-
console.log('result\n', result.toString());
|
|
30
|
-
}))();
|
|
31
|
-
//# sourceMappingURL=rules.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../src/examples/rules.ts"],"names":[],"mappings":";;;AACA,wCAA6D;AAC7D,wCAA4C;AAC5C,oCAAqD;AAErD,MAAM,aAAa,GAAsB;IACvC,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,cAAM,CAAC,KAAK;IACpB,IAAI,EAAE,OAAO;CACd,CAAC;AAEF,CAAC,GAAwB,EAAE;IACzB,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,0BAAgB,CAAC,WAAW,EAAE,CAAC,QAAQ,CAG3E,aAAa,EAAE,CAAO,MAAM,EAAE,EAAE;QAQhC,MAAM,KAAK,GACT,4EAA4E,CAAC;QAC/E,MAAM,CAAC,GAAG,IAAA,wBAAc,EAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAClE,OAAO,MAAM,MAAM,CAAC,UAAU,CAAC;YAC7B,GAAG,EAAE,CAAC,CAAC,KAAK;YACZ,UAAU,EAAE;gBACV,KAAK,EAAE,CAAC,CAAC,KAAK;aACf;SAEF,CAAC,CAAC;IACL,CAAC,CAAA,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACtB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AAO7C,CAAC,CAAA,CAAC,EAAE,CAAC"}
|