tspace-mysql 1.2.9 → 1.3.1

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.
Files changed (56) hide show
  1. package/README.md +64 -14
  2. package/dist/cli/dump/db.d.ts +4 -4
  3. package/dist/cli/dump/db.js +25 -25
  4. package/dist/cli/generate/make.d.ts +4 -4
  5. package/dist/cli/generate/make.js +45 -45
  6. package/dist/cli/generate/model.d.ts +2 -2
  7. package/dist/cli/generate/model.js +6 -6
  8. package/dist/cli/index.d.ts +2 -2
  9. package/dist/cli/index.js +58 -58
  10. package/dist/cli/migrate/make.d.ts +4 -4
  11. package/dist/cli/migrate/make.js +30 -30
  12. package/dist/cli/models/make.d.ts +4 -4
  13. package/dist/cli/models/make.js +51 -51
  14. package/dist/cli/models/model.d.ts +2 -2
  15. package/dist/cli/models/model.js +20 -11
  16. package/dist/cli/query/index.d.ts +4 -4
  17. package/dist/cli/query/index.js +7 -7
  18. package/dist/cli/tables/make.d.ts +4 -4
  19. package/dist/cli/tables/make.js +26 -26
  20. package/dist/cli/tables/table.d.ts +2 -2
  21. package/dist/cli/tables/table.js +6 -6
  22. package/dist/lib/connection/index.d.ts +30 -30
  23. package/dist/lib/connection/index.js +144 -143
  24. package/dist/lib/connection/options.d.ts +15 -4
  25. package/dist/lib/connection/options.js +43 -42
  26. package/dist/lib/constants/index.d.ts +5 -8
  27. package/dist/lib/constants/index.js +162 -158
  28. package/dist/lib/index.d.ts +8 -8
  29. package/dist/lib/index.js +36 -36
  30. package/dist/lib/tspace/{AbstractDatabase.d.ts → AbstractBuilder.d.ts} +124 -116
  31. package/dist/lib/tspace/{AbstractDatabase.js → AbstractBuilder.js} +36 -34
  32. package/dist/lib/tspace/AbstractDB.d.ts +18 -18
  33. package/dist/lib/tspace/AbstractDB.js +11 -11
  34. package/dist/lib/tspace/AbstractModel.d.ts +41 -41
  35. package/dist/lib/tspace/AbstractModel.js +11 -11
  36. package/dist/lib/tspace/Blueprint.d.ts +136 -136
  37. package/dist/lib/tspace/Blueprint.js +228 -228
  38. package/dist/lib/tspace/{Database.d.ts → Builder.d.ts} +833 -706
  39. package/dist/lib/tspace/{Database.js → Builder.js} +2556 -2363
  40. package/dist/lib/tspace/DB.d.ts +152 -126
  41. package/dist/lib/tspace/DB.js +373 -264
  42. package/dist/lib/tspace/Interface.d.ts +110 -109
  43. package/dist/lib/tspace/Interface.js +2 -2
  44. package/dist/lib/tspace/Logger.d.ts +8 -8
  45. package/dist/lib/tspace/Logger.js +49 -49
  46. package/dist/lib/tspace/Model.d.ts +708 -609
  47. package/dist/lib/tspace/Model.js +2520 -2477
  48. package/dist/lib/tspace/ProxyHandler.d.ts +14 -14
  49. package/dist/lib/tspace/ProxyHandler.js +31 -31
  50. package/dist/lib/tspace/Schema.d.ts +8 -8
  51. package/dist/lib/tspace/Schema.js +45 -44
  52. package/dist/lib/tspace/index.d.ts +15 -15
  53. package/dist/lib/tspace/index.js +20 -20
  54. package/dist/lib/utils/index.d.ts +15 -15
  55. package/dist/lib/utils/index.js +155 -165
  56. package/package.json +2 -4
