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