@l-v-yonsama/multi-platform-database-drivers 0.1.13 → 0.1.15
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/db/DBError.js +4 -1
- package/built/src/db/DBError.js.map +1 -1
- package/built/src/db/drivers/AwsS3Driver.js +131 -105
- package/built/src/db/drivers/AwsS3Driver.js.map +1 -1
- package/built/src/db/drivers/BaseDriver.js +75 -65
- package/built/src/db/drivers/BaseDriver.js.map +1 -1
- package/built/src/db/drivers/MySQLDriver.js +201 -179
- package/built/src/db/drivers/MySQLDriver.js.map +1 -1
- package/built/src/db/drivers/PostgresDriver.js +186 -162
- package/built/src/db/drivers/PostgresDriver.js.map +1 -1
- package/built/src/db/drivers/RedisDriver.js +180 -160
- package/built/src/db/drivers/RedisDriver.js.map +1 -1
- package/built/src/db/drivers/index.js +8 -5
- package/built/src/db/drivers/index.js.map +1 -1
- package/built/src/db/index.js +6 -3
- package/built/src/db/index.js.map +1 -1
- package/built/src/db/resource/DbResource.js +58 -43
- package/built/src/db/resource/DbResource.js.map +1 -1
- package/built/src/db/resource/MultipleResultSetDataHolder.js +9 -5
- package/built/src/db/resource/MultipleResultSetDataHolder.js.map +1 -1
- package/built/src/db/resource/ResourceHelper.js +5 -1
- package/built/src/db/resource/ResourceHelper.js.map +1 -1
- package/built/src/db/resource/ResultSetDataHolder.js +43 -33
- package/built/src/db/resource/ResultSetDataHolder.js.map +1 -1
- package/built/src/db/resource/index.js +8 -5
- package/built/src/db/resource/index.js.map +1 -1
- package/built/src/db/resource/types/DBType.js +6 -3
- package/built/src/db/resource/types/DBType.js.map +1 -1
- package/built/src/db/resource/types/GeneralColumnType.js +8 -5
- package/built/src/db/resource/types/GeneralColumnType.js.map +1 -1
- package/built/src/db/resource/types/MySQLColumnType.js +10 -7
- package/built/src/db/resource/types/MySQLColumnType.js.map +1 -1
- package/built/src/db/resource/types/ODBCVendorType.js +5 -2
- package/built/src/db/resource/types/ODBCVendorType.js.map +1 -1
- package/built/src/db/resource/types/PostgresColumnType.js +9 -6
- package/built/src/db/resource/types/PostgresColumnType.js.map +1 -1
- package/built/src/db/resource/types/RedisKeyType.js +8 -5
- package/built/src/db/resource/types/RedisKeyType.js.map +1 -1
- package/built/src/db/resource/types/ResourceType.js +5 -2
- package/built/src/db/resource/types/ResourceType.js.map +1 -1
- package/built/src/db/resource/types/index.js +10 -7
- package/built/src/db/resource/types/index.js.map +1 -1
- package/built/src/index.js +6 -3
- package/built/src/index.js.map +1 -1
- package/built/src/service/DBAccessService.js +273 -246
- package/built/src/service/DBAccessService.js.map +1 -1
- package/built/src/service/DBDriverResolver.js +36 -32
- package/built/src/service/DBDriverResolver.js.map +1 -1
- package/built/src/service/SQLService.js +8 -3
- package/built/src/service/SQLService.js.map +1 -1
- package/built/src/service/index.js +8 -5
- package/built/src/service/index.js.map +1 -1
- package/built/src/service/request/RedisRequest.js +5 -2
- package/built/src/service/request/RedisRequest.js.map +1 -1
- package/built/src/service/request/S3Request.js +5 -2
- package/built/src/service/request/S3Request.js.map +1 -1
- package/built/src/service/request/index.js +5 -2
- package/built/src/service/request/index.js.map +1 -1
- package/built/src/service/response/GeneralDBResponse.js +2 -1
- package/built/src/service/response/GeneralResponse.js +5 -1
- package/built/src/service/response/GeneralResponse.js.map +1 -1
- package/built/src/service/response/index.js +5 -2
- package/built/src/service/response/index.js.map +1 -1
- package/built/src/service/response/reply/ConnectionResult.js +2 -1
- package/built/src/service/response/reply/FileExportReply.js +8 -4
- package/built/src/service/response/reply/FileExportReply.js.map +1 -1
- package/built/src/service/response/reply/FileProcessResult.js +7 -3
- package/built/src/service/response/reply/FileProcessResult.js.map +1 -1
- package/built/src/service/response/reply/GeneralReply.js +4 -1
- package/built/src/service/response/reply/GeneralReply.js.map +1 -1
- package/built/src/service/response/reply/OutputReply.js +8 -4
- package/built/src/service/response/reply/OutputReply.js.map +1 -1
- package/built/src/service/response/reply/ProgressReply.js +6 -2
- package/built/src/service/response/reply/ProgressReply.js.map +1 -1
- package/built/src/service/response/reply/types/FileExportType.js +5 -2
- package/built/src/service/response/reply/types/FileExportType.js.map +1 -1
- package/built/src/service/response/reply/types/OutputType.js +5 -2
- package/built/src/service/response/reply/types/OutputType.js.map +1 -1
- package/built/src/service/response/reply/types/ReplyEventType.js +5 -2
- package/built/src/service/response/reply/types/ReplyEventType.js.map +1 -1
- package/built/src/types/DateModifiedType.js +6 -3
- package/built/src/types/DateModifiedType.js.map +1 -1
- package/built/src/types/FileKindType.js +6 -3
- package/built/src/types/FileKindType.js.map +1 -1
- package/built/src/types/index.js +5 -2
- package/built/src/types/index.js.map +1 -1
- package/package.json +2 -3
|
@@ -1,129 +1,142 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const BaseDriver_1 = tslib_1.__importDefault(require("./BaseDriver"));
|
|
5
|
+
const DbResource_1 = require("../resource/DbResource");
|
|
6
|
+
const ioredis_1 = require("ioredis");
|
|
7
|
+
const ResultSetDataHolder_1 = tslib_1.__importDefault(require("../resource/ResultSetDataHolder"));
|
|
8
|
+
const RedisKeyType_1 = require("../resource/types/RedisKeyType");
|
|
9
|
+
const RedisRequest_1 = require("../../service/request/RedisRequest");
|
|
10
|
+
class RedisDriver extends BaseDriver_1.default {
|
|
8
11
|
constructor(conRes) {
|
|
9
12
|
super(conRes);
|
|
10
13
|
this.databases = 16;
|
|
11
14
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const options = Object.assign({
|
|
15
|
-
port: 6379,
|
|
16
|
-
host: '127.0.0.1',
|
|
17
|
-
password: 'auth',
|
|
18
|
-
db: 0,
|
|
19
|
-
}, {
|
|
20
|
-
port: this.conRes.port,
|
|
21
|
-
host: this.conRes.host,
|
|
22
|
-
password: this.conRes.password,
|
|
23
|
-
db: this.conRes.database,
|
|
24
|
-
retryStrategy: function () {
|
|
25
|
-
return 'No!';
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
if (this.isNeedsSsh()) {
|
|
29
|
-
options.host = '127.0.0.1';
|
|
30
|
-
options.port = this.sshLocalPort;
|
|
31
|
-
}
|
|
32
|
-
options.connectTimeout = 5000;
|
|
33
|
-
if (this.conRes.hasUrl()) {
|
|
34
|
-
this.client = new Redis(this.conRes.url);
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
this.client = new Redis(options);
|
|
38
|
-
}
|
|
15
|
+
connectSub() {
|
|
16
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
17
|
try {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
+
}
|
|
49
54
|
}
|
|
50
55
|
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
this.databases = 16;
|
|
58
|
+
}
|
|
51
59
|
}
|
|
52
60
|
catch (e) {
|
|
53
|
-
|
|
61
|
+
return e.message;
|
|
54
62
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return e.message;
|
|
58
|
-
}
|
|
59
|
-
return '';
|
|
63
|
+
return '';
|
|
64
|
+
});
|
|
60
65
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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();
|
|
68
79
|
}
|
|
69
80
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
await this.disconnect();
|
|
81
|
+
catch (e) {
|
|
82
|
+
errorReason = e.message;
|
|
73
83
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
errorReason = e.message;
|
|
77
|
-
}
|
|
78
|
-
return errorReason;
|
|
84
|
+
return errorReason;
|
|
85
|
+
});
|
|
79
86
|
}
|
|
80
|
-
|
|
81
|
-
return
|
|
87
|
+
requestSql(sql, options) {
|
|
88
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
return ResultSetDataHolder_1.default.createEmpty();
|
|
90
|
+
});
|
|
82
91
|
}
|
|
83
|
-
|
|
84
|
-
return
|
|
92
|
+
countTables(tables, options) {
|
|
93
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
return new Array();
|
|
95
|
+
});
|
|
85
96
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
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;
|
|
101
115
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
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
|
+
});
|
|
127
140
|
}
|
|
128
141
|
scan(db_index, key, count, with_value, progressCallback) {
|
|
129
142
|
return new Promise((resolve) => {
|
|
@@ -136,7 +149,7 @@ export default class RedisDriver extends BaseDriver {
|
|
|
136
149
|
const ret = new Array();
|
|
137
150
|
stream.on('data', (resultKeys) => {
|
|
138
151
|
resultKeys.forEach((key) => {
|
|
139
|
-
ret.push(new DbKey(key));
|
|
152
|
+
ret.push(new DbResource_1.DbKey(key));
|
|
140
153
|
});
|
|
141
154
|
progressCallback('Key scanning now.', Math.round((ret.length * 100) / count));
|
|
142
155
|
if (ret.length > count) {
|
|
@@ -150,72 +163,79 @@ export default class RedisDriver extends BaseDriver {
|
|
|
150
163
|
}
|
|
151
164
|
const parallels = [];
|
|
152
165
|
ret.forEach((keyRes) => {
|
|
153
|
-
parallels.push((
|
|
154
|
-
keyRes.type = RedisKeyType.parse(
|
|
155
|
-
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());
|
|
156
169
|
if (keyRes.ttl > 0) {
|
|
157
170
|
keyRes.ttlConfirmationDatetime = new Date().getTime();
|
|
158
171
|
}
|
|
159
172
|
if (with_value) {
|
|
160
|
-
keyRes.val =
|
|
173
|
+
keyRes.val = yield this.getValueByKey(currentClient, keyRes.getName(), keyRes.type);
|
|
161
174
|
}
|
|
162
|
-
})());
|
|
175
|
+
}))());
|
|
163
176
|
});
|
|
164
|
-
(
|
|
165
|
-
|
|
177
|
+
(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
yield Promise.all(parallels);
|
|
166
179
|
progressCallback('Key scanning done.', 100);
|
|
167
180
|
resolve(ret);
|
|
168
|
-
})();
|
|
181
|
+
}))();
|
|
169
182
|
});
|
|
170
183
|
});
|
|
171
184
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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
|
+
});
|
|
188
203
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
for (let i = 0; i < this.databases; i++) {
|
|
206
|
-
const name = `${i}`;
|
|
207
|
-
if (!dbResources.some((r) => r.getName() === name)) {
|
|
208
|
-
const dbRes = new 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);
|
|
209
219
|
dbResources.push(dbRes);
|
|
210
220
|
}
|
|
211
|
-
|
|
212
|
-
|
|
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
|
+
});
|
|
213
230
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
+
});
|
|
219
238
|
}
|
|
220
239
|
}
|
|
240
|
+
exports.default = RedisDriver;
|
|
221
241
|
//# sourceMappingURL=RedisDriver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedisDriver.js","sourceRoot":"","sources":["../../../../src/db/drivers/RedisDriver.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"RedisDriver.js","sourceRoot":"","sources":["../../../../src/db/drivers/RedisDriver.ts"],"names":[],"mappings":";;;AACA,sEAA6D;AAC7D,uDAOgC;AAChC,qCAAgC;AAChC,kGAAkE;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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AAI,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"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./AwsS3Driver"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./BaseDriver"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./MySQLDriver"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./PostgresDriver"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./RedisDriver"), exports);
|
|
6
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/db/drivers/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/db/drivers/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B;AAC9B,uDAA6B;AAC7B,wDAA8B;AAC9B,2DAAiC;AACjC,wDAA8B"}
|
package/built/src/db/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./DBError"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./drivers"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./resource"), exports);
|
|
4
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,oDAA0B;AAC1B,qDAA2B"}
|