@l-v-yonsama/multi-platform-database-drivers 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/built/src/db/drivers/AwsS3Driver.d.ts +1 -1
- package/built/src/db/drivers/AwsS3Driver.js +122 -421
- package/built/src/db/drivers/AwsS3Driver.js.map +1 -1
- package/built/src/db/drivers/BaseDriver.d.ts +6 -6
- package/built/src/db/drivers/BaseDriver.js +86 -111
- package/built/src/db/drivers/BaseDriver.js.map +1 -1
- package/built/src/db/drivers/MySQLDriver.d.ts +1 -1
- package/built/src/db/drivers/MySQLDriver.js +187 -183
- package/built/src/db/drivers/MySQLDriver.js.map +1 -1
- package/built/src/db/drivers/PostgresDriver.d.ts +1 -1
- package/built/src/db/drivers/PostgresDriver.js +173 -185
- package/built/src/db/drivers/PostgresDriver.js.map +1 -1
- package/built/src/db/drivers/RedisDriver.d.ts +2 -2
- package/built/src/db/drivers/RedisDriver.js +172 -162
- package/built/src/db/drivers/RedisDriver.js.map +1 -1
- package/built/src/db/index.d.ts +0 -1
- package/built/src/db/index.js +0 -1
- package/built/src/db/index.js.map +1 -1
- package/built/src/db/resource/DbResource.d.ts +43 -35
- package/built/src/db/resource/DbResource.js +80 -73
- package/built/src/db/resource/DbResource.js.map +1 -1
- package/built/src/db/resource/MultipleResultSetDataHolder.js +0 -1
- package/built/src/db/resource/MultipleResultSetDataHolder.js.map +1 -1
- package/built/src/db/resource/ResourceHelper.d.ts +6 -0
- package/built/src/db/resource/ResourceHelper.js +58 -0
- package/built/src/db/resource/ResourceHelper.js.map +1 -0
- package/built/src/db/resource/ResultSetDataHolder.d.ts +0 -11
- package/built/src/db/resource/ResultSetDataHolder.js +0 -42
- package/built/src/db/resource/ResultSetDataHolder.js.map +1 -1
- package/built/src/db/resource/index.d.ts +1 -1
- package/built/src/db/resource/index.js +1 -1
- package/built/src/db/resource/index.js.map +1 -1
- package/built/src/db/resource/types/GeneralColumnType.js +0 -20
- package/built/src/db/resource/types/GeneralColumnType.js.map +1 -1
- package/built/src/db/resource/types/MySQLColumnType.js +9 -19
- package/built/src/db/resource/types/MySQLColumnType.js.map +1 -1
- package/built/src/db/resource/types/PostgresColumnType.js +0 -2
- package/built/src/db/resource/types/PostgresColumnType.js.map +1 -1
- package/built/src/index.d.ts +1 -1
- package/built/src/index.js +1 -1
- package/built/src/index.js.map +1 -1
- package/built/src/service/DBAccessService.d.ts +20 -0
- package/built/src/service/DBAccessService.js +319 -0
- package/built/src/service/DBAccessService.js.map +1 -0
- package/built/src/service/DBDriverResolver.d.ts +17 -0
- package/built/src/service/DBDriverResolver.js +89 -0
- package/built/src/service/DBDriverResolver.js.map +1 -0
- package/built/src/service/SQLService.d.ts +5 -0
- package/built/src/service/SQLService.js +67 -0
- package/built/src/service/SQLService.js.map +1 -0
- package/built/src/service/index.d.ts +5 -0
- package/built/src/service/index.js +9 -0
- package/built/src/service/index.js.map +1 -0
- package/built/src/service/request/{redis_request.d.ts → RedisRequest.d.ts} +1 -1
- package/built/src/service/request/{redis_request.js → RedisRequest.js} +1 -1
- package/built/src/service/request/RedisRequest.js.map +1 -0
- package/built/src/service/request/{s3_request.d.ts → S3Request.d.ts} +1 -1
- package/built/src/service/request/{s3_request.js → S3Request.js} +1 -1
- package/built/src/service/request/S3Request.js.map +1 -0
- package/built/src/service/request/index.d.ts +67 -0
- package/built/src/service/request/index.js +19 -0
- package/built/src/service/request/index.js.map +1 -0
- package/built/src/service/response/GeneralDBResponse.d.ts +8 -0
- package/built/src/service/response/GeneralDBResponse.js +3 -0
- package/built/src/service/response/GeneralDBResponse.js.map +1 -0
- package/built/src/service/response/GeneralResponse.d.ts +6 -0
- package/built/src/service/response/GeneralResponse.js +13 -0
- package/built/src/service/response/GeneralResponse.js.map +1 -0
- package/built/src/service/response/index.d.ts +2 -0
- package/built/src/service/response/index.js +6 -0
- package/built/src/service/response/index.js.map +1 -0
- package/built/src/service/response/reply/ConnectionResult.d.ts +3 -0
- package/built/src/service/response/reply/ConnectionResult.js +3 -0
- package/built/src/service/response/reply/ConnectionResult.js.map +1 -0
- package/built/src/service/response/reply/FileExportReply.d.ts +10 -0
- package/built/src/service/response/reply/FileExportReply.js +17 -0
- package/built/src/service/response/reply/FileExportReply.js.map +1 -0
- package/built/src/service/response/reply/FileProcessResult.d.ts +14 -0
- package/built/src/service/response/reply/FileProcessResult.js +28 -0
- package/built/src/service/response/reply/FileProcessResult.js.map +1 -0
- package/built/src/service/response/{GeneralReponse.d.ts → reply/GeneralReply.d.ts} +1 -1
- package/built/src/service/response/{GeneralReponse.js → reply/GeneralReply.js} +3 -3
- package/built/src/service/response/reply/GeneralReply.js.map +1 -0
- package/built/src/service/response/reply/OutputReply.d.ts +9 -0
- package/built/src/service/response/reply/OutputReply.js +16 -0
- package/built/src/service/response/reply/OutputReply.js.map +1 -0
- package/built/src/service/response/reply/ProgressReply.d.ts +7 -0
- package/built/src/service/response/reply/ProgressReply.js +13 -0
- package/built/src/service/response/reply/ProgressReply.js.map +1 -0
- package/built/src/service/response/reply/types/FileExportType.d.ts +3 -0
- package/built/src/service/response/reply/types/FileExportType.js +9 -0
- package/built/src/service/response/reply/types/FileExportType.js.map +1 -0
- package/built/src/service/response/reply/types/OutputType.d.ts +11 -0
- package/built/src/service/response/reply/types/OutputType.js +16 -0
- package/built/src/service/response/reply/types/OutputType.js.map +1 -0
- package/built/src/service/response/reply/types/ReplyEventType.d.ts +10 -0
- package/built/src/service/response/reply/types/ReplyEventType.js +16 -0
- package/built/src/service/response/reply/types/ReplyEventType.js.map +1 -0
- package/package.json +9 -5
- package/built/src/db/manager.d.ts +0 -8
- package/built/src/db/manager.js +0 -87
- package/built/src/db/manager.js.map +0 -1
- package/built/src/db/resource/ResourceUtil.d.ts +0 -39
- package/built/src/db/resource/ResourceUtil.js +0 -337
- package/built/src/db/resource/ResourceUtil.js.map +0 -1
- package/built/src/service/request/general_db_request.d.ts +0 -18
- package/built/src/service/request/general_db_request.js +0 -14
- package/built/src/service/request/general_db_request.js.map +0 -1
- package/built/src/service/request/redis_request.js.map +0 -1
- package/built/src/service/request/s3_request.js.map +0 -1
- package/built/src/service/response/GeneralReponse.js.map +0 -1
- package/built/src/util/file_util.d.ts +0 -22
- package/built/src/util/file_util.js +0 -143
- package/built/src/util/file_util.js.map +0 -1
- package/built/src/util/index.d.ts +0 -1
- package/built/src/util/index.js +0 -5
- package/built/src/util/index.js.map +0 -1
|
@@ -1,136 +1,142 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
4
|
const BaseDriver_1 = require("./BaseDriver");
|
|
5
5
|
const DbResource_1 = require("../resource/DbResource");
|
|
6
6
|
const ioredis_1 = require("ioredis");
|
|
7
7
|
const ResultSetDataHolder_1 = require("../resource/ResultSetDataHolder");
|
|
8
8
|
const RedisKeyType_1 = require("../resource/types/RedisKeyType");
|
|
9
|
-
const
|
|
9
|
+
const RedisRequest_1 = require("../../service/request/RedisRequest");
|
|
10
10
|
class RedisDriver extends BaseDriver_1.default {
|
|
11
11
|
constructor(conRes) {
|
|
12
12
|
super(conRes);
|
|
13
13
|
this.databases = 16;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const options = Object.assign({
|
|
18
|
-
port: 6379,
|
|
19
|
-
host: '127.0.0.1',
|
|
20
|
-
password: 'auth',
|
|
21
|
-
db: 0,
|
|
22
|
-
}, {
|
|
23
|
-
port: this.conRes.port,
|
|
24
|
-
host: this.conRes.host,
|
|
25
|
-
password: this.conRes.password,
|
|
26
|
-
db: this.conRes.database,
|
|
27
|
-
retryStrategy: function () {
|
|
28
|
-
return 'No!';
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
if (this.isNeedsSsh()) {
|
|
32
|
-
options.host = '127.0.0.1';
|
|
33
|
-
options.port = this.sshLocalPort;
|
|
34
|
-
}
|
|
35
|
-
options.connectTimeout = 5000;
|
|
36
|
-
if (this.conRes.hasUrl()) {
|
|
37
|
-
// Connect to 127.0.0.1:6380, db 4, using password "authpassword":
|
|
38
|
-
// "redis://:authpassword@127.0.0.1:6380/4"
|
|
39
|
-
this.client = new ioredis_1.Redis(this.conRes.url);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
this.client = new ioredis_1.Redis(options);
|
|
43
|
-
}
|
|
44
|
-
// dbs= [ [ null, '# Serverxxxx' ], [ null, [ 'databases', '16' ] ] ]
|
|
15
|
+
connectSub() {
|
|
16
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
45
17
|
try {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
18
|
+
const options = Object.assign({
|
|
19
|
+
port: 6379,
|
|
20
|
+
host: '127.0.0.1',
|
|
21
|
+
password: 'auth',
|
|
22
|
+
db: 0,
|
|
23
|
+
}, {
|
|
24
|
+
port: this.conRes.port,
|
|
25
|
+
host: this.conRes.host,
|
|
26
|
+
password: this.conRes.password,
|
|
27
|
+
db: this.conRes.database,
|
|
28
|
+
retryStrategy: function () {
|
|
29
|
+
return 'No!';
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
if (this.isNeedsSsh()) {
|
|
33
|
+
options.host = '127.0.0.1';
|
|
34
|
+
options.port = this.sshLocalPort;
|
|
35
|
+
}
|
|
36
|
+
options.connectTimeout = 5000;
|
|
37
|
+
if (this.conRes.hasUrl()) {
|
|
38
|
+
this.client = new ioredis_1.Redis(this.conRes.url);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.client = new ioredis_1.Redis(options);
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const dbs = yield this.client
|
|
45
|
+
.multi()
|
|
46
|
+
.info()
|
|
47
|
+
.config('GET', 'databases')
|
|
48
|
+
.exec();
|
|
49
|
+
if (dbs && dbs.length > 1 && dbs[1].length > 1) {
|
|
50
|
+
const dbs2 = dbs[1][1];
|
|
51
|
+
if (dbs2 && dbs2.length > 1) {
|
|
52
|
+
this.databases = parseInt(dbs2[1], 10);
|
|
53
|
+
}
|
|
56
54
|
}
|
|
57
55
|
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
this.databases = 16;
|
|
58
|
+
}
|
|
58
59
|
}
|
|
59
60
|
catch (e) {
|
|
60
|
-
|
|
61
|
+
return e.message;
|
|
61
62
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return e.message;
|
|
65
|
-
}
|
|
66
|
-
return '';
|
|
63
|
+
return '';
|
|
64
|
+
});
|
|
67
65
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
test(with_connect = false) {
|
|
67
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
let errorReason = '';
|
|
69
|
+
try {
|
|
70
|
+
if (with_connect) {
|
|
71
|
+
const con_result = yield this.connect();
|
|
72
|
+
if (con_result) {
|
|
73
|
+
return con_result;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
yield this.client.ping();
|
|
77
|
+
if (with_connect) {
|
|
78
|
+
yield this.disconnect();
|
|
75
79
|
}
|
|
76
80
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
await this.asyncClose();
|
|
81
|
+
catch (e) {
|
|
82
|
+
errorReason = e.message;
|
|
80
83
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
errorReason = e.message;
|
|
84
|
-
}
|
|
85
|
-
return errorReason;
|
|
84
|
+
return errorReason;
|
|
85
|
+
});
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
return
|
|
87
|
+
requestSql(sql, options) {
|
|
88
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
return ResultSetDataHolder_1.default.createEmpty();
|
|
90
|
+
});
|
|
89
91
|
}
|
|
90
|
-
|
|
91
|
-
return
|
|
92
|
+
countTables(tables, options) {
|
|
93
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
return new Array();
|
|
95
|
+
});
|
|
92
96
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
ret.
|
|
97
|
+
executeCommand(req) {
|
|
98
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
let ret = '';
|
|
100
|
+
if (!this.client) {
|
|
101
|
+
return ret;
|
|
102
|
+
}
|
|
103
|
+
yield this.client.select(req.index);
|
|
104
|
+
let r = '';
|
|
105
|
+
switch (req.command) {
|
|
106
|
+
case RedisRequest_1.RedisCommandType.GetValue:
|
|
107
|
+
{
|
|
108
|
+
r = yield this.getValueByKey(this.client, req.key, req.type);
|
|
109
|
+
const ttl = yield this.client.ttl(req.key);
|
|
110
|
+
ret = new DbResource_1.DbKey(req.key, req.type, ttl);
|
|
111
|
+
if (ret.ttl > 0) {
|
|
112
|
+
ret.ttlConfirmationDatetime = new Date().getTime();
|
|
113
|
+
}
|
|
114
|
+
ret.val = r;
|
|
108
115
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
return ret;
|
|
116
|
+
break;
|
|
117
|
+
case RedisRequest_1.RedisCommandType.SetValue:
|
|
118
|
+
if (req.options) {
|
|
119
|
+
yield this.client.set(req.key, req.options.val);
|
|
120
|
+
}
|
|
121
|
+
break;
|
|
122
|
+
case RedisRequest_1.RedisCommandType.Flushall:
|
|
123
|
+
ret = yield this.client.flushall();
|
|
124
|
+
break;
|
|
125
|
+
case RedisRequest_1.RedisCommandType.Flushdb:
|
|
126
|
+
ret = yield this.client.flushdb();
|
|
127
|
+
break;
|
|
128
|
+
case RedisRequest_1.RedisCommandType.Dbsize:
|
|
129
|
+
ret = yield this.client.dbsize();
|
|
130
|
+
break;
|
|
131
|
+
case RedisRequest_1.RedisCommandType.Info:
|
|
132
|
+
ret = yield this.client.info(req.options.section);
|
|
133
|
+
break;
|
|
134
|
+
default:
|
|
135
|
+
console.error('undefined.', req.command);
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
return ret;
|
|
139
|
+
});
|
|
134
140
|
}
|
|
135
141
|
scan(db_index, key, count, with_value, progressCallback) {
|
|
136
142
|
return new Promise((resolve) => {
|
|
@@ -147,7 +153,7 @@ class RedisDriver extends BaseDriver_1.default {
|
|
|
147
153
|
});
|
|
148
154
|
progressCallback('Key scanning now.', Math.round((ret.length * 100) / count));
|
|
149
155
|
if (ret.length > count) {
|
|
150
|
-
stream.close();
|
|
156
|
+
stream.close();
|
|
151
157
|
}
|
|
152
158
|
});
|
|
153
159
|
stream.on('end', () => {
|
|
@@ -157,74 +163,78 @@ class RedisDriver extends BaseDriver_1.default {
|
|
|
157
163
|
}
|
|
158
164
|
const parallels = [];
|
|
159
165
|
ret.forEach((keyRes) => {
|
|
160
|
-
parallels.push((
|
|
161
|
-
keyRes.type = RedisKeyType_1.RedisKeyType.parse(
|
|
162
|
-
keyRes.ttl =
|
|
166
|
+
parallels.push((() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
keyRes.type = RedisKeyType_1.RedisKeyType.parse(yield currentClient.type(keyRes.getName()));
|
|
168
|
+
keyRes.ttl = yield currentClient.ttl(keyRes.getName());
|
|
163
169
|
if (keyRes.ttl > 0) {
|
|
164
|
-
keyRes.
|
|
170
|
+
keyRes.ttlConfirmationDatetime = new Date().getTime();
|
|
165
171
|
}
|
|
166
172
|
if (with_value) {
|
|
167
|
-
keyRes.val =
|
|
173
|
+
keyRes.val = yield this.getValueByKey(currentClient, keyRes.getName(), keyRes.type);
|
|
168
174
|
}
|
|
169
|
-
})());
|
|
175
|
+
}))());
|
|
170
176
|
});
|
|
171
|
-
(
|
|
172
|
-
|
|
177
|
+
(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
yield Promise.all(parallels);
|
|
173
179
|
progressCallback('Key scanning done.', 100);
|
|
174
180
|
resolve(ret);
|
|
175
|
-
})();
|
|
181
|
+
}))();
|
|
176
182
|
});
|
|
177
183
|
});
|
|
178
184
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
185
|
+
getValueByKey(client, key, type) {
|
|
186
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
switch (type) {
|
|
188
|
+
case RedisKeyType_1.RedisKeyType.string:
|
|
189
|
+
return yield client.get(key);
|
|
190
|
+
case RedisKeyType_1.RedisKeyType.list:
|
|
191
|
+
return yield client.lrange(key, 0, -1);
|
|
192
|
+
case RedisKeyType_1.RedisKeyType.set:
|
|
193
|
+
return yield client.smembers(key);
|
|
194
|
+
case RedisKeyType_1.RedisKeyType.zset:
|
|
195
|
+
return yield client.zrange(key, 0, -1);
|
|
196
|
+
case RedisKeyType_1.RedisKeyType.hash:
|
|
197
|
+
return yield client.hgetall(key);
|
|
198
|
+
default:
|
|
199
|
+
console.log('whattype??', type);
|
|
200
|
+
}
|
|
201
|
+
return undefined;
|
|
202
|
+
});
|
|
195
203
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
const dbRes = new DbResource_1.RedisDatabase(db, keys, expires, avg_ttl);
|
|
212
|
-
dbResources.push(dbRes);
|
|
213
|
-
}
|
|
214
|
-
for (let i = 0; i < this.databases; i++) {
|
|
215
|
-
const name = `${i}`;
|
|
216
|
-
if (!dbResources.some((r) => r.getName() === name)) {
|
|
217
|
-
const dbRes = new DbResource_1.RedisDatabase(name, 0, 0, 0);
|
|
204
|
+
getInfomationSchemas(options) {
|
|
205
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
if (!this.conRes) {
|
|
207
|
+
return [];
|
|
208
|
+
}
|
|
209
|
+
const dbResources = new Array();
|
|
210
|
+
const keyspace = yield this.client.info('keyspace');
|
|
211
|
+
const re = /db([0-9]+):keys=([0-9]+),expires=([0-9]+),avg_ttl=([0-9]+)/g;
|
|
212
|
+
let m;
|
|
213
|
+
while ((m = re.exec(keyspace))) {
|
|
214
|
+
const db = m[1];
|
|
215
|
+
const keys = parseInt(m[2], 10);
|
|
216
|
+
const expires = parseInt(m[3], 10);
|
|
217
|
+
const avg_ttl = parseInt(m[4], 10);
|
|
218
|
+
const dbRes = new DbResource_1.RedisDatabase(db, keys, expires, avg_ttl);
|
|
218
219
|
dbResources.push(dbRes);
|
|
219
220
|
}
|
|
220
|
-
|
|
221
|
-
|
|
221
|
+
for (let i = 0; i < this.databases; i++) {
|
|
222
|
+
const name = `${i}`;
|
|
223
|
+
if (!dbResources.some((r) => r.getName() === name)) {
|
|
224
|
+
const dbRes = new DbResource_1.RedisDatabase(name, 0, 0, 0);
|
|
225
|
+
dbResources.push(dbRes);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return dbResources;
|
|
229
|
+
});
|
|
222
230
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
231
|
+
closeSub() {
|
|
232
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
233
|
+
if (this.client) {
|
|
234
|
+
yield this.client.quit();
|
|
235
|
+
}
|
|
236
|
+
return '';
|
|
237
|
+
});
|
|
228
238
|
}
|
|
229
239
|
}
|
|
230
240
|
exports.default = RedisDriver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedisDriver.js","sourceRoot":"","sources":["../../../../src/db/drivers/RedisDriver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RedisDriver.js","sourceRoot":"","sources":["../../../../src/db/drivers/RedisDriver.ts"],"names":[],"mappings":";;;AACA,6CAA6D;AAC7D,uDAOgC;AAChC,qCAAgC;AAChC,yEAAkE;AAClE,iEAA8D;AAC9D,qEAG4C;AAE5C,MAAqB,WAAY,SAAQ,oBAAU;IAIjD,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;QAHhB,cAAS,GAAG,EAAE,CAAC;IAIf,CAAC;IAEK,UAAU;;YACd,IAAI;gBACF,MAAM,OAAO,GAAQ,MAAM,CAAC,MAAM,CAChC;oBACE,IAAI,EAAE,IAAI;oBACV,IAAI,EAAE,WAAW;oBACjB,QAAQ,EAAE,MAAM;oBAChB,EAAE,EAAE,CAAC;iBACN,EACD;oBACE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;oBACtB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;oBACtB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;oBAC9B,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;oBACxB,aAAa,EAAE;wBACb,OAAO,KAAK,CAAC;oBACf,CA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,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,EAAE;oBAClD,MAAM,KAAK,GAAG,IAAI,0BAAa,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;oBAC/C,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBACzB;aACF;YAED,OAAO,WAAW,CAAC;QACrB,CAAC;KAAA;IACK,QAAQ;;YACZ,IAAI,IAAI,CAAC,MAAM,EAAE;gBACf,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;aAC1B;YACD,OAAO,EAAE,CAAC;QACZ,CAAC;KAAA;CACF;AAlQD,8BAkQC"}
|
package/built/src/db/index.d.ts
CHANGED
package/built/src/db/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./DBError"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./manager"), exports);
|
|
6
5
|
tslib_1.__exportStar(require("./drivers"), exports);
|
|
7
6
|
tslib_1.__exportStar(require("./resource"), exports);
|
|
8
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,oDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,oDAA0B;AAC1B,qDAA2B"}
|
|
@@ -26,26 +26,30 @@ export interface ColumnResolver {
|
|
|
26
26
|
export declare class DbResource {
|
|
27
27
|
id: string;
|
|
28
28
|
protected parent: DbResource | undefined;
|
|
29
|
-
protected
|
|
29
|
+
protected resouceType: ResourceType;
|
|
30
30
|
name: string;
|
|
31
31
|
comment?: string;
|
|
32
32
|
protected children: Array<DbResource>;
|
|
33
33
|
expanded: boolean;
|
|
34
34
|
static createEmpty(): DbResource;
|
|
35
|
-
constructor(
|
|
35
|
+
constructor(resouceType: ResourceType, name: string);
|
|
36
36
|
getName(): string;
|
|
37
37
|
getResouceType(): ResourceType;
|
|
38
38
|
getChildren(): DbResource[];
|
|
39
|
-
getParent(): DbResource
|
|
39
|
+
getParent(): DbResource;
|
|
40
40
|
addChild(res: DbResource): DbResource;
|
|
41
41
|
containsResource(filter: string): boolean;
|
|
42
42
|
clearChildren(): void;
|
|
43
|
-
getChildByName(name: string, options?:
|
|
43
|
+
getChildByName(name: string, options?: {
|
|
44
|
+
unwrapQuote?: boolean;
|
|
45
|
+
resouceType?: ResourceType;
|
|
46
|
+
}): DbResource;
|
|
44
47
|
toString(): string;
|
|
48
|
+
toJsonStringify(space?: number): string;
|
|
45
49
|
}
|
|
46
50
|
export interface SshSetting {
|
|
47
51
|
use: boolean;
|
|
48
|
-
|
|
52
|
+
authMethod: string;
|
|
49
53
|
username: string;
|
|
50
54
|
password?: string;
|
|
51
55
|
host: string;
|
|
@@ -57,16 +61,16 @@ export interface SshSetting {
|
|
|
57
61
|
dstHost: string;
|
|
58
62
|
}
|
|
59
63
|
export interface FirebaseSetting {
|
|
60
|
-
|
|
64
|
+
authMethod: string;
|
|
61
65
|
projectid?: string;
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
privateKey?: string;
|
|
67
|
+
clientEmail?: string;
|
|
64
68
|
serviceAccountCredentialsPath?: string;
|
|
65
69
|
}
|
|
66
70
|
export interface ConnectionSetting {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
name
|
|
71
|
+
dbType: DBType;
|
|
72
|
+
odbcVendorType?: ODBCVendorType;
|
|
73
|
+
name: string;
|
|
70
74
|
url?: string;
|
|
71
75
|
host?: string;
|
|
72
76
|
port?: number;
|
|
@@ -74,36 +78,35 @@ export interface ConnectionSetting {
|
|
|
74
78
|
user?: string;
|
|
75
79
|
password?: string;
|
|
76
80
|
database?: string;
|
|
77
|
-
|
|
81
|
+
databaseVersion?: number;
|
|
78
82
|
ds?: string;
|
|
79
83
|
region?: string;
|
|
80
84
|
isConnected?: boolean;
|
|
81
|
-
|
|
85
|
+
isInProgress?: boolean;
|
|
82
86
|
apiVersion?: string;
|
|
83
87
|
ssh?: SshSetting;
|
|
84
88
|
firebase?: FirebaseSetting;
|
|
85
89
|
}
|
|
86
90
|
export declare class DbConnection extends DbResource implements ConnectionSetting {
|
|
87
91
|
property: Map<string, object>;
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
dbType: DBType;
|
|
93
|
+
odbcVendorType: ODBCVendorType;
|
|
90
94
|
host: string;
|
|
91
95
|
port: number;
|
|
92
96
|
user: string;
|
|
93
97
|
password: string;
|
|
94
98
|
database: string;
|
|
95
|
-
|
|
99
|
+
databaseVersion: number;
|
|
96
100
|
enviroment: string;
|
|
97
101
|
ds: string;
|
|
98
102
|
url: string;
|
|
99
103
|
isConnected: boolean;
|
|
100
|
-
|
|
104
|
+
isInProgress: boolean;
|
|
101
105
|
apiVersion?: string;
|
|
102
106
|
region?: string;
|
|
103
107
|
ssh?: SshSetting;
|
|
104
108
|
firebase?: FirebaseSetting;
|
|
105
109
|
constructor(prop: any);
|
|
106
|
-
isInProgress(): boolean;
|
|
107
110
|
static deserialize(json: any): DbConnection;
|
|
108
111
|
hasUrl(): boolean;
|
|
109
112
|
hasSshSetting(): boolean;
|
|
@@ -112,31 +115,36 @@ export declare class DbDatabase extends DbResource {
|
|
|
112
115
|
disabled: boolean;
|
|
113
116
|
version?: number;
|
|
114
117
|
constructor(name: string);
|
|
115
|
-
|
|
118
|
+
getSchema(option: {
|
|
119
|
+
name?: string;
|
|
120
|
+
isDefault?: boolean;
|
|
121
|
+
}): DbSchema;
|
|
122
|
+
static deserialize(json: any): DbDatabase;
|
|
116
123
|
}
|
|
117
124
|
export declare class RedisDatabase extends DbDatabase {
|
|
118
125
|
keys: number;
|
|
119
126
|
expires: number;
|
|
120
|
-
|
|
121
|
-
constructor(name: string, keys: number, expires: number,
|
|
127
|
+
avgTtl: number;
|
|
128
|
+
constructor(name: string, keys: number, expires: number, avgTtl: number);
|
|
122
129
|
getDBIndex(): number;
|
|
123
|
-
static deserialize(
|
|
130
|
+
static deserialize(json: any): RedisDatabase;
|
|
124
131
|
}
|
|
125
132
|
export declare class DbSchema extends DbResource {
|
|
133
|
+
isDefault: boolean;
|
|
126
134
|
constructor(name: string);
|
|
127
|
-
static deserialize(
|
|
135
|
+
static deserialize(db: DbDatabase, json: any): DbSchema;
|
|
128
136
|
}
|
|
129
137
|
export declare class DbTable extends DbResource {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
constructor(name: string,
|
|
138
|
+
tableType: any;
|
|
139
|
+
isInProgress: boolean;
|
|
140
|
+
constructor(name: string, tableType: any, comment?: string);
|
|
133
141
|
toString(): string;
|
|
134
|
-
static deserialize(
|
|
142
|
+
static deserialize(db: DbDatabase, schema: DbSchema, json: any): DbTable;
|
|
135
143
|
}
|
|
136
144
|
export declare class DbKey extends DbResource {
|
|
137
145
|
type: RedisKeyType;
|
|
138
146
|
ttl: number;
|
|
139
|
-
|
|
147
|
+
ttlConfirmationDatetime: number | undefined;
|
|
140
148
|
ttl_remain: number | undefined;
|
|
141
149
|
val: any;
|
|
142
150
|
constructor(name: string, type?: RedisKeyType, ttl?: number);
|
|
@@ -144,27 +152,27 @@ export declare class DbKey extends DbResource {
|
|
|
144
152
|
static deserialize(json: any): DbKey;
|
|
145
153
|
}
|
|
146
154
|
export declare class DbColumn extends DbResource {
|
|
147
|
-
readonly
|
|
155
|
+
readonly colType: GeneralColumnType;
|
|
148
156
|
readonly nullable: boolean;
|
|
149
157
|
readonly key: string | undefined;
|
|
150
158
|
readonly default: any;
|
|
151
159
|
readonly extra: any;
|
|
152
|
-
constructor(name: string,
|
|
153
|
-
static deserialize(
|
|
160
|
+
constructor(name: string, colType: GeneralColumnType, params: any, comment?: string);
|
|
161
|
+
static deserialize(db: DbDatabase, schema: DbSchema, table: DbTable, json: any): DbColumn;
|
|
154
162
|
getGeneralType(): string;
|
|
155
163
|
toString(): string;
|
|
156
164
|
}
|
|
157
165
|
export declare class DbS3Bucket extends DbResource {
|
|
158
166
|
created?: Date;
|
|
159
|
-
|
|
167
|
+
isInProgress: boolean;
|
|
160
168
|
refreshed?: Date;
|
|
161
169
|
constructor(name?: string, created?: Date);
|
|
162
170
|
getDir(key: string): DbS3Key | undefined;
|
|
163
|
-
static deserialize(
|
|
171
|
+
static deserialize(db: DbDatabase, json: any): DbS3Bucket;
|
|
164
172
|
}
|
|
165
173
|
export declare class DbS3Owner extends DbResource {
|
|
166
174
|
constructor(id: string, name?: string);
|
|
167
|
-
static deserialize(
|
|
175
|
+
static deserialize(db: DbDatabase, json: any): DbS3Owner;
|
|
168
176
|
}
|
|
169
177
|
export interface S3KeySearchResult {
|
|
170
178
|
prefix?: string;
|
|
@@ -175,7 +183,7 @@ export interface S3KeySearchResult {
|
|
|
175
183
|
export declare class DbS3Key extends DbResource {
|
|
176
184
|
output_file_path?: string;
|
|
177
185
|
is_dir: boolean;
|
|
178
|
-
|
|
186
|
+
isInProgress: boolean;
|
|
179
187
|
refreshed?: Date;
|
|
180
188
|
updated?: Date;
|
|
181
189
|
etag?: string;
|