db-wrapper 0.0.5 → 0.0.8
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/bundles/db-wrapper.umd.js +659 -745
- package/bundles/db-wrapper.umd.js.map +1 -1
- package/bundles/db-wrapper.umd.min.js +15 -1
- package/bundles/db-wrapper.umd.min.js.map +1 -1
- package/db-wrapper.metadata.json +1 -1
- package/esm2015/db-wrapper.js +2 -6
- package/esm2015/lib/db-wrapper.models.js +45 -206
- package/esm2015/lib/db-wrapper.module.js +10 -16
- package/esm2015/lib/db-wrapper.service.js +166 -427
- package/esm2015/lib/window.service.js +8 -16
- package/esm2015/public-api.js +4 -8
- package/esm5/db-wrapper.js +2 -6
- package/esm5/lib/db-wrapper.models.js +45 -206
- package/esm5/lib/db-wrapper.module.js +9 -20
- package/esm5/lib/db-wrapper.service.js +198 -528
- package/esm5/lib/window.service.js +6 -15
- package/esm5/public-api.js +4 -8
- package/fesm2015/db-wrapper.js +226 -486
- package/fesm2015/db-wrapper.js.map +1 -1
- package/fesm5/db-wrapper.js +257 -590
- package/fesm5/db-wrapper.js.map +1 -1
- package/lib/db-wrapper.service.d.ts +5 -0
- package/lib/window.service.d.ts +1 -1
- package/package.json +7 -7
package/fesm5/db-wrapper.js
CHANGED
|
@@ -1,434 +1,235 @@
|
|
|
1
|
+
import { __decorate, __awaiter, __generator } from 'tslib';
|
|
1
2
|
import { Injectable, InjectionToken, NgModule } from '@angular/core';
|
|
2
3
|
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview added by tsickle
|
|
5
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
6
|
-
*/
|
|
7
4
|
var WindowService = /** @class */ (function () {
|
|
8
5
|
function WindowService() {
|
|
9
6
|
}
|
|
10
7
|
Object.defineProperty(WindowService.prototype, "nativeWindow", {
|
|
11
|
-
get:
|
|
12
|
-
* @return {?}
|
|
13
|
-
*/
|
|
14
|
-
function () {
|
|
8
|
+
get: function () {
|
|
15
9
|
return _window();
|
|
16
10
|
},
|
|
17
11
|
enumerable: true,
|
|
18
12
|
configurable: true
|
|
19
13
|
});
|
|
20
|
-
WindowService
|
|
21
|
-
|
|
22
|
-
];
|
|
14
|
+
WindowService = __decorate([
|
|
15
|
+
Injectable()
|
|
16
|
+
], WindowService);
|
|
23
17
|
return WindowService;
|
|
24
18
|
}());
|
|
25
|
-
/**
|
|
26
|
-
* @return {?}
|
|
27
|
-
*/
|
|
28
19
|
function _window() {
|
|
29
20
|
// Return the global native browser window object
|
|
30
21
|
return typeof window !== 'undefined' ? window : undefined;
|
|
31
22
|
}
|
|
32
23
|
|
|
33
|
-
/**
|
|
34
|
-
* @fileoverview added by tsickle
|
|
35
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
36
|
-
*/
|
|
37
24
|
var DbWrapperService = /** @class */ (function () {
|
|
38
25
|
function DbWrapperService(dbConfig, dbSchema) {
|
|
39
26
|
var _this = this;
|
|
40
27
|
this._dbName = dbConfig.dbName;
|
|
41
28
|
this._location = dbConfig.location || 'default';
|
|
42
29
|
this._iosDatabaseLocation = dbConfig.iosDatabaseLocation || 'Library';
|
|
43
|
-
/** @type {?} */
|
|
44
30
|
var window = (new WindowService()).nativeWindow;
|
|
45
31
|
if (dbSchema) {
|
|
46
32
|
this.schema = dbSchema;
|
|
47
33
|
}
|
|
48
|
-
this._readyPromise = new Promise((
|
|
49
|
-
* @param {?} resolve
|
|
50
|
-
* @param {?} reject
|
|
51
|
-
* @return {?}
|
|
52
|
-
*/
|
|
53
|
-
function (resolve, reject) {
|
|
34
|
+
this._readyPromise = new Promise(function (resolve, reject) {
|
|
54
35
|
if (typeof window.cordova === 'undefined') {
|
|
55
|
-
setTimeout((
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
* @param {?} err
|
|
64
|
-
* @return {?}
|
|
65
|
-
*/
|
|
66
|
-
function (err) { return reject(err); }));
|
|
67
|
-
}), 500);
|
|
36
|
+
setTimeout(function () {
|
|
37
|
+
_this.init(dbSchema).then(function () {
|
|
38
|
+
resolve();
|
|
39
|
+
})
|
|
40
|
+
.catch(function (err) {
|
|
41
|
+
reject(err);
|
|
42
|
+
});
|
|
43
|
+
}, 500);
|
|
68
44
|
}
|
|
69
45
|
else {
|
|
70
|
-
document.addEventListener('deviceready', (
|
|
71
|
-
* @return {?}
|
|
72
|
-
*/
|
|
73
|
-
function () {
|
|
46
|
+
document.addEventListener('deviceready', function () {
|
|
74
47
|
console.log('dbWrapper: device ready.');
|
|
75
|
-
_this.initDevice(dbSchema).then((
|
|
76
|
-
|
|
77
|
-
*/
|
|
78
|
-
function () { return resolve(); })).catch((/**
|
|
79
|
-
* @param {?} err
|
|
80
|
-
* @return {?}
|
|
81
|
-
*/
|
|
82
|
-
function (err) { return reject(err); }));
|
|
83
|
-
}));
|
|
48
|
+
_this.initDevice(dbSchema).then(function () { return resolve(); }).catch(function (err) { return reject(err); });
|
|
49
|
+
});
|
|
84
50
|
}
|
|
85
|
-
})
|
|
51
|
+
});
|
|
86
52
|
}
|
|
87
|
-
|
|
88
|
-
* @return {?}
|
|
89
|
-
*/
|
|
90
|
-
DbWrapperService.prototype.ready = /**
|
|
91
|
-
* @return {?}
|
|
92
|
-
*/
|
|
93
|
-
function () {
|
|
53
|
+
DbWrapperService.prototype.ready = function () {
|
|
94
54
|
return this._readyPromise;
|
|
95
55
|
};
|
|
96
|
-
|
|
97
|
-
* @param {?} dbSchema
|
|
98
|
-
* @return {?}
|
|
99
|
-
*/
|
|
100
|
-
DbWrapperService.prototype.initDevice = /**
|
|
101
|
-
* @param {?} dbSchema
|
|
102
|
-
* @return {?}
|
|
103
|
-
*/
|
|
104
|
-
function (dbSchema) {
|
|
56
|
+
DbWrapperService.prototype.initDevice = function (dbSchema) {
|
|
105
57
|
var _this = this;
|
|
106
|
-
/** @type {?} */
|
|
107
58
|
var window = (new WindowService()).nativeWindow;
|
|
108
|
-
return new Promise((
|
|
109
|
-
* @param {?} resolve
|
|
110
|
-
* @param {?} reject
|
|
111
|
-
* @return {?}
|
|
112
|
-
*/
|
|
113
|
-
function (resolve, reject) {
|
|
59
|
+
return new Promise(function (resolve, reject) {
|
|
114
60
|
_this.db = window.sqlitePlugin.openDatabase({
|
|
115
61
|
name: _this._dbName,
|
|
116
62
|
location: _this._location,
|
|
117
63
|
androidLockWorkaround: 1
|
|
118
64
|
});
|
|
119
65
|
if (dbSchema) {
|
|
120
|
-
_this.generate(dbSchema).catch((
|
|
121
|
-
* @param {?} err
|
|
122
|
-
* @return {?}
|
|
123
|
-
*/
|
|
124
|
-
function (err) {
|
|
66
|
+
_this.generate(dbSchema).catch(function (err) {
|
|
125
67
|
reject(err);
|
|
126
|
-
})
|
|
127
|
-
* @return {?}
|
|
128
|
-
*/
|
|
129
|
-
function () { resolve(); }));
|
|
68
|
+
}).then(function () { resolve(); });
|
|
130
69
|
}
|
|
131
70
|
else {
|
|
132
71
|
resolve();
|
|
133
72
|
}
|
|
134
|
-
})
|
|
73
|
+
});
|
|
135
74
|
};
|
|
136
|
-
|
|
137
|
-
* @param {?} dbSchema
|
|
138
|
-
* @return {?}
|
|
139
|
-
*/
|
|
140
|
-
DbWrapperService.prototype.init = /**
|
|
141
|
-
* @param {?} dbSchema
|
|
142
|
-
* @return {?}
|
|
143
|
-
*/
|
|
144
|
-
function (dbSchema) {
|
|
75
|
+
DbWrapperService.prototype.init = function (dbSchema) {
|
|
145
76
|
var _this = this;
|
|
146
|
-
/** @type {?} */
|
|
147
77
|
var window = (new WindowService()).nativeWindow;
|
|
148
|
-
return new Promise((
|
|
149
|
-
* @param {?} resolve
|
|
150
|
-
* @param {?} reject
|
|
151
|
-
* @return {?}
|
|
152
|
-
*/
|
|
153
|
-
function (resolve, reject) {
|
|
78
|
+
return new Promise(function (resolve, reject) {
|
|
154
79
|
_this.db = window.openDatabase(_this._dbName, '1.0', 'database', -1);
|
|
155
80
|
if (dbSchema) {
|
|
156
|
-
_this.generate(dbSchema).catch((
|
|
157
|
-
* @param {?} err
|
|
158
|
-
* @return {?}
|
|
159
|
-
*/
|
|
160
|
-
function (err) {
|
|
81
|
+
_this.generate(dbSchema).catch(function (err) {
|
|
161
82
|
reject(err);
|
|
162
|
-
})
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
function () { resolve(); }));
|
|
83
|
+
}).then(function () {
|
|
84
|
+
resolve();
|
|
85
|
+
});
|
|
166
86
|
}
|
|
167
87
|
else {
|
|
168
88
|
resolve();
|
|
169
89
|
}
|
|
170
|
-
})
|
|
90
|
+
});
|
|
171
91
|
};
|
|
172
|
-
|
|
173
|
-
* @param {?} schema
|
|
174
|
-
* @return {?}
|
|
175
|
-
*/
|
|
176
|
-
DbWrapperService.prototype.generate = /**
|
|
177
|
-
* @param {?} schema
|
|
178
|
-
* @return {?}
|
|
179
|
-
*/
|
|
180
|
-
function (schema) {
|
|
92
|
+
DbWrapperService.prototype.generate = function (schema) {
|
|
181
93
|
var _this = this;
|
|
182
|
-
/** @type {?} */
|
|
183
94
|
var sentences = [];
|
|
184
95
|
this.schema = schema;
|
|
185
96
|
if (schema.tables) {
|
|
186
|
-
schema.tables.forEach((
|
|
187
|
-
* @param {?} table
|
|
188
|
-
* @return {?}
|
|
189
|
-
*/
|
|
190
|
-
function (table) {
|
|
97
|
+
schema.tables.forEach(function (table) {
|
|
191
98
|
sentences.push(_this.createTable(table));
|
|
192
|
-
})
|
|
99
|
+
});
|
|
193
100
|
}
|
|
194
101
|
if (schema.views) {
|
|
195
|
-
schema.views.forEach((
|
|
196
|
-
* @param {?} view
|
|
197
|
-
* @return {?}
|
|
198
|
-
*/
|
|
199
|
-
function (view) {
|
|
102
|
+
schema.views.forEach(function (view) {
|
|
200
103
|
sentences.push(_this.createView(view));
|
|
201
|
-
})
|
|
104
|
+
});
|
|
202
105
|
}
|
|
203
106
|
if (sentences.length === 0) {
|
|
204
107
|
throw new Error('Esquema de la base de datos vacia.');
|
|
205
108
|
}
|
|
206
109
|
return Promise.all(sentences);
|
|
207
110
|
};
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
111
|
+
DbWrapperService.prototype.createTable = function (table) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
113
|
+
var sql, onConflictPrimary, sentences, newColumns, tableDDL;
|
|
114
|
+
var _this = this;
|
|
115
|
+
return __generator(this, function (_a) {
|
|
116
|
+
switch (_a.label) {
|
|
117
|
+
case 0:
|
|
118
|
+
sql = '';
|
|
119
|
+
sentences = [], newColumns = [];
|
|
120
|
+
return [4 /*yield*/, this._tableExists(table.name)];
|
|
121
|
+
case 1:
|
|
122
|
+
tableDDL = _a.sent();
|
|
123
|
+
if (tableDDL) {
|
|
124
|
+
table.columns.forEach(function (col) {
|
|
125
|
+
if (!_this._columnExists(tableDDL, col.name)) {
|
|
126
|
+
newColumns.push(_this.addColumn(table.name, col));
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
table.columns.forEach(function (col) {
|
|
132
|
+
sentences.push(_this.defColumn(col));
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
onConflictPrimary = 'on conflict fail';
|
|
136
|
+
if (Array.isArray(table.primary)) {
|
|
137
|
+
sentences.push(' CONSTRAINT identificador PRIMARY KEY (' + table.primary.join(',') + ') ' + onConflictPrimary);
|
|
138
|
+
}
|
|
139
|
+
if (typeof table.primary === 'string') {
|
|
140
|
+
sentences.push(' CONSTRAINT identificador PRIMARY KEY (' + table.primary + ') ' + onConflictPrimary);
|
|
141
|
+
}
|
|
142
|
+
if (table.uniques) {
|
|
143
|
+
table.uniques.forEach(function (uniq) {
|
|
144
|
+
sentences.push(_this.defUnique(uniq));
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
if (table.foreigns) {
|
|
148
|
+
table.foreigns.forEach(function (fore) {
|
|
149
|
+
sentences.push(_this.defForeign(fore));
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
if (tableDDL && newColumns.length !== 0) {
|
|
153
|
+
return [2 /*return*/, Promise.all(newColumns)
|
|
154
|
+
.then(function () { console.log("Table " + table.name + " altered."); })
|
|
155
|
+
.catch(function (err) {
|
|
156
|
+
console.error("Table " + table.name + ": " + err.message);
|
|
157
|
+
throw new Error("Table " + table.name + ": " + err.message);
|
|
158
|
+
})];
|
|
159
|
+
}
|
|
160
|
+
else if (!tableDDL) {
|
|
161
|
+
sql = 'CREATE TABLE IF NOT EXISTS ' + table.name + ' (' + sentences.join(',') + ')';
|
|
162
|
+
return [2 /*return*/, this.query(sql)
|
|
163
|
+
.then(function () { console.log("Table " + table.name + " created."); })
|
|
164
|
+
.catch(function (err) {
|
|
165
|
+
console.error("Table " + table.name + ": " + err.message);
|
|
166
|
+
throw new Error("Table " + table.name + ": " + err.message);
|
|
167
|
+
})];
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
return [2 /*return*/, Promise.resolve().then(function () { console.log("Table " + table.name + " initialized."); })];
|
|
171
|
+
}
|
|
172
|
+
return [2 /*return*/];
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
});
|
|
258
176
|
};
|
|
259
|
-
|
|
260
|
-
* @param {?} view
|
|
261
|
-
* @return {?}
|
|
262
|
-
*/
|
|
263
|
-
DbWrapperService.prototype.createView = /**
|
|
264
|
-
* @param {?} view
|
|
265
|
-
* @return {?}
|
|
266
|
-
*/
|
|
267
|
-
function (view) {
|
|
268
|
-
/** @type {?} */
|
|
177
|
+
DbWrapperService.prototype.createView = function (view) {
|
|
269
178
|
var sql;
|
|
270
179
|
sql = 'CREATE VIEW IF NOT EXISTS ' + view.name
|
|
271
180
|
+ ' AS ' + view.sql;
|
|
272
181
|
return this.query(sql);
|
|
273
182
|
};
|
|
274
|
-
|
|
275
|
-
* @param {?} tableName
|
|
276
|
-
* @return {?}
|
|
277
|
-
*/
|
|
278
|
-
DbWrapperService.prototype.getSchemaTable = /**
|
|
279
|
-
* @param {?} tableName
|
|
280
|
-
* @return {?}
|
|
281
|
-
*/
|
|
282
|
-
function (tableName) {
|
|
283
|
-
/** @type {?} */
|
|
183
|
+
DbWrapperService.prototype.getSchemaTable = function (tableName) {
|
|
284
184
|
var res;
|
|
285
|
-
this.schema.tables.forEach((
|
|
286
|
-
* @param {?} table
|
|
287
|
-
* @return {?}
|
|
288
|
-
*/
|
|
289
|
-
function (table) {
|
|
185
|
+
this.schema.tables.forEach(function (table) {
|
|
290
186
|
if (table.name === tableName) {
|
|
291
187
|
res = table;
|
|
292
188
|
}
|
|
293
|
-
})
|
|
189
|
+
});
|
|
294
190
|
return res;
|
|
295
191
|
};
|
|
296
|
-
|
|
297
|
-
* @param {?} table
|
|
298
|
-
* @return {?}
|
|
299
|
-
*/
|
|
300
|
-
DbWrapperService.prototype.getUniquesTable = /**
|
|
301
|
-
* @param {?} table
|
|
302
|
-
* @return {?}
|
|
303
|
-
*/
|
|
304
|
-
function (table) {
|
|
305
|
-
/** @type {?} */
|
|
192
|
+
DbWrapperService.prototype.getUniquesTable = function (table) {
|
|
306
193
|
var res;
|
|
307
|
-
table.uniques.forEach((
|
|
308
|
-
* @param {?} uniq
|
|
309
|
-
* @return {?}
|
|
310
|
-
*/
|
|
311
|
-
function (uniq) {
|
|
194
|
+
table.uniques.forEach(function (uniq) {
|
|
312
195
|
res[uniq.name] = uniq;
|
|
313
|
-
})
|
|
196
|
+
});
|
|
314
197
|
return res;
|
|
315
198
|
};
|
|
316
|
-
|
|
317
|
-
* @param {?} query
|
|
318
|
-
* @param {?=} bindings
|
|
319
|
-
* @return {?}
|
|
320
|
-
*/
|
|
321
|
-
DbWrapperService.prototype.query = /**
|
|
322
|
-
* @param {?} query
|
|
323
|
-
* @param {?=} bindings
|
|
324
|
-
* @return {?}
|
|
325
|
-
*/
|
|
326
|
-
function (query, bindings) {
|
|
199
|
+
DbWrapperService.prototype.query = function (query, bindings) {
|
|
327
200
|
var _this = this;
|
|
328
201
|
if (bindings === void 0) { bindings = []; }
|
|
329
|
-
return new Promise((
|
|
330
|
-
* @param {?} resolve
|
|
331
|
-
* @param {?} reject
|
|
332
|
-
* @return {?}
|
|
333
|
-
*/
|
|
334
|
-
function (resolve, reject) {
|
|
202
|
+
return new Promise(function (resolve, reject) {
|
|
335
203
|
if (query.indexOf('select') === 0) {
|
|
336
|
-
_this.db.readTransaction((
|
|
337
|
-
|
|
338
|
-
* @return {?}
|
|
339
|
-
*/
|
|
340
|
-
function (transaction) {
|
|
341
|
-
transaction.executeSql(query, bindings, (/**
|
|
342
|
-
* @param {?} transaction
|
|
343
|
-
* @param {?} result
|
|
344
|
-
* @return {?}
|
|
345
|
-
*/
|
|
346
|
-
function (transaction, result) {
|
|
204
|
+
_this.db.readTransaction(function (transaction) {
|
|
205
|
+
transaction.executeSql(query, bindings, function (transaction, result) {
|
|
347
206
|
resolve(result);
|
|
348
|
-
}
|
|
349
|
-
* @param {?} transaction
|
|
350
|
-
* @param {?} error
|
|
351
|
-
* @return {?}
|
|
352
|
-
*/
|
|
353
|
-
function (transaction, error) {
|
|
207
|
+
}, function (transaction, error) {
|
|
354
208
|
reject(error);
|
|
355
|
-
})
|
|
356
|
-
}
|
|
357
|
-
* @param {?} err
|
|
358
|
-
* @return {?}
|
|
359
|
-
*/
|
|
360
|
-
function (err) { return reject(err); }));
|
|
209
|
+
});
|
|
210
|
+
}, function (err) { return reject(err); });
|
|
361
211
|
}
|
|
362
212
|
else {
|
|
363
|
-
_this.db.transaction((
|
|
364
|
-
|
|
365
|
-
* @return {?}
|
|
366
|
-
*/
|
|
367
|
-
function (transaction) {
|
|
368
|
-
transaction.executeSql(query, bindings, (/**
|
|
369
|
-
* @param {?} transaction
|
|
370
|
-
* @param {?} result
|
|
371
|
-
* @return {?}
|
|
372
|
-
*/
|
|
373
|
-
function (transaction, result) {
|
|
213
|
+
_this.db.transaction(function (transaction) {
|
|
214
|
+
transaction.executeSql(query, bindings, function (transaction, result) {
|
|
374
215
|
resolve(result);
|
|
375
|
-
}
|
|
376
|
-
* @param {?} transaction
|
|
377
|
-
* @param {?} error
|
|
378
|
-
* @return {?}
|
|
379
|
-
*/
|
|
380
|
-
function (transaction, error) {
|
|
216
|
+
}, function (transaction, error) {
|
|
381
217
|
reject(error);
|
|
382
|
-
})
|
|
383
|
-
}
|
|
384
|
-
* @param {?} err
|
|
385
|
-
* @return {?}
|
|
386
|
-
*/
|
|
387
|
-
function (err) { return reject(err); }));
|
|
218
|
+
});
|
|
219
|
+
}, function (err) { return reject(err); });
|
|
388
220
|
}
|
|
389
|
-
})
|
|
221
|
+
});
|
|
390
222
|
};
|
|
391
|
-
|
|
392
|
-
* @param {?} query
|
|
393
|
-
* @param {?=} bindings
|
|
394
|
-
* @return {?}
|
|
395
|
-
*/
|
|
396
|
-
DbWrapperService.prototype.Count = /**
|
|
397
|
-
* @param {?} query
|
|
398
|
-
* @param {?=} bindings
|
|
399
|
-
* @return {?}
|
|
400
|
-
*/
|
|
401
|
-
function (query, bindings) {
|
|
223
|
+
DbWrapperService.prototype.Count = function (query, bindings) {
|
|
402
224
|
var _this = this;
|
|
403
225
|
if (bindings === void 0) { bindings = []; }
|
|
404
|
-
return this.query(query, bindings).then((
|
|
405
|
-
* @param {?} rows
|
|
406
|
-
* @return {?}
|
|
407
|
-
*/
|
|
408
|
-
function (rows) {
|
|
226
|
+
return this.query(query, bindings).then(function (rows) {
|
|
409
227
|
return _this.rowsCount(rows);
|
|
410
|
-
})
|
|
228
|
+
});
|
|
411
229
|
};
|
|
412
|
-
|
|
413
|
-
* @param {?} table
|
|
414
|
-
* @param {?} bindings
|
|
415
|
-
* @return {?}
|
|
416
|
-
*/
|
|
417
|
-
DbWrapperService.prototype.insert = /**
|
|
418
|
-
* @param {?} table
|
|
419
|
-
* @param {?} bindings
|
|
420
|
-
* @return {?}
|
|
421
|
-
*/
|
|
422
|
-
function (table, bindings) {
|
|
230
|
+
DbWrapperService.prototype.insert = function (table, bindings) {
|
|
423
231
|
var _this = this;
|
|
424
|
-
|
|
425
|
-
var sql = '';
|
|
426
|
-
/** @type {?} */
|
|
427
|
-
var sqlBinds = [];
|
|
428
|
-
/** @type {?} */
|
|
429
|
-
var sqlKeys = [];
|
|
430
|
-
/** @type {?} */
|
|
431
|
-
var sqlValues = [];
|
|
232
|
+
var sql = '', sqlBinds = [], sqlKeys = [], sqlValues = [];
|
|
432
233
|
sql = sql + 'insert into ' + table + ' ';
|
|
433
234
|
for (var index in bindings) {
|
|
434
235
|
if (bindings.hasOwnProperty(index)) {
|
|
@@ -438,61 +239,22 @@ var DbWrapperService = /** @class */ (function () {
|
|
|
438
239
|
}
|
|
439
240
|
}
|
|
440
241
|
sql = sql + '(' + sqlKeys.join(',') + ') values (' + sqlBinds.join(',') + ')';
|
|
441
|
-
return new Promise((
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
* @return {?}
|
|
445
|
-
*/
|
|
446
|
-
function (resolve, reject) {
|
|
447
|
-
_this.db.transaction((/**
|
|
448
|
-
* @param {?} transaction
|
|
449
|
-
* @return {?}
|
|
450
|
-
*/
|
|
451
|
-
function (transaction) {
|
|
452
|
-
transaction.executeSql(sql, sqlValues, (/**
|
|
453
|
-
* @param {?} transaction
|
|
454
|
-
* @param {?} result
|
|
455
|
-
* @return {?}
|
|
456
|
-
*/
|
|
457
|
-
function (transaction, result) {
|
|
242
|
+
return new Promise(function (resolve, reject) {
|
|
243
|
+
_this.db.transaction(function (transaction) {
|
|
244
|
+
transaction.executeSql(sql, sqlValues, function (transaction, result) {
|
|
458
245
|
resolve(result);
|
|
459
|
-
}
|
|
460
|
-
* @param {?} transaction
|
|
461
|
-
* @param {?} error
|
|
462
|
-
* @return {?}
|
|
463
|
-
*/
|
|
464
|
-
function (transaction, error) {
|
|
246
|
+
}, function (transaction, error) {
|
|
465
247
|
reject(error);
|
|
466
|
-
})
|
|
467
|
-
})
|
|
468
|
-
})
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
});
|
|
469
251
|
};
|
|
470
|
-
|
|
471
|
-
* @param {?} table
|
|
472
|
-
* @param {?} bindings
|
|
473
|
-
* @param {?} where
|
|
474
|
-
* @return {?}
|
|
475
|
-
*/
|
|
476
|
-
DbWrapperService.prototype.update = /**
|
|
477
|
-
* @param {?} table
|
|
478
|
-
* @param {?} bindings
|
|
479
|
-
* @param {?} where
|
|
480
|
-
* @return {?}
|
|
481
|
-
*/
|
|
482
|
-
function (table, bindings, where) {
|
|
252
|
+
DbWrapperService.prototype.update = function (table, bindings, where) {
|
|
483
253
|
var _this = this;
|
|
484
|
-
|
|
485
|
-
var sql = '';
|
|
486
|
-
/** @type {?} */
|
|
487
|
-
var sqlBinds = [];
|
|
488
|
-
/** @type {?} */
|
|
489
|
-
var sqlKeys = [];
|
|
490
|
-
/** @type {?} */
|
|
491
|
-
var sqlValues = [];
|
|
254
|
+
var sql = '', sqlBinds = [], sqlKeys = [], sqlValues = [];
|
|
492
255
|
sql = sql + 'update ' + table + ' set ';
|
|
493
256
|
for (var index in bindings) {
|
|
494
257
|
if (bindings.hasOwnProperty(index)) {
|
|
495
|
-
/** @type {?} */
|
|
496
258
|
var newObj = bindings[index];
|
|
497
259
|
if (typeof newObj === 'object' && newObj !== null) {
|
|
498
260
|
sqlValues.push(newObj.value);
|
|
@@ -525,118 +287,53 @@ var DbWrapperService = /** @class */ (function () {
|
|
|
525
287
|
}
|
|
526
288
|
}
|
|
527
289
|
sql = sql + sqlBinds.join(',') + ' where ' + sqlKeys.join(' and ');
|
|
528
|
-
return new Promise((
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
* @return {?}
|
|
532
|
-
*/
|
|
533
|
-
function (resolve, reject) {
|
|
534
|
-
_this.db.transaction((/**
|
|
535
|
-
* @param {?} transaction
|
|
536
|
-
* @return {?}
|
|
537
|
-
*/
|
|
538
|
-
function (transaction) {
|
|
539
|
-
transaction.executeSql(sql, sqlValues, (/**
|
|
540
|
-
* @param {?} transaction
|
|
541
|
-
* @param {?} result
|
|
542
|
-
* @return {?}
|
|
543
|
-
*/
|
|
544
|
-
function (transaction, result) {
|
|
290
|
+
return new Promise(function (resolve, reject) {
|
|
291
|
+
_this.db.transaction(function (transaction) {
|
|
292
|
+
transaction.executeSql(sql, sqlValues, function (transaction, result) {
|
|
545
293
|
resolve(result);
|
|
546
|
-
}
|
|
547
|
-
* @param {?} transaction
|
|
548
|
-
* @param {?} error
|
|
549
|
-
* @return {?}
|
|
550
|
-
*/
|
|
551
|
-
function (transaction, error) {
|
|
294
|
+
}, function (transaction, error) {
|
|
552
295
|
reject(error);
|
|
553
|
-
})
|
|
554
|
-
})
|
|
555
|
-
})
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
});
|
|
556
299
|
};
|
|
557
|
-
|
|
558
|
-
* @param {?} tables
|
|
559
|
-
* @return {?}
|
|
560
|
-
*/
|
|
561
|
-
DbWrapperService.prototype.dropTable = /**
|
|
562
|
-
* @param {?} tables
|
|
563
|
-
* @return {?}
|
|
564
|
-
*/
|
|
565
|
-
function (tables) {
|
|
300
|
+
DbWrapperService.prototype.dropTable = function (tables) {
|
|
566
301
|
var _this = this;
|
|
567
|
-
/** @type {?} */
|
|
568
302
|
var cont = 1;
|
|
569
303
|
cont = tables.length;
|
|
570
|
-
return new Promise((
|
|
571
|
-
|
|
572
|
-
* @param {?} reject
|
|
573
|
-
* @return {?}
|
|
574
|
-
*/
|
|
575
|
-
function (resolve, reject) {
|
|
576
|
-
tables.some((/**
|
|
577
|
-
* @param {?} table
|
|
578
|
-
* @return {?}
|
|
579
|
-
*/
|
|
580
|
-
function (table) {
|
|
304
|
+
return new Promise(function (resolve, reject) {
|
|
305
|
+
tables.some(function (table) {
|
|
581
306
|
if (cont !== 0) {
|
|
582
307
|
_this.query('DROP TABLE ' + table)
|
|
583
|
-
.then((
|
|
584
|
-
* @return {?}
|
|
585
|
-
*/
|
|
586
|
-
function () {
|
|
308
|
+
.then(function () {
|
|
587
309
|
if (cont === 1) {
|
|
588
310
|
resolve();
|
|
589
311
|
}
|
|
590
312
|
else {
|
|
591
313
|
cont--;
|
|
592
314
|
}
|
|
593
|
-
}
|
|
594
|
-
* @param {?} err
|
|
595
|
-
* @return {?}
|
|
596
|
-
*/
|
|
597
|
-
function (err) {
|
|
315
|
+
}, function (err) {
|
|
598
316
|
cont = 0;
|
|
599
317
|
reject(err);
|
|
600
318
|
return true;
|
|
601
|
-
})
|
|
319
|
+
});
|
|
602
320
|
return false;
|
|
603
321
|
}
|
|
604
|
-
})
|
|
605
|
-
})
|
|
322
|
+
});
|
|
323
|
+
});
|
|
606
324
|
};
|
|
607
|
-
|
|
608
|
-
* @param {?} result
|
|
609
|
-
* @return {?}
|
|
610
|
-
*/
|
|
611
|
-
DbWrapperService.prototype.fetchAll = /**
|
|
612
|
-
* @param {?} result
|
|
613
|
-
* @return {?}
|
|
614
|
-
*/
|
|
615
|
-
function (result) {
|
|
616
|
-
/** @type {?} */
|
|
325
|
+
DbWrapperService.prototype.fetchAll = function (result) {
|
|
617
326
|
var output = [];
|
|
618
327
|
for (var i = 0; i < result.rows.length; i++) {
|
|
619
328
|
output.push(result.rows.item(i));
|
|
620
329
|
}
|
|
621
330
|
return output;
|
|
622
331
|
};
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
* @return {?}
|
|
626
|
-
*/
|
|
627
|
-
DbWrapperService.prototype.fetch = /**
|
|
628
|
-
* @param {?} result
|
|
629
|
-
* @return {?}
|
|
630
|
-
*/
|
|
631
|
-
function (result) {
|
|
632
|
-
/** @type {?} */
|
|
633
|
-
var objeto = undefined;
|
|
634
|
-
/** @type {?} */
|
|
635
|
-
var newObj = undefined;
|
|
332
|
+
DbWrapperService.prototype.fetch = function (result) {
|
|
333
|
+
var objeto = undefined, newObj = undefined;
|
|
636
334
|
if (result.rows.length !== 0) {
|
|
637
335
|
objeto = result.rows.item(0);
|
|
638
336
|
newObj = {};
|
|
639
|
-
/** @type {?} */
|
|
640
337
|
var keys = Object.keys(objeto);
|
|
641
338
|
for (var key in keys) {
|
|
642
339
|
newObj[keys[key]] = objeto[keys[key]];
|
|
@@ -644,32 +341,29 @@ var DbWrapperService = /** @class */ (function () {
|
|
|
644
341
|
}
|
|
645
342
|
return newObj;
|
|
646
343
|
};
|
|
647
|
-
|
|
648
|
-
* @param {?} result
|
|
649
|
-
* @return {?}
|
|
650
|
-
*/
|
|
651
|
-
DbWrapperService.prototype.rowsCount = /**
|
|
652
|
-
* @param {?} result
|
|
653
|
-
* @return {?}
|
|
654
|
-
*/
|
|
655
|
-
function (result) {
|
|
344
|
+
DbWrapperService.prototype.rowsCount = function (result) {
|
|
656
345
|
return result.rows.length;
|
|
657
346
|
};
|
|
347
|
+
DbWrapperService.prototype.tableExists = function (table) {
|
|
348
|
+
var _this = this;
|
|
349
|
+
return this.query('select sql from sqlite_master ' +
|
|
350
|
+
'where type=\'table\' and name=\'' + table + '\'')
|
|
351
|
+
.then(function (result) { return (_this.rowsCount(result) === 1); });
|
|
352
|
+
};
|
|
353
|
+
DbWrapperService.prototype.columnExists = function (table, column) {
|
|
354
|
+
var _this = this;
|
|
355
|
+
return this._tableExists(table)
|
|
356
|
+
.then(function (tableDDL) {
|
|
357
|
+
if (tableDDL) {
|
|
358
|
+
return _this._columnExists(tableDDL, column);
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
return false;
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
};
|
|
658
365
|
/* Private */
|
|
659
|
-
|
|
660
|
-
/**
|
|
661
|
-
* @private
|
|
662
|
-
* @param {?} col
|
|
663
|
-
* @return {?}
|
|
664
|
-
*/
|
|
665
|
-
DbWrapperService.prototype.defColumn = /* Private */
|
|
666
|
-
/**
|
|
667
|
-
* @private
|
|
668
|
-
* @param {?} col
|
|
669
|
-
* @return {?}
|
|
670
|
-
*/
|
|
671
|
-
function (col) {
|
|
672
|
-
/** @type {?} */
|
|
366
|
+
DbWrapperService.prototype.defColumn = function (col) {
|
|
673
367
|
var colSql;
|
|
674
368
|
colSql = col.name + ' ' + col.type;
|
|
675
369
|
if (!col.isNullable) {
|
|
@@ -687,21 +381,9 @@ var DbWrapperService = /** @class */ (function () {
|
|
|
687
381
|
}
|
|
688
382
|
return colSql;
|
|
689
383
|
};
|
|
690
|
-
|
|
691
|
-
* @private
|
|
692
|
-
* @param {?} unique
|
|
693
|
-
* @return {?}
|
|
694
|
-
*/
|
|
695
|
-
DbWrapperService.prototype.defUnique = /**
|
|
696
|
-
* @private
|
|
697
|
-
* @param {?} unique
|
|
698
|
-
* @return {?}
|
|
699
|
-
*/
|
|
700
|
-
function (unique) {
|
|
701
|
-
/** @type {?} */
|
|
384
|
+
DbWrapperService.prototype.defUnique = function (unique) {
|
|
702
385
|
var uniqSql;
|
|
703
386
|
// depende del entorno, producción o desarrollo
|
|
704
|
-
/** @type {?} */
|
|
705
387
|
var onConflictUnique = 'on conflict replace';
|
|
706
388
|
if (Array.isArray(unique.fields)) {
|
|
707
389
|
uniqSql = " CONSTRAINT " + unique.name + " UNIQUE ( " + unique.fields.join(',') + " ) " + onConflictUnique + " ";
|
|
@@ -711,18 +393,7 @@ var DbWrapperService = /** @class */ (function () {
|
|
|
711
393
|
}
|
|
712
394
|
return uniqSql;
|
|
713
395
|
};
|
|
714
|
-
|
|
715
|
-
* @private
|
|
716
|
-
* @param {?} fore
|
|
717
|
-
* @return {?}
|
|
718
|
-
*/
|
|
719
|
-
DbWrapperService.prototype.defForeign = /**
|
|
720
|
-
* @private
|
|
721
|
-
* @param {?} fore
|
|
722
|
-
* @return {?}
|
|
723
|
-
*/
|
|
724
|
-
function (fore) {
|
|
725
|
-
/** @type {?} */
|
|
396
|
+
DbWrapperService.prototype.defForeign = function (fore) {
|
|
726
397
|
var foreSql;
|
|
727
398
|
if (Array.isArray(fore.foreignKey)) {
|
|
728
399
|
foreSql = " FOREIGN KEY ( " + fore.foreignKey.join(',') + " ) ";
|
|
@@ -738,15 +409,36 @@ var DbWrapperService = /** @class */ (function () {
|
|
|
738
409
|
}
|
|
739
410
|
return foreSql;
|
|
740
411
|
};
|
|
412
|
+
DbWrapperService.prototype._tableExists = function (table) {
|
|
413
|
+
var _this = this;
|
|
414
|
+
return this.query('select sql from sqlite_master ' +
|
|
415
|
+
'where type=\'table\' and name=\'' + table + '\'')
|
|
416
|
+
.then(function (result) {
|
|
417
|
+
if (_this.rowsCount(result) === 1) {
|
|
418
|
+
return _this.fetch(result).sql;
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
};
|
|
425
|
+
DbWrapperService.prototype._columnExists = function (tableDDL, column) {
|
|
426
|
+
if (tableDDL.indexOf(column) === -1) {
|
|
427
|
+
return false;
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
return true;
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
DbWrapperService.prototype.addColumn = function (table, col) {
|
|
434
|
+
var colSql = this.defColumn(col);
|
|
435
|
+
var query = 'alter TABLE ' + table + ' add COLUMN ' + colSql;
|
|
436
|
+
return this.query(query);
|
|
437
|
+
};
|
|
741
438
|
return DbWrapperService;
|
|
742
439
|
}());
|
|
743
|
-
/** @type {?} */
|
|
744
440
|
var DB_CONFIG = new InjectionToken('dbWrapperConfig');
|
|
745
|
-
/** @type {?} */
|
|
746
441
|
var DB_SCHEMA = new InjectionToken('dbWrapperSchema');
|
|
747
|
-
/**
|
|
748
|
-
* @return {?}
|
|
749
|
-
*/
|
|
750
442
|
function getDefaultDbConfig() {
|
|
751
443
|
return {
|
|
752
444
|
dbName: 'db.sqlite',
|
|
@@ -754,37 +446,18 @@ function getDefaultDbConfig() {
|
|
|
754
446
|
iosDatabaseLocation: 'Library'
|
|
755
447
|
};
|
|
756
448
|
}
|
|
757
|
-
/**
|
|
758
|
-
* @param {?} dbConfig
|
|
759
|
-
* @param {?=} dbSchema
|
|
760
|
-
* @return {?}
|
|
761
|
-
*/
|
|
762
449
|
function provideDbWrapper(dbConfig, dbSchema) {
|
|
763
|
-
/** @type {?} */
|
|
764
450
|
var config = !!dbConfig ? dbConfig : getDefaultDbConfig();
|
|
765
451
|
return new DbWrapperService(config, dbSchema);
|
|
766
452
|
}
|
|
767
453
|
|
|
768
|
-
/**
|
|
769
|
-
* @fileoverview added by tsickle
|
|
770
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
771
|
-
*/
|
|
772
454
|
var DbWrapperModule = /** @class */ (function () {
|
|
773
455
|
function DbWrapperModule() {
|
|
774
456
|
}
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
* @param {?=} schema
|
|
778
|
-
* @return {?}
|
|
779
|
-
*/
|
|
780
|
-
DbWrapperModule.forRoot = /**
|
|
781
|
-
* @param {?} dbConfig
|
|
782
|
-
* @param {?=} schema
|
|
783
|
-
* @return {?}
|
|
784
|
-
*/
|
|
785
|
-
function (dbConfig, schema) {
|
|
457
|
+
DbWrapperModule_1 = DbWrapperModule;
|
|
458
|
+
DbWrapperModule.forRoot = function (dbConfig, schema) {
|
|
786
459
|
return {
|
|
787
|
-
ngModule:
|
|
460
|
+
ngModule: DbWrapperModule_1,
|
|
788
461
|
providers: [
|
|
789
462
|
{ provide: DB_CONFIG, useValue: dbConfig },
|
|
790
463
|
{ provide: DB_SCHEMA, useValue: schema },
|
|
@@ -792,71 +465,65 @@ var DbWrapperModule = /** @class */ (function () {
|
|
|
792
465
|
]
|
|
793
466
|
};
|
|
794
467
|
};
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
468
|
+
var DbWrapperModule_1;
|
|
469
|
+
DbWrapperModule = DbWrapperModule_1 = __decorate([
|
|
470
|
+
NgModule()
|
|
471
|
+
], DbWrapperModule);
|
|
798
472
|
return DbWrapperModule;
|
|
799
473
|
}());
|
|
800
474
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
Boolean: '0',
|
|
846
|
-
DateTime: '(datetime(\'now\', \'localtime\'))',
|
|
847
|
-
Date: '(date(\'now\', \'localtime\'))',
|
|
848
|
-
};
|
|
475
|
+
var DataType;
|
|
476
|
+
(function (DataType) {
|
|
477
|
+
DataType["Integer"] = "integer";
|
|
478
|
+
DataType["Int"] = "integer";
|
|
479
|
+
DataType["TinyInt"] = "integer";
|
|
480
|
+
DataType["SmallInt"] = "integer";
|
|
481
|
+
DataType["BigInt"] = "integer";
|
|
482
|
+
DataType["Text"] = "text";
|
|
483
|
+
DataType["Char"] = "text";
|
|
484
|
+
DataType["NChar"] = "text";
|
|
485
|
+
DataType["VarChar"] = "text";
|
|
486
|
+
DataType["NVarChar"] = "text";
|
|
487
|
+
DataType["CLOB"] = "text";
|
|
488
|
+
DataType["BLOB"] = "blob";
|
|
489
|
+
DataType["Real"] = "real";
|
|
490
|
+
DataType["Double"] = "real";
|
|
491
|
+
DataType["Decimal"] = "real";
|
|
492
|
+
DataType["Float"] = "real";
|
|
493
|
+
DataType["Boolean"] = "integer";
|
|
494
|
+
DataType["DateTime"] = "text";
|
|
495
|
+
DataType["Date"] = "text";
|
|
496
|
+
})(DataType || (DataType = {}));
|
|
497
|
+
var DefaultType;
|
|
498
|
+
(function (DefaultType) {
|
|
499
|
+
DefaultType["Integer"] = "0";
|
|
500
|
+
DefaultType["Int"] = "0";
|
|
501
|
+
DefaultType["TinyInt"] = "0";
|
|
502
|
+
DefaultType["SmallInt"] = "0";
|
|
503
|
+
DefaultType["BigInt"] = "0";
|
|
504
|
+
DefaultType["Text"] = "''";
|
|
505
|
+
DefaultType["Char"] = "''";
|
|
506
|
+
DefaultType["NChar"] = "''";
|
|
507
|
+
DefaultType["VarChar"] = "''";
|
|
508
|
+
DefaultType["NVarChar"] = "''";
|
|
509
|
+
DefaultType["CLOB"] = "''";
|
|
510
|
+
DefaultType["BLOB"] = "0";
|
|
511
|
+
DefaultType["Real"] = "0.0";
|
|
512
|
+
DefaultType["Double"] = "0.0";
|
|
513
|
+
DefaultType["Decimal"] = "0.0";
|
|
514
|
+
DefaultType["Float"] = "0.0";
|
|
515
|
+
DefaultType["Boolean"] = "0";
|
|
516
|
+
DefaultType["DateTime"] = "(datetime('now', 'localtime'))";
|
|
517
|
+
DefaultType["Date"] = "(date('now', 'localtime'))";
|
|
518
|
+
})(DefaultType || (DefaultType = {}));
|
|
849
519
|
|
|
850
|
-
|
|
851
|
-
*
|
|
852
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
520
|
+
/*
|
|
521
|
+
* Public API Surface of db-wrapper
|
|
853
522
|
*/
|
|
854
523
|
|
|
855
524
|
/**
|
|
856
|
-
*
|
|
857
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
525
|
+
* Generated bundle index. Do not edit.
|
|
858
526
|
*/
|
|
859
527
|
|
|
860
|
-
export {
|
|
861
|
-
|
|
862
|
-
//# sourceMappingURL=db-wrapper.js.map
|
|
528
|
+
export { DB_CONFIG, DB_SCHEMA, DataType, DbWrapperModule, DbWrapperService, DefaultType, getDefaultDbConfig, provideDbWrapper };
|
|
529
|
+
//# sourceMappingURL=db-wrapper.js.map
|