@@ -1,264 +1,373 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __rest = (this && this.__rest) || function (s, e) {
12
- var t = {};
13
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
- t[p] = s[p];
15
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
- t[p[i]] = s[p[i]];
19
- }
20
- return t;
21
- };
22
- Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.DB = void 0;
24
- const AbstractDB_1 = require("./AbstractDB");
25
- const ProxyHandler_1 = require("./ProxyHandler");
26
- const connection_1 = require("../connection");
27
- class DB extends AbstractDB_1.AbstractDB {
28
- constructor(table) {
29
- super();
30
- this._initialDB();
31
- if (table)
32
- this.table(table);
33
- return new Proxy(this, ProxyHandler_1.proxyHandler);
34
- }
35
- /**
36
- * Assign table name
37
- * @param {string} table table name
38
- * @return {this} this
39
- */
40
- table(table) {
41
- this.$state.set('SELECT', `${this.$constants('SELECT')} *`);
42
- this.$state.set('TABLE_NAME', `\`${table}\``);
43
- this.$state.set('FROM', `${this.$constants('FROM')}`);
44
- return this;
45
- }
46
- /**
47
- * Get constant
48
- * @param {string} constant
49
- * @return {string | object} string || object
50
- */
51
- constants(constant) {
52
- return this.$constants(constant);
53
- }
54
- /**
55
- * cases query
56
- * @param {arrayObject} cases array object {when , then }
57
- * @param {string?} final else condition
58
- * @return {string} string
59
- */
60
- caseUpdate(cases, final) {
61
- if (!cases.length)
62
- return [];
63
- let query = [];
64
- for (const c of cases) {
65
- if (c.when == null)
66
- throw new Error(`can't find when condition`);
67
- if (c.then == null)
68
- throw new Error(`can't find then condition`);
69
- query = [
70
- ...query,
71
- `${this.$constants('WHEN')} ${c.when} ${this.$constants('THEN')} ${c.then}`
72
- ];
73
- }
74
- return [
75
- this.$constants('RAW'),
76
- this.$constants('CASE'),
77
- query.join(' '),
78
- final == null ? '' : `ELSE ${final}`,
79
- this.$constants('END')
80
- ].join(' ');
81
- }
82
- /**
83
- * generate UUID
84
- * @return {string} string
85
- */
86
- generateUUID() {
87
- return this.$utils.generateUUID();
88
- }
89
- /**
90
- * Assign raw query for schema validation
91
- * @param {string} sql
92
- * @return {string} string
93
- */
94
- raw(sql) {
95
- return `${this.$constants('RAW')} ${sql}`;
96
- }
97
- /**
98
- * Get a pool connection
99
- * @param {Object} options options for connection database with credentials
100
- * @param {string} option.host
101
- * @param {number} option.port
102
- * @param {string} option.database
103
- * @param {string} option.username
104
- * @param {string} option.password
105
- * @return {Connection}
106
- */
107
- getConnection(options) {
108
- const { host, port, database, username: user, password } = options, others = __rest(options, ["host", "port", "database", "username", "password"]);
109
- const pool = new connection_1.PoolConnection(Object.assign({ host,
110
- port,
111
- database,
112
- user,
113
- password }, others));
114
- return pool.connection();
115
- }
116
- /**
117
- * Get a connection
118
- * @return {ConnectionTransaction} object
119
- * @type {object} connection
120
- * @property {function} connection.query - execute query sql then release connection to pool
121
- * @property {function} connection.startTransaction - start transaction of query
122
- * @property {function} connection.commit - commit transaction of query
123
- * @property {function} connection.rollback - rollback transaction of query
124
- */
125
- beginTransaction() {
126
- return __awaiter(this, void 0, void 0, function* () {
127
- const pool = yield this.$pool.get();
128
- return yield pool.connection();
129
- });
130
- }
131
- /**
132
- * Assign table name
133
- * @static
134
- * @param {string} table table name
135
- * @return {DB} DB
136
- */
137
- static table(table) {
138
- const self = new this();
139
- self.$state.set('SELECT', `${self.$constants('SELECT')} *`);
140
- self.$state.set('TABLE_NAME', `\`${table}\``);
141
- self.$state.set('FROM', `${self.$constants('FROM')}`);
142
- return self;
143
- }
144
- /**
145
- * select by cases
146
- * @static
147
- * @param {arrayObject} cases array object {when , then }
148
- * @param {string?} final else condition
149
- * @return {this}
150
- */
151
- static caseUpdate(cases, final) {
152
- if (!cases.length)
153
- return [];
154
- const self = new this();
155
- let query = [];
156
- for (const c of cases) {
157
- if (c.when == null)
158
- throw new Error(`can't find when condition`);
159
- if (c.then == null)
160
- throw new Error(`can't find then condition`);
161
- query = [
162
- ...query,
163
- `${self.$constants('WHEN')} ${c.when} ${self.$constants('THEN')} ${c.then}`
164
- ];
165
- }
166
- return [
167
- self.$constants('RAW'),
168
- self.$constants('CASE'),
169
- query.join(' '),
170
- final == null ? '' : `ELSE ${final}`,
171
- self.$constants('END'),
172
- ].join(' ');
173
- }
174
- /**
175
- * Assign raw query for schema validation
176
- * @static
177
- * @param {string} sql
178
- * @return {string} string
179
- */
180
- static raw(sql) {
181
- return `${new this().$constants('RAW')} ${sql}`;
182
- }
183
- /**
184
- * generate UUID
185
- * @static
186
- * @return {string} string
187
- */
188
- static generateUUID() {
189
- return new this().$utils.generateUUID();
190
- }
191
- /**
192
- * Get constant
193
- * @static
194
- * @param {string} constant
195
- * @return {string | object} string || object
196
- */
197
- static constants(constant) {
198
- return new this().$constants(constant);
199
- }
200
- /**
201
- * Get a connection
202
- * @static
203
- * @return {ConnectionTransaction} object
204
- * @type {object} connection
205
- * @property {function} connection.query - execute query sql then release connection to pool
206
- * @property {function} connection.startTransaction - start transaction of query
207
- * @property {function} connection.commit - commit transaction of query
208
- * @property {function} connection.rollback - rollback transaction of query
209
- */
210
- static beginTransaction() {
211
- return __awaiter(this, void 0, void 0, function* () {
212
- const self = new this();
213
- const pool = yield self.$pool.get();
214
- return yield pool.connection();
215
- });
216
- }
217
- /**
218
- * Get a pool connection
219
- * @param {Object} options options for connection database with credentials
220
- * @param {string} option.host
221
- * @param {number} option.port
222
- * @param {string} option.database
223
- * @param {string} option.username
224
- * @param {string} option.password
225
- * @return {Connection}
226
- */
227
- static getConnection(options) {
228
- const { host, port, database, username: user, password } = options, others = __rest(options, ["host", "port", "database", "username", "password"]);
229
- const pool = new connection_1.PoolConnection(Object.assign({ host,
230
- port,
231
- database,
232
- user,
233
- password }, others));
234
- return pool.connection();
235
- }
236
- _initialDB() {
237
- this.$state = (() => {
238
- let db = new Map(Object.entries(Object.assign({}, this.$constants('DB'))));
239
- return {
240
- original: () => db,
241
- get: (key) => {
242
- if (key == null)
243
- return db;
244
- if (!db.has(key))
245
- throw new Error(`can't get this [${key}]`);
246
- return db.get(key);
247
- },
248
- set: (key, value) => {
249
- if (!db.has(key))
250
- throw new Error(`can't set this [${key}]`);
251
- db.set(key, value);
252
- return;
253
- },
254
- clone: (data) => {
255
- db = new Map(Object.entries(Object.assign({}, data)));
256
- return;
257
- }
258
- };
259
- })();
260
- return this;
261
- }
262
- }
263
- exports.DB = DB;
264
- exports.default = DB;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.DB = void 0;
24
+ const AbstractDB_1 = require("./AbstractDB");
25
+ const ProxyHandler_1 = require("./ProxyHandler");
26
+ const connection_1 = require("../connection");
27
+ class DB extends AbstractDB_1.AbstractDB {
28
+ constructor(table) {
29
+ super();
30
+ this._initialDB();
31
+ if (table)
32
+ this.table(table);
33
+ return new Proxy(this, ProxyHandler_1.proxyHandler);
34
+ }
35
+ union(a, b) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ return yield this.queryStatement([
38
+ a,
39
+ 'UNION',
40
+ b
41
+ ].join(' '));
42
+ });
43
+ }
44
+ /**
45
+ * Covert result to array
46
+ * @param {any} result table name
47
+ * @return {Array} array
48
+ */
49
+ makeArray(result) {
50
+ switch (this._typeOf(result)) {
51
+ case 'object': {
52
+ if (Object.keys(result).length)
53
+ return [result];
54
+ return [];
55
+ }
56
+ case 'array': {
57
+ return result;
58
+ }
59
+ case 'undefined':
60
+ case 'null': {
61
+ return [];
62
+ }
63
+ default: return [].concat(result);
64
+ }
65
+ }
66
+ /**
67
+ * Covert result to object or null
68
+ * @param {any} result table name
69
+ * @return {Record | null} object or null
70
+ */
71
+ makeObject(result) {
72
+ switch (this._typeOf(result)) {
73
+ case 'object': {
74
+ if (Object.keys(result).length)
75
+ return result;
76
+ return null;
77
+ }
78
+ case 'array': {
79
+ if (result[0] == null)
80
+ return null;
81
+ return result[0];
82
+ }
83
+ case 'undefined':
84
+ case 'null': {
85
+ return null;
86
+ }
87
+ default: return {
88
+ "0": result
89
+ };
90
+ }
91
+ }
92
+ /**
93
+ * Assign table name
94
+ * @param {string} table table name
95
+ * @return {this} this
96
+ */
97
+ table(table) {
98
+ this.$state.set('SELECT', `${this.$constants('SELECT')} *`);
99
+ this.$state.set('TABLE_NAME', `\`${table}\``);
100
+ this.$state.set('FROM', `${this.$constants('FROM')}`);
101
+ return this;
102
+ }
103
+ /**
104
+ * Get constant
105
+ * @param {string} constant
106
+ * @return {string | object} string || object
107
+ */
108
+ constants(constant) {
109
+ return this.$constants(constant);
110
+ }
111
+ /**
112
+ * cases query
113
+ * @param {arrayObject} cases array object {when , then }
114
+ * @param {string?} final else condition
115
+ * @return {string} string
116
+ */
117
+ caseUpdate(cases, final) {
118
+ if (!cases.length)
119
+ return [];
120
+ let query = [];
121
+ for (const c of cases) {
122
+ if (c.when == null)
123
+ throw new Error(`can't find when condition`);
124
+ if (c.then == null)
125
+ throw new Error(`can't find then condition`);
126
+ query = [
127
+ ...query,
128
+ `${this.$constants('WHEN')} ${c.when} ${this.$constants('THEN')} ${c.then}`
129
+ ];
130
+ }
131
+ return [
132
+ this.$constants('RAW'),
133
+ this.$constants('CASE'),
134
+ query.join(' '),
135
+ final == null ? '' : `ELSE ${final}`,
136
+ this.$constants('END')
137
+ ].join(' ');
138
+ }
139
+ /**
140
+ * generate UUID
141
+ * @return {string} string
142
+ */
143
+ generateUUID() {
144
+ return this.$utils.generateUUID();
145
+ }
146
+ /**
147
+ * Assign raw query for schema validation
148
+ * @param {string} sql
149
+ * @return {string} string
150
+ */
151
+ raw(sql) {
152
+ return `${this.$constants('RAW')} ${sql}`;
153
+ }
154
+ /**
155
+ * Get a pool connection
156
+ * @param {Object} options options for connection database with credentials
157
+ * @param {string} option.host
158
+ * @param {number} option.port
159
+ * @param {string} option.database
160
+ * @param {string} option.username
161
+ * @param {string} option.password
162
+ * @return {Connection}
163
+ */
164
+ getConnection(options) {
165
+ const { host, port, database, username: user, password } = options, others = __rest(options, ["host", "port", "database", "username", "password"]);
166
+ const pool = new connection_1.PoolConnection(Object.assign({ host,
167
+ port,
168
+ database,
169
+ user,
170
+ password }, others));
171
+ return pool.connection();
172
+ }
173
+ /**
174
+ * Covert result to array
175
+ * @param {any} result table name
176
+ * @return {Array} array
177
+ */
178
+ static makeArray(result) {
179
+ switch (new this()._typeOf(result)) {
180
+ case 'object': {
181
+ if (Object.keys(result).length)
182
+ return [result];
183
+ return [];
184
+ }
185
+ case 'array': {
186
+ return result;
187
+ }
188
+ case 'undefined':
189
+ case 'null': {
190
+ return [];
191
+ }
192
+ default: return [].concat(result);
193
+ }
194
+ }
195
+ /**
196
+ * Covert result to object | null
197
+ * @param {any} result table name
198
+ * @return {Record | null} object | null
199
+ */
200
+ static makeObject(result) {
201
+ switch (new this()._typeOf(result)) {
202
+ case 'object': {
203
+ if (Object.keys(result).length)
204
+ return result;
205
+ return null;
206
+ }
207
+ case 'array': {
208
+ if (result[0] == null)
209
+ return null;
210
+ return result[0];
211
+ }
212
+ case 'undefined':
213
+ case 'null': {
214
+ return null;
215
+ }
216
+ default: return {
217
+ "0": result
218
+ };
219
+ }
220
+ }
221
+ /**
222
+ * Get a connection
223
+ * @return {ConnectionTransaction} object - Connection for the transaction
224
+ * @type {object} connection
225
+ * @property {function} connection.query - execute query sql then release connection to pool
226
+ * @property {function} connection.startTransaction - start transaction of query
227
+ * @property {function} connection.commit - commit transaction of query
228
+ * @property {function} connection.rollback - rollback transaction of query
229
+ */
230
+ beginTransaction() {
231
+ return __awaiter(this, void 0, void 0, function* () {
232
+ const pool = yield this.$pool.get();
233
+ return yield pool.connection();
234
+ });
235
+ }
236
+ /**
237
+ * Assign table name
238
+ * @static
239
+ * @param {string} table table name
240
+ * @return {DB} DB
241
+ */
242
+ static table(table) {
243
+ const self = new this();
244
+ self.$state.set('SELECT', `${self.$constants('SELECT')} *`);
245
+ self.$state.set('TABLE_NAME', `\`${table}\``);
246
+ self.$state.set('FROM', `${self.$constants('FROM')}`);
247
+ return self;
248
+ }
249
+ /**
250
+ * select by cases
251
+ * @static
252
+ * @param {arrayObject} cases array object {when , then }
253
+ * @param {string?} final else condition
254
+ * @return {this}
255
+ */
256
+ static caseUpdate(cases, final) {
257
+ if (!cases.length)
258
+ return [];
259
+ const self = new this();
260
+ let query = [];
261
+ for (const c of cases) {
262
+ if (c.when == null)
263
+ throw new Error(`can't find when condition`);
264
+ if (c.then == null)
265
+ throw new Error(`can't find then condition`);
266
+ query = [
267
+ ...query,
268
+ `${self.$constants('WHEN')} ${c.when} ${self.$constants('THEN')} ${c.then}`
269
+ ];
270
+ }
271
+ return [
272
+ self.$constants('RAW'),
273
+ self.$constants('CASE'),
274
+ query.join(' '),
275
+ final == null ? '' : `ELSE ${final}`,
276
+ self.$constants('END'),
277
+ ].join(' ');
278
+ }
279
+ /**
280
+ * Assign raw query for schema validation
281
+ * @static
282
+ * @param {string} sql
283
+ * @return {string} string
284
+ */
285
+ static raw(sql) {
286
+ return `${new this().$constants('RAW')} ${sql}`;
287
+ }
288
+ /**
289
+ * generate UUID
290
+ * @static
291
+ * @return {string} string
292
+ */
293
+ static generateUUID() {
294
+ return new this().$utils.generateUUID();
295
+ }
296
+ /**
297
+ * Get constant
298
+ * @static
299
+ * @param {string} constant
300
+ * @return {string | object} string || object
301
+ */
302
+ static constants(constant) {
303
+ return new this().$constants(constant);
304
+ }
305
+ /**
306
+ * Get a connection
307
+ * @static
308
+ * @return {ConnectionTransaction} object - Connection for the transaction
309
+ * @type {object} connection
310
+ * @property {function} connection.query - execute query sql then release connection to pool
311
+ * @property {function} connection.startTransaction - start transaction of query
312
+ * @property {function} connection.commit - commit transaction of query
313
+ * @property {function} connection.rollback - rollback transaction of query
314
+ */
315
+ static beginTransaction() {
316
+ return __awaiter(this, void 0, void 0, function* () {
317
+ const self = new this();
318
+ const pool = yield self.$pool.get();
319
+ return yield pool.connection();
320
+ });
321
+ }
322
+ /**
323
+ * Get a pool connection
324
+ * @param {Object} options options for connection database with credentials
325
+ * @param {string} option.host
326
+ * @param {number} option.port
327
+ * @param {string} option.database
328
+ * @param {string} option.username
329
+ * @param {string} option.password
330
+ * @return {Connection}
331
+ */
332
+ static getConnection(options) {
333
+ const { host, port, database, username: user, password } = options, others = __rest(options, ["host", "port", "database", "username", "password"]);
334
+ const pool = new connection_1.PoolConnection(Object.assign({ host,
335
+ port,
336
+ database,
337
+ user,
338
+ password }, others));
339
+ return pool.connection();
340
+ }
341
+ _typeOf(data) {
342
+ return Object.prototype.toString.apply(data).slice(8, -1).toLocaleLowerCase();
343
+ }
344
+ _initialDB() {
345
+ this.$state = (() => {
346
+ let db = new Map(Object.entries(Object.assign({}, this.$constants('DB'))));
347
+ let original = new Map(Object.entries(Object.assign({}, this.$constants('DB'))));
348
+ return {
349
+ original: () => original,
350
+ get: (key) => {
351
+ if (key == null)
352
+ return db;
353
+ if (!db.has(key))
354
+ throw new Error(`can't get this [${key}]`);
355
+ return db.get(key);
356
+ },
357
+ set: (key, value) => {
358
+ if (!db.has(key))
359
+ throw new Error(`can't set this [${key}]`);
360
+ db.set(key, value);
361
+ return;
362
+ },
363
+ clone: (data) => {
364
+ db = new Map(Object.entries(Object.assign({}, data)));
365
+ return;
366
+ }
367
+ };
368
+ })();
369
+ return this;
370
+ }
371
+ }
372
+ exports.DB = DB;
373
+ exports.default = DB;