backend-plus 2.1.5 → 2.1.6
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.
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
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;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
(function (factory) {
|
|
38
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
39
|
+
var v = factory(require, exports);
|
|
40
|
+
if (v !== undefined) module.exports = v;
|
|
41
|
+
}
|
|
42
|
+
else if (typeof define === "function" && define.amd) {
|
|
43
|
+
define(["require", "exports", "like-ar", "best-globals", "sql-tools"], factory);
|
|
44
|
+
}
|
|
45
|
+
})(function (require, exports) {
|
|
46
|
+
//import { TableDefinition } from "backend-plus";
|
|
47
|
+
"use strict";
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.WebsqlDb = exports.detectedFeatures = void 0;
|
|
50
|
+
//x// <amd-dependency path="../../../node_modules/like-ar/like-ar.d.ts" name="likeAr"/>
|
|
51
|
+
//x// <reference path="../../node_modules/like-ar/like-ar.d.ts" />
|
|
52
|
+
/// <reference path="../node_modules/types.d.ts/modules/myOwn/in-myOwn.d.ts" />
|
|
53
|
+
/// <reference path="../../../lib/in-backend-plus.d.ts" />
|
|
54
|
+
/// <reference path="../../../lib/backend-plus.d.ts" />
|
|
55
|
+
/// <reference path="../../lib/in-backend-plus.d.ts" />
|
|
56
|
+
/// <reference path="../../lib/backend-plus.d.ts" />
|
|
57
|
+
/// <reference path="../lib/in-backend-plus.d.ts" />
|
|
58
|
+
/// <reference path="../lib/backend-plus.d.ts" />
|
|
59
|
+
/// <reference path="lib/in-backend-plus.d.ts" />
|
|
60
|
+
/// <reference path="lib/backend-plus.d.ts" />
|
|
61
|
+
var likeAr = require("like-ar");
|
|
62
|
+
var best_globals_1 = require("best-globals");
|
|
63
|
+
var SqlTools = require("sql-tools");
|
|
64
|
+
exports.detectedFeatures = {
|
|
65
|
+
needToCopyResults: null
|
|
66
|
+
};
|
|
67
|
+
var WebsqlDb = /** @class */ (function () {
|
|
68
|
+
function WebsqlDb(name) {
|
|
69
|
+
this.name = name;
|
|
70
|
+
var version = 1.0;
|
|
71
|
+
var dbName = this.name;
|
|
72
|
+
var dbDisplayName = this.name;
|
|
73
|
+
var dbSize = 2 * 1024 * 1024;
|
|
74
|
+
try {
|
|
75
|
+
this.db = openDatabase(dbName, version, dbDisplayName, dbSize);
|
|
76
|
+
this.wait4detectedFeatures = this.detectFeatures();
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
console.log(err.message);
|
|
80
|
+
throw err;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
WebsqlDb.prototype.detectFeatures = function () {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
85
|
+
var detectedFeatures, detectElement, tableDef, err_1;
|
|
86
|
+
return __generator(this, function (_a) {
|
|
87
|
+
switch (_a.label) {
|
|
88
|
+
case 0:
|
|
89
|
+
detectedFeatures = { needToCopyResults: false };
|
|
90
|
+
detectElement = { feature: 'need_to_copy_results', value: false };
|
|
91
|
+
_a.label = 1;
|
|
92
|
+
case 1:
|
|
93
|
+
_a.trys.push([1, 5, , 7]);
|
|
94
|
+
tableDef = {
|
|
95
|
+
name: '_detect',
|
|
96
|
+
fields: [
|
|
97
|
+
{ name: 'feature', typeName: 'text' },
|
|
98
|
+
{ name: 'value', typeName: 'boolean' }
|
|
99
|
+
],
|
|
100
|
+
primaryKey: ['feature']
|
|
101
|
+
};
|
|
102
|
+
return [4 /*yield*/, this.registerStructure(tableDef)];
|
|
103
|
+
case 2:
|
|
104
|
+
_a.sent();
|
|
105
|
+
return [4 /*yield*/, this.putOne('_detect', detectElement)];
|
|
106
|
+
case 3:
|
|
107
|
+
_a.sent();
|
|
108
|
+
return [4 /*yield*/, this.getOne('_detect', ['need_to_copy_results'], true)];
|
|
109
|
+
case 4:
|
|
110
|
+
_a.sent();
|
|
111
|
+
return [3 /*break*/, 7];
|
|
112
|
+
case 5:
|
|
113
|
+
err_1 = _a.sent();
|
|
114
|
+
detectElement.value = true;
|
|
115
|
+
detectedFeatures.needToCopyResults = true;
|
|
116
|
+
return [4 /*yield*/, this.putOne('_detect', detectElement)];
|
|
117
|
+
case 6:
|
|
118
|
+
_a.sent();
|
|
119
|
+
return [3 /*break*/, 7];
|
|
120
|
+
case 7: return [2 /*return*/, detectedFeatures];
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
WebsqlDb.prototype.generateSqlForTableDef = function (tableDef) {
|
|
126
|
+
var typeDb = {
|
|
127
|
+
integer: 'integer',
|
|
128
|
+
number: 'real',
|
|
129
|
+
date: 'text',
|
|
130
|
+
boolean: 'text',
|
|
131
|
+
text: 'text',
|
|
132
|
+
jsonb: 'text',
|
|
133
|
+
json: 'text'
|
|
134
|
+
};
|
|
135
|
+
var lines = [];
|
|
136
|
+
var consLines = [];
|
|
137
|
+
lines.push('CREATE TABLE IF NOT EXISTS ' + SqlTools.quoteIdent(tableDef.name) + ' (');
|
|
138
|
+
var fields = [];
|
|
139
|
+
tableDef.fields.forEach(function (fieldDef) {
|
|
140
|
+
var fieldType = typeDb[fieldDef.typeName] || '"' + fieldDef.typeName + '"';
|
|
141
|
+
if (fieldDef.sizeByte == 4) {
|
|
142
|
+
fieldType = 'integer';
|
|
143
|
+
}
|
|
144
|
+
fields.push(' ' + SqlTools.quoteIdent(fieldDef.name) +
|
|
145
|
+
' ' + fieldType +
|
|
146
|
+
(fieldDef.defaultValue != null ? ' default ' + SqlTools.quoteLiteral(fieldDef.defaultValue) : '') +
|
|
147
|
+
(fieldDef.defaultDbValue != null ? ' default ' + fieldDef.defaultDbValue : ''));
|
|
148
|
+
if (fieldDef.typeName === 'text' && !fieldDef.allowEmptyText) {
|
|
149
|
+
consLines.push('alter table ' + SqlTools.quoteIdent(tableDef.name) +
|
|
150
|
+
' add constraint ' + SqlTools.quoteIdent(fieldDef.name + "<>''") +
|
|
151
|
+
' check (' + SqlTools.quoteIdent(fieldDef.name) + "<>'');");
|
|
152
|
+
}
|
|
153
|
+
if (fieldDef.nullable === false) {
|
|
154
|
+
consLines.push('alter table ' + SqlTools.quoteIdent(tableDef.name) +
|
|
155
|
+
' alter column ' + SqlTools.quoteIdent(fieldDef.name) + ' set not null;');
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
lines.push(fields.join(', \n'));
|
|
159
|
+
if (tableDef.primaryKey) {
|
|
160
|
+
lines.push(', primary key (' + tableDef.primaryKey.map(function (name) { return SqlTools.quoteIdent(name); }).join(', ') + ')');
|
|
161
|
+
}
|
|
162
|
+
lines.push(');');
|
|
163
|
+
return lines.join('\n'); //+'\n-- conss\n' + consLines.join('\n')
|
|
164
|
+
};
|
|
165
|
+
WebsqlDb.deleteDatabase = function (name) {
|
|
166
|
+
//TODO
|
|
167
|
+
return Promise.resolve();
|
|
168
|
+
};
|
|
169
|
+
WebsqlDb.prototype.executeQuery = function (sql, params) {
|
|
170
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
171
|
+
var db;
|
|
172
|
+
return __generator(this, function (_a) {
|
|
173
|
+
db = this.db;
|
|
174
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
175
|
+
if (!db)
|
|
176
|
+
return reject('no database.');
|
|
177
|
+
var result;
|
|
178
|
+
db.transaction(function (tx) {
|
|
179
|
+
tx.executeSql(sql, params || [], function (_tx, res) {
|
|
180
|
+
result = res.rows;
|
|
181
|
+
});
|
|
182
|
+
}, function (err) {
|
|
183
|
+
reject(err);
|
|
184
|
+
}, function success() {
|
|
185
|
+
resolve(result);
|
|
186
|
+
});
|
|
187
|
+
})];
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
;
|
|
192
|
+
WebsqlDb.prototype.executeQueries = function (sql, data) {
|
|
193
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
194
|
+
var db;
|
|
195
|
+
return __generator(this, function (_a) {
|
|
196
|
+
db = this.db;
|
|
197
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
198
|
+
if (!db)
|
|
199
|
+
return reject('no database.');
|
|
200
|
+
db.transaction(function (tx) {
|
|
201
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
202
|
+
return __generator(this, function (_a) {
|
|
203
|
+
data.forEach(function (data) {
|
|
204
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
205
|
+
return __generator(this, function (_a) {
|
|
206
|
+
tx.executeSql(sql, data);
|
|
207
|
+
return [2 /*return*/];
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
return [2 /*return*/];
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
}, function (tx, err) {
|
|
215
|
+
reject(err);
|
|
216
|
+
}, function (tx, res) {
|
|
217
|
+
resolve();
|
|
218
|
+
});
|
|
219
|
+
})];
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
;
|
|
224
|
+
WebsqlDb.prototype.registerStructure = function (tableDef) {
|
|
225
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
226
|
+
return __generator(this, function (_a) {
|
|
227
|
+
switch (_a.label) {
|
|
228
|
+
case 0: return [4 /*yield*/, this.executeQuery("CREATE TABLE IF NOT EXISTS _structures (name string primary key, def string not null);", [])];
|
|
229
|
+
case 1:
|
|
230
|
+
_a.sent();
|
|
231
|
+
return [4 /*yield*/, this.executeQuery("INSERT OR REPLACE INTO _structures (name, def) values (?, ?);", [tableDef.name, JSON.stringify(tableDef)])];
|
|
232
|
+
case 2:
|
|
233
|
+
_a.sent();
|
|
234
|
+
return [4 /*yield*/, this.executeQuery("DROP TABLE IF EXISTS " + SqlTools.quoteIdent(tableDef.name), [])];
|
|
235
|
+
case 3:
|
|
236
|
+
_a.sent();
|
|
237
|
+
return [4 /*yield*/, this.executeQuery(this.generateSqlForTableDef(tableDef), [])];
|
|
238
|
+
case 4:
|
|
239
|
+
_a.sent();
|
|
240
|
+
return [2 /*return*/];
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
};
|
|
245
|
+
WebsqlDb.prototype.getStructure = function (tableName) {
|
|
246
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
247
|
+
var result;
|
|
248
|
+
return __generator(this, function (_a) {
|
|
249
|
+
switch (_a.label) {
|
|
250
|
+
case 0: return [4 /*yield*/, this.executeQuery("SELECT * from _structures where name = ?", [tableName])];
|
|
251
|
+
case 1:
|
|
252
|
+
result = _a.sent();
|
|
253
|
+
if (result.length) {
|
|
254
|
+
return [2 /*return*/, JSON.parse(result.item(0).def)];
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
return [2 /*return*/, undefined];
|
|
258
|
+
}
|
|
259
|
+
return [2 /*return*/];
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
};
|
|
264
|
+
WebsqlDb.prototype.existsStructure = function (tableName) {
|
|
265
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
266
|
+
var tableDef;
|
|
267
|
+
return __generator(this, function (_a) {
|
|
268
|
+
switch (_a.label) {
|
|
269
|
+
case 0: return [4 /*yield*/, this.getStructure(tableName)];
|
|
270
|
+
case 1:
|
|
271
|
+
tableDef = _a.sent();
|
|
272
|
+
return [2 /*return*/, tableDef ? true : false];
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
};
|
|
277
|
+
WebsqlDb.prototype.convertSQLResultSetRowListToArray = function (rowResultSetList, copyResults) {
|
|
278
|
+
var arr = [];
|
|
279
|
+
for (var i = 0; i < rowResultSetList.length; i++) {
|
|
280
|
+
var result = rowResultSetList.item(i);
|
|
281
|
+
if (copyResults) {
|
|
282
|
+
result = (0, best_globals_1.changing)(result, {});
|
|
283
|
+
}
|
|
284
|
+
arr.push(result);
|
|
285
|
+
}
|
|
286
|
+
return arr;
|
|
287
|
+
};
|
|
288
|
+
WebsqlDb.prototype.fieldIsNotSupported = function (fieldName, notSupportedFields) {
|
|
289
|
+
var isNotSupported = notSupportedFields.find(function (field) {
|
|
290
|
+
return field.name == fieldName;
|
|
291
|
+
});
|
|
292
|
+
return isNotSupported ? true : false;
|
|
293
|
+
};
|
|
294
|
+
WebsqlDb.prototype.getNotSupportedFields = function (tableDef) {
|
|
295
|
+
var jsonbFields = tableDef.fields.filter(function (field) {
|
|
296
|
+
return field.typeName == 'jsonb' || field.typeName == 'date' || field.typeName == 'timestamp' || field.typeName == 'boolean';
|
|
297
|
+
});
|
|
298
|
+
return jsonbFields;
|
|
299
|
+
};
|
|
300
|
+
WebsqlDb.prototype.convertNotSupportedFields = function (records, notSupportedFields) {
|
|
301
|
+
records.forEach(function (row) {
|
|
302
|
+
if (notSupportedFields) {
|
|
303
|
+
notSupportedFields.forEach(function (notSupportedField) {
|
|
304
|
+
var fieldName = notSupportedField.name;
|
|
305
|
+
row[fieldName] = JSON.parse(row[fieldName]);
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
return records;
|
|
310
|
+
};
|
|
311
|
+
WebsqlDb.prototype.getOneIfExists = function (tableName, key) {
|
|
312
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
313
|
+
var err_2;
|
|
314
|
+
return __generator(this, function (_a) {
|
|
315
|
+
switch (_a.label) {
|
|
316
|
+
case 0:
|
|
317
|
+
_a.trys.push([0, 2, , 3]);
|
|
318
|
+
return [4 /*yield*/, this.getOne(tableName, key)];
|
|
319
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
320
|
+
case 2:
|
|
321
|
+
err_2 = _a.sent();
|
|
322
|
+
return [2 /*return*/, undefined];
|
|
323
|
+
case 3: return [2 /*return*/];
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
WebsqlDb.prototype.getOne = function (tableName, key, ignoreDetectFeatures) {
|
|
329
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
330
|
+
var tableDef, jsonbFields, fieldNames, whereExpr, sql, result, detectedFeatures, copyResults, convertedResult;
|
|
331
|
+
return __generator(this, function (_a) {
|
|
332
|
+
switch (_a.label) {
|
|
333
|
+
case 0:
|
|
334
|
+
ignoreDetectFeatures = ignoreDetectFeatures || false;
|
|
335
|
+
return [4 /*yield*/, this.getStructure(tableName)];
|
|
336
|
+
case 1:
|
|
337
|
+
tableDef = _a.sent();
|
|
338
|
+
jsonbFields = this.getNotSupportedFields(tableDef);
|
|
339
|
+
fieldNames = tableDef.primaryKey;
|
|
340
|
+
whereExpr = [];
|
|
341
|
+
fieldNames.forEach(function (fieldName, i) {
|
|
342
|
+
whereExpr.push(fieldName + '=' + SqlTools.quoteLiteral(key[i]));
|
|
343
|
+
});
|
|
344
|
+
sql = "SELECT * \n from " + SqlTools.quoteIdent(tableName) + "\n where " + whereExpr.join(' and ');
|
|
345
|
+
return [4 /*yield*/, this.executeQuery(sql, [])];
|
|
346
|
+
case 2:
|
|
347
|
+
result = _a.sent();
|
|
348
|
+
if (!!ignoreDetectFeatures) return [3 /*break*/, 4];
|
|
349
|
+
return [4 /*yield*/, this.wait4detectedFeatures];
|
|
350
|
+
case 3:
|
|
351
|
+
detectedFeatures = _a.sent();
|
|
352
|
+
_a.label = 4;
|
|
353
|
+
case 4:
|
|
354
|
+
copyResults = !ignoreDetectFeatures && detectedFeatures.needToCopyResults;
|
|
355
|
+
convertedResult = this.convertNotSupportedFields(this.convertSQLResultSetRowListToArray(result, copyResults), jsonbFields);
|
|
356
|
+
if (convertedResult[0]) {
|
|
357
|
+
return [2 /*return*/, convertedResult[0]];
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
throw Error('no existe el elemento');
|
|
361
|
+
}
|
|
362
|
+
return [2 /*return*/];
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
});
|
|
366
|
+
};
|
|
367
|
+
WebsqlDb.prototype.getChild = function (tableName, parentKey) {
|
|
368
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
369
|
+
var tableDef, jsonbFields, fieldNames, whereExpr, sql, result, detectedFeatures;
|
|
370
|
+
return __generator(this, function (_a) {
|
|
371
|
+
switch (_a.label) {
|
|
372
|
+
case 0: return [4 /*yield*/, this.getStructure(tableName)];
|
|
373
|
+
case 1:
|
|
374
|
+
tableDef = _a.sent();
|
|
375
|
+
jsonbFields = this.getNotSupportedFields(tableDef);
|
|
376
|
+
fieldNames = tableDef.primaryKey;
|
|
377
|
+
whereExpr = [];
|
|
378
|
+
parentKey.forEach(function (key, i) {
|
|
379
|
+
whereExpr.push(fieldNames[i] + '=' + SqlTools.quoteLiteral(key));
|
|
380
|
+
});
|
|
381
|
+
sql = "SELECT * from " + SqlTools.quoteIdent(tableName);
|
|
382
|
+
if (parentKey.length) {
|
|
383
|
+
sql += " where " + whereExpr.join(' and ');
|
|
384
|
+
}
|
|
385
|
+
return [4 /*yield*/, this.executeQuery(sql, [])];
|
|
386
|
+
case 2:
|
|
387
|
+
result = _a.sent();
|
|
388
|
+
return [4 /*yield*/, this.wait4detectedFeatures];
|
|
389
|
+
case 3:
|
|
390
|
+
detectedFeatures = _a.sent();
|
|
391
|
+
return [2 /*return*/, this.convertNotSupportedFields(this.convertSQLResultSetRowListToArray(result, detectedFeatures.needToCopyResults), jsonbFields)];
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
});
|
|
395
|
+
};
|
|
396
|
+
WebsqlDb.prototype.getAll = function (tableName) {
|
|
397
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
398
|
+
var tableDef, jsonbFields, results, detectedFeatures;
|
|
399
|
+
return __generator(this, function (_a) {
|
|
400
|
+
switch (_a.label) {
|
|
401
|
+
case 0: return [4 /*yield*/, this.getStructure(tableName)];
|
|
402
|
+
case 1:
|
|
403
|
+
tableDef = _a.sent();
|
|
404
|
+
jsonbFields = this.getNotSupportedFields(tableDef);
|
|
405
|
+
return [4 /*yield*/, this.executeQuery("SELECT * from " + SqlTools.quoteIdent(tableName), [])];
|
|
406
|
+
case 2:
|
|
407
|
+
results = _a.sent();
|
|
408
|
+
return [4 /*yield*/, this.wait4detectedFeatures];
|
|
409
|
+
case 3:
|
|
410
|
+
detectedFeatures = _a.sent();
|
|
411
|
+
return [2 /*return*/, this.convertNotSupportedFields(this.convertSQLResultSetRowListToArray(results, detectedFeatures.needToCopyResults), jsonbFields)];
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
});
|
|
415
|
+
};
|
|
416
|
+
WebsqlDb.prototype.getAllStructures = function () {
|
|
417
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
418
|
+
var results, structures, i;
|
|
419
|
+
return __generator(this, function (_a) {
|
|
420
|
+
switch (_a.label) {
|
|
421
|
+
case 0: return [4 /*yield*/, this.executeQuery("SELECT * from _structures where name <> '_detect'", [])];
|
|
422
|
+
case 1:
|
|
423
|
+
results = _a.sent();
|
|
424
|
+
structures = [];
|
|
425
|
+
for (i = 0; i < results.length; i++) {
|
|
426
|
+
structures.push(JSON.parse(results.item(i).def));
|
|
427
|
+
}
|
|
428
|
+
return [2 /*return*/, structures];
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
});
|
|
432
|
+
};
|
|
433
|
+
WebsqlDb.prototype.isEmpty = function (tableName) {
|
|
434
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
435
|
+
var result;
|
|
436
|
+
return __generator(this, function (_a) {
|
|
437
|
+
switch (_a.label) {
|
|
438
|
+
case 0: return [4 /*yield*/, this.executeQuery("SELECT count(*) as cantidad from " + SqlTools.quoteIdent(tableName), [])];
|
|
439
|
+
case 1:
|
|
440
|
+
result = _a.sent();
|
|
441
|
+
return [2 /*return*/, result.item(0).cantidad == 0];
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
});
|
|
445
|
+
};
|
|
446
|
+
WebsqlDb.prototype.putOne = function (tableName, element) {
|
|
447
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
448
|
+
var ldb, createPromiseForFK, tableDef, jsonbFields, promisesArray;
|
|
449
|
+
return __generator(this, function (_a) {
|
|
450
|
+
switch (_a.label) {
|
|
451
|
+
case 0:
|
|
452
|
+
ldb = this;
|
|
453
|
+
createPromiseForFK = function createPromiseForFK(fk) {
|
|
454
|
+
return Promise.resolve().then(function () {
|
|
455
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
456
|
+
var fkTableDef, pk, isFKCompleteInSource, fkRecord;
|
|
457
|
+
return __generator(this, function (_a) {
|
|
458
|
+
switch (_a.label) {
|
|
459
|
+
case 0: return [4 /*yield*/, ldb.getStructure(fk.references)];
|
|
460
|
+
case 1:
|
|
461
|
+
fkTableDef = _a.sent();
|
|
462
|
+
if (!fkTableDef) return [3 /*break*/, 3];
|
|
463
|
+
pk = [];
|
|
464
|
+
fk.fields.forEach(function (field) {
|
|
465
|
+
pk.push(element[field.source]);
|
|
466
|
+
});
|
|
467
|
+
isFKCompleteInSource = fk.fields.filter(function (field) {
|
|
468
|
+
return element[field.source] == null;
|
|
469
|
+
}).length == 0;
|
|
470
|
+
if (!isFKCompleteInSource) return [3 /*break*/, 3];
|
|
471
|
+
return [4 /*yield*/, ldb.getOneIfExists(fk.references, pk)];
|
|
472
|
+
case 2:
|
|
473
|
+
fkRecord = _a.sent();
|
|
474
|
+
if (fkRecord) {
|
|
475
|
+
fk.displayFields.forEach(function (field) {
|
|
476
|
+
element[fk.alias + '__' + field] = fkRecord[field];
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
_a.label = 3;
|
|
480
|
+
case 3: return [2 /*return*/];
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
});
|
|
484
|
+
});
|
|
485
|
+
};
|
|
486
|
+
return [4 /*yield*/, ldb.getStructure(tableName)];
|
|
487
|
+
case 1:
|
|
488
|
+
tableDef = _a.sent();
|
|
489
|
+
jsonbFields = this.getNotSupportedFields(tableDef);
|
|
490
|
+
promisesArray = [];
|
|
491
|
+
if (tableDef.foreignKeys) {
|
|
492
|
+
tableDef.foreignKeys.forEach(function (fk) {
|
|
493
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
494
|
+
return __generator(this, function (_a) {
|
|
495
|
+
promisesArray.push(createPromiseForFK(fk));
|
|
496
|
+
return [2 /*return*/];
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
if (tableDef.softForeignKeys) {
|
|
502
|
+
tableDef.softForeignKeys.forEach(function (fk) {
|
|
503
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
504
|
+
return __generator(this, function (_a) {
|
|
505
|
+
promisesArray.push(createPromiseForFK(fk));
|
|
506
|
+
return [2 /*return*/];
|
|
507
|
+
});
|
|
508
|
+
});
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
return [4 /*yield*/, Promise.all(promisesArray).then(function () {
|
|
512
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
513
|
+
var fieldNames, fieldValues, unquotedFieldValues;
|
|
514
|
+
return __generator(this, function (_a) {
|
|
515
|
+
switch (_a.label) {
|
|
516
|
+
case 0:
|
|
517
|
+
fieldNames = [];
|
|
518
|
+
fieldValues = [];
|
|
519
|
+
unquotedFieldValues = [];
|
|
520
|
+
likeAr(element).forEach(function (value, key) {
|
|
521
|
+
fieldNames.push(SqlTools.quoteIdent(key));
|
|
522
|
+
fieldValues.push(SqlTools.quoteLiteral(ldb.fieldIsNotSupported(key, jsonbFields) ? JSON.stringify(value) : value));
|
|
523
|
+
unquotedFieldValues.push(value);
|
|
524
|
+
});
|
|
525
|
+
return [4 /*yield*/, ldb.executeQuery("INSERT OR REPLACE INTO " + SqlTools.quoteIdent(tableName) +
|
|
526
|
+
" (" + fieldNames.join(',') + ") values (" + fieldValues.join(',') + ");", [])];
|
|
527
|
+
case 1:
|
|
528
|
+
_a.sent();
|
|
529
|
+
return [2 /*return*/, element];
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
});
|
|
533
|
+
})];
|
|
534
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
});
|
|
538
|
+
};
|
|
539
|
+
WebsqlDb.prototype.putMany = function (tableName, elements) {
|
|
540
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
541
|
+
var sql, ldb, data, tableDef, jsonbFields;
|
|
542
|
+
return __generator(this, function (_a) {
|
|
543
|
+
switch (_a.label) {
|
|
544
|
+
case 0:
|
|
545
|
+
ldb = this;
|
|
546
|
+
data = [];
|
|
547
|
+
return [4 /*yield*/, this.getStructure(tableName)];
|
|
548
|
+
case 1:
|
|
549
|
+
tableDef = _a.sent();
|
|
550
|
+
jsonbFields = this.getNotSupportedFields(tableDef);
|
|
551
|
+
elements.forEach(function (element) {
|
|
552
|
+
if (!sql) {
|
|
553
|
+
var fieldNames = [];
|
|
554
|
+
}
|
|
555
|
+
var values = [];
|
|
556
|
+
likeAr(element).forEach(function (value, key) {
|
|
557
|
+
if (!sql) {
|
|
558
|
+
fieldNames.push(SqlTools.quoteIdent(key));
|
|
559
|
+
}
|
|
560
|
+
values.push(ldb.fieldIsNotSupported(key, jsonbFields) ? JSON.stringify(value) : value);
|
|
561
|
+
});
|
|
562
|
+
if (!sql) {
|
|
563
|
+
sql = "INSERT OR REPLACE INTO " + SqlTools.quoteIdent(tableName) +
|
|
564
|
+
" (" + fieldNames.join(',') + ") values (" + values.map(function (_) { return '?'; }).join(',') + ");";
|
|
565
|
+
}
|
|
566
|
+
data.push(values);
|
|
567
|
+
});
|
|
568
|
+
return [4 /*yield*/, this.executeQueries(sql, data)];
|
|
569
|
+
case 2:
|
|
570
|
+
_a.sent();
|
|
571
|
+
return [2 /*return*/];
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
});
|
|
575
|
+
};
|
|
576
|
+
WebsqlDb.prototype.close = function () {
|
|
577
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
578
|
+
return __generator(this, function (_a) {
|
|
579
|
+
//TODO
|
|
580
|
+
return [2 /*return*/, Promise.resolve()];
|
|
581
|
+
});
|
|
582
|
+
});
|
|
583
|
+
};
|
|
584
|
+
WebsqlDb.prototype.clear = function (tableName) {
|
|
585
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
586
|
+
return __generator(this, function (_a) {
|
|
587
|
+
switch (_a.label) {
|
|
588
|
+
case 0: return [4 /*yield*/, this.executeQuery("DELETE FROM " + SqlTools.quoteIdent(tableName) + ";", [])];
|
|
589
|
+
case 1:
|
|
590
|
+
_a.sent();
|
|
591
|
+
return [2 /*return*/];
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
});
|
|
595
|
+
};
|
|
596
|
+
return WebsqlDb;
|
|
597
|
+
}());
|
|
598
|
+
exports.WebsqlDb = WebsqlDb;
|
|
599
|
+
});
|
|
600
|
+
//# sourceMappingURL=my-websqldb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"my-websqldb.js","sourceRoot":"","sources":["../src/for-client/my-websqldb.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,iDAAiD;IACjD,YAAY,CAAC;;;IACb,uFAAuF;IACvF,kEAAkE;IAClE,+EAA+E;IAC/E,0DAA0D;IAC1D,uDAAuD;IAC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