orange-orm 5.2.4 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/deno.lock +75 -0
- package/dist/index.browser.mjs +116 -50
- package/dist/index.mjs +444 -69
- package/docs/changelog.md +5 -0
- package/other.db +0 -0
- package/package.json +2 -1
- package/src/bunSqlite/newTransaction.js +2 -1
- package/src/client/clientMap.js +2 -0
- package/src/client/createProviders.js +8 -0
- package/src/client/index.js +2 -1
- package/src/client/map.js +1 -0
- package/src/getManyDto.js +7 -5
- package/src/index.d.ts +1 -0
- package/src/index.js +11 -1
- package/src/map.d.ts +3 -0
- package/src/map2.d.ts +3 -0
- package/src/mariaDb/newDatabase.js +101 -0
- package/src/mariaDb/newPool.js +13 -0
- package/src/mariaDb/newTransaction.js +126 -0
- package/src/mssql/newTransaction.js +2 -1
- package/src/mySql/newTransaction.js +27 -1
- package/src/nodeSqlite/newTransaction.js +2 -1
- package/src/oracle/newTransaction.js +2 -1
- package/src/patchTable.js +1 -5
- package/src/pg/pool/newPgPool.js +1 -1
- package/src/sqlite3/newTransaction.js +2 -1
- package/src/table/column/bigint/newEncode.js +1 -1
- package/src/table/column/date/newEncode.js +1 -1
- package/src/table/column/dateWithTimeZone/newEncode.js +14 -10
- package/src/table/column/string/newLikeColumnArg.js +1 -1
- package/src/table/column.js +2 -7
- package/src/table/commands/delete/singleCommand/newSingleCommandCore.js +5 -1
- package/src/table/commands/newInsertAndForgetCommand.js +2 -2
- package/src/table/commands/newUpdateCommandCore.js +23 -3
- package/src/table/isJsonUpdateSupported.js +1 -1
- package/src/table/relatedTable/aggregate.js +4 -5
- package/src/table/relatedTable/where.js +4 -5
- package/src/table/relation/newManyCacheCore.js +1 -1
- package/src/table/resultToRows/dbRowToRow.js +38 -5
- package/src/tedious/newTransaction.js +2 -1
- package/src/table/query/extractLimitQuery.js +0 -23
package/dist/index.mjs
CHANGED
|
@@ -3050,6 +3050,7 @@ function requireClientMap () {
|
|
|
3050
3050
|
dbMap.mssql = throwDb;
|
|
3051
3051
|
dbMap.mssqlNative = throwDb;
|
|
3052
3052
|
dbMap.mysql = throwDb;
|
|
3053
|
+
dbMap.mariadb = throwDb;
|
|
3053
3054
|
dbMap.sap = throwDb;
|
|
3054
3055
|
dbMap.oracle = throwDb;
|
|
3055
3056
|
dbMap.sqlite = throwDb;
|
|
@@ -3078,6 +3079,7 @@ function requireClientMap () {
|
|
|
3078
3079
|
onFinal.mssql = () => index({ db: throwDb, providers: dbMap });
|
|
3079
3080
|
onFinal.mssqlNative = () => index({ db: throwDb, providers: dbMap });
|
|
3080
3081
|
onFinal.mysql = () => index({ db: throwDb, providers: dbMap });
|
|
3082
|
+
onFinal.mariadb = () => index({ db: throwDb, providers: dbMap });
|
|
3081
3083
|
onFinal.sap = () => index({ db: throwDb, providers: dbMap });
|
|
3082
3084
|
onFinal.oracle = () => index({ db: throwDb, providers: dbMap });
|
|
3083
3085
|
onFinal.sqlite = () => index({ db: throwDb, providers: dbMap });
|
|
@@ -3235,6 +3237,7 @@ function requireClient () {
|
|
|
3235
3237
|
client.oracle = onProvider.bind(null, 'oracle');
|
|
3236
3238
|
client.http = onProvider.bind(null, 'http');//todo
|
|
3237
3239
|
client.mysql = onProvider.bind(null, 'mysql');
|
|
3240
|
+
client.mariadb = onProvider.bind(null, 'mariadb');
|
|
3238
3241
|
client.express = express;
|
|
3239
3242
|
client.hono = hono;
|
|
3240
3243
|
client.close = close;
|
|
@@ -4255,7 +4258,7 @@ function requireClient () {
|
|
|
4255
4258
|
if (arguments[i][isColumnProxyKey])
|
|
4256
4259
|
args[i] = { [columnRefKey]: arguments[i][columnPathKey] };
|
|
4257
4260
|
else
|
|
4258
|
-
args[i] = arguments[i](tableProxy(
|
|
4261
|
+
args[i] = arguments[i](tableProxy());
|
|
4259
4262
|
}
|
|
4260
4263
|
else
|
|
4261
4264
|
args[i] = arguments[i];
|
|
@@ -4973,7 +4976,7 @@ function requireNewLikeColumnArg () {
|
|
|
4973
4976
|
var encodedSuffix = suffix ? column.encode(context, suffix) : null;
|
|
4974
4977
|
var engine = getSessionSingleton(context, 'engine');
|
|
4975
4978
|
|
|
4976
|
-
if (engine === 'mysql')
|
|
4979
|
+
if (engine === 'mysql' || engine === 'mariadb')
|
|
4977
4980
|
return concatWithFunction(encodedPrefix, encodedArg, encodedSuffix);
|
|
4978
4981
|
if (engine === 'mssql' || engine === 'mssqlNative')
|
|
4979
4982
|
return concatWithOperator('+', encodedPrefix, encodedArg, encodedSuffix);
|
|
@@ -5597,7 +5600,7 @@ function requireNewEncode$5 () {
|
|
|
5597
5600
|
value = purify(value);
|
|
5598
5601
|
if (value == null) {
|
|
5599
5602
|
if (column.dbNull === null)
|
|
5600
|
-
;
|
|
5603
|
+
return 'null';
|
|
5601
5604
|
return '\'' + column.dbNull + '\'';
|
|
5602
5605
|
}
|
|
5603
5606
|
var encodeCore = getSessionSingleton(context, 'encodeDate') || encodeDate;
|
|
@@ -5709,39 +5712,44 @@ function requireNewEncode$4 () {
|
|
|
5709
5712
|
hasRequiredNewEncode$4 = 1;
|
|
5710
5713
|
var newPara = requireNewParameterized();
|
|
5711
5714
|
var purify = requirePurify$3();
|
|
5715
|
+
var getSessionContext = requireGetSessionContext();
|
|
5716
|
+
var getSessionSingleton = requireGetSessionSingleton();
|
|
5712
5717
|
|
|
5713
5718
|
function _new(column) {
|
|
5714
|
-
var encode = function(
|
|
5719
|
+
var encode = function(context, value) {
|
|
5715
5720
|
value = purify(value);
|
|
5716
5721
|
if (value == null) {
|
|
5717
5722
|
if (column.dbNull === null)
|
|
5718
5723
|
return newPara('null');
|
|
5719
5724
|
return newPara('\'' + column.dbNull + '\'');
|
|
5720
5725
|
}
|
|
5721
|
-
|
|
5726
|
+
var ctx = getSessionContext(context);
|
|
5727
|
+
var encodeCore = ctx.encodeDateTz || ctx.encodeDate || encodeDate;
|
|
5728
|
+
return newPara('?', [encodeCore(value)]);
|
|
5722
5729
|
};
|
|
5723
5730
|
|
|
5724
|
-
encode.unsafe = function(
|
|
5731
|
+
encode.unsafe = function(context, value) {
|
|
5725
5732
|
value = purify(value);
|
|
5726
5733
|
if (value == null) {
|
|
5727
5734
|
if (column.dbNull === null)
|
|
5728
5735
|
return 'null';
|
|
5729
5736
|
return '\'' + column.dbNull + '\'';
|
|
5730
5737
|
}
|
|
5731
|
-
|
|
5738
|
+
var encodeCore = getSessionSingleton(context, 'encodeDateTz') || getSessionSingleton(context, 'encodeDate') || encodeDate;
|
|
5739
|
+
return encodeCore(value);
|
|
5732
5740
|
};
|
|
5733
5741
|
|
|
5734
|
-
encode.direct = function(
|
|
5735
|
-
|
|
5742
|
+
encode.direct = function(context, value) {
|
|
5743
|
+
var encodeCore = getSessionSingleton(context, 'encodeDateTz') || getSessionSingleton(context, 'encodeDate') || encodeDate;
|
|
5744
|
+
return encodeCore(value);
|
|
5736
5745
|
};
|
|
5737
5746
|
|
|
5738
5747
|
return encode;
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
5748
|
}
|
|
5749
|
+
|
|
5742
5750
|
function encodeDate(date) {
|
|
5743
5751
|
if (date.toISOString)
|
|
5744
|
-
return truncate(date.toISOString(
|
|
5752
|
+
return truncate(date.toISOString());
|
|
5745
5753
|
return truncate(date);
|
|
5746
5754
|
}
|
|
5747
5755
|
|
|
@@ -5749,7 +5757,6 @@ function requireNewEncode$4 () {
|
|
|
5749
5757
|
return date;
|
|
5750
5758
|
}
|
|
5751
5759
|
|
|
5752
|
-
|
|
5753
5760
|
newEncode$4 = _new;
|
|
5754
5761
|
return newEncode$4;
|
|
5755
5762
|
}
|
|
@@ -5937,7 +5944,7 @@ function requireNewEncode$2 () {
|
|
|
5937
5944
|
value = purify(value);
|
|
5938
5945
|
if (value == null) {
|
|
5939
5946
|
if (column.dbNull === null)
|
|
5940
|
-
;
|
|
5947
|
+
return 'null';
|
|
5941
5948
|
return '\'' + column.dbNull + '\'';
|
|
5942
5949
|
}
|
|
5943
5950
|
var encodeCore = getSessionSingleton(context, 'encodeBigint') || encodeBigint;
|
|
@@ -6286,18 +6293,13 @@ function requireColumn () {
|
|
|
6286
6293
|
return c;
|
|
6287
6294
|
};
|
|
6288
6295
|
|
|
6289
|
-
c.date = function() {
|
|
6290
|
-
requireDate()(column);
|
|
6291
|
-
return c;
|
|
6292
|
-
};
|
|
6293
|
-
|
|
6294
6296
|
c.dateWithTimeZone = function() {
|
|
6295
6297
|
requireDateWithTimeZone()(column);
|
|
6296
6298
|
return c;
|
|
6297
6299
|
};
|
|
6298
6300
|
|
|
6299
|
-
c.numeric = function(
|
|
6300
|
-
requireNumeric()(column
|
|
6301
|
+
c.numeric = function() {
|
|
6302
|
+
requireNumeric()(column);
|
|
6301
6303
|
return c;
|
|
6302
6304
|
};
|
|
6303
6305
|
|
|
@@ -7171,7 +7173,7 @@ function requireIsJsonUpdateSupported () {
|
|
|
7171
7173
|
if (hasRequiredIsJsonUpdateSupported) return isJsonUpdateSupported_1;
|
|
7172
7174
|
hasRequiredIsJsonUpdateSupported = 1;
|
|
7173
7175
|
function isJsonUpdateSupported(engine) {
|
|
7174
|
-
return engine === 'pg' || engine === 'mysql' || engine === 'sqlite' || engine === 'mssql' || engine === 'mssqlNative' || engine === 'oracle';
|
|
7176
|
+
return engine === 'pg' || engine === 'mysql' || engine === 'mariadb' || engine === 'sqlite' || engine === 'mssql' || engine === 'mssqlNative' || engine === 'oracle';
|
|
7175
7177
|
}
|
|
7176
7178
|
|
|
7177
7179
|
isJsonUpdateSupported_1 = isJsonUpdateSupported;
|
|
@@ -7270,7 +7272,7 @@ function requireNewUpdateCommandCore () {
|
|
|
7270
7272
|
if (engine === 'pg') {
|
|
7271
7273
|
command = command.append(separator + columnSql + ' IS NOT DISTINCT FROM ').append(encoded);
|
|
7272
7274
|
}
|
|
7273
|
-
else if (engine === 'mysql') {
|
|
7275
|
+
else if (engine === 'mysql' || engine === 'mariadb') {
|
|
7274
7276
|
command = command.append(separator + columnSql + ' <=> ').append(encoded);
|
|
7275
7277
|
}
|
|
7276
7278
|
else if (engine === 'sqlite') {
|
|
@@ -7309,7 +7311,7 @@ function requireNewUpdateCommandCore () {
|
|
|
7309
7311
|
if (engine === 'pg') {
|
|
7310
7312
|
command = command.append(separator).append(columnExpr).append(' IS NOT DISTINCT FROM ').append(encoded);
|
|
7311
7313
|
}
|
|
7312
|
-
else if (engine === 'mysql') {
|
|
7314
|
+
else if (engine === 'mysql' || engine === 'mariadb') {
|
|
7313
7315
|
command = command.append(separator).append(columnExpr).append(' <=> ').append(encoded);
|
|
7314
7316
|
}
|
|
7315
7317
|
else if (engine === 'sqlite') {
|
|
@@ -7370,6 +7372,11 @@ function requireNewUpdateCommandCore () {
|
|
|
7370
7372
|
const sql = 'JSON_SET(' + expr.sql() + ', ' + jsonPath.sql + ', CAST(? AS JSON))';
|
|
7371
7373
|
return newParameterized(sql, expr.parameters.concat(jsonPath.parameters, [jsonValue]));
|
|
7372
7374
|
}
|
|
7375
|
+
if (engine === 'mariadb') {
|
|
7376
|
+
const jsonValue = JSON.stringify(value === undefined ? null : value);
|
|
7377
|
+
const sql = 'JSON_SET(' + expr.sql() + ', ' + jsonPath.sql + ', JSON_EXTRACT(?, \'$\'))';
|
|
7378
|
+
return newParameterized(sql, expr.parameters.concat(jsonPath.parameters, [jsonValue]));
|
|
7379
|
+
}
|
|
7373
7380
|
if (engine === 'sqlite') {
|
|
7374
7381
|
const jsonValue = JSON.stringify(value === undefined ? null : value);
|
|
7375
7382
|
const sql = 'json_set(' + expr.sql() + ', ' + jsonPath.sql + ', json(?))';
|
|
@@ -7394,7 +7401,7 @@ function requireNewUpdateCommandCore () {
|
|
|
7394
7401
|
const sql = expr.sql() + ' #- ' + pathLiteral;
|
|
7395
7402
|
return newParameterized(sql, expr.parameters);
|
|
7396
7403
|
}
|
|
7397
|
-
if (engine === 'mysql') {
|
|
7404
|
+
if (engine === 'mysql' || engine === 'mariadb') {
|
|
7398
7405
|
const sql = 'JSON_REMOVE(' + expr.sql() + ', ' + jsonPath.sql + ')';
|
|
7399
7406
|
return newParameterized(sql, expr.parameters.concat(jsonPath.parameters));
|
|
7400
7407
|
}
|
|
@@ -7422,6 +7429,12 @@ function requireNewUpdateCommandCore () {
|
|
|
7422
7429
|
const sql = 'JSON_EXTRACT(' + columnSql + ', ' + jsonPath.sql + ')';
|
|
7423
7430
|
return newParameterized(sql, jsonPath.parameters);
|
|
7424
7431
|
}
|
|
7432
|
+
if (engine === 'mariadb') {
|
|
7433
|
+
const sql = isJsonObject(oldValue)
|
|
7434
|
+
? 'JSON_EXTRACT(' + columnSql + ', ' + jsonPath.sql + ')'
|
|
7435
|
+
: 'JSON_UNQUOTE(JSON_EXTRACT(' + columnSql + ', ' + jsonPath.sql + '))';
|
|
7436
|
+
return newParameterized(sql, jsonPath.parameters);
|
|
7437
|
+
}
|
|
7425
7438
|
if (engine === 'sqlite') {
|
|
7426
7439
|
const sql = 'json_extract(' + columnSql + ', ' + jsonPath.sql + ')';
|
|
7427
7440
|
return newParameterized(sql, jsonPath.parameters);
|
|
@@ -7497,6 +7510,15 @@ function requireNewUpdateCommandCore () {
|
|
|
7497
7510
|
const jsonValue = JSON.stringify(value === undefined ? null : value);
|
|
7498
7511
|
return newParameterized('CAST(? AS JSON)', [jsonValue]);
|
|
7499
7512
|
}
|
|
7513
|
+
if (engine === 'mariadb') {
|
|
7514
|
+
if (isJsonObject(value)) {
|
|
7515
|
+
const jsonValue = JSON.stringify(value);
|
|
7516
|
+
return newParameterized('JSON_EXTRACT(?, \'$\')', [jsonValue]);
|
|
7517
|
+
}
|
|
7518
|
+
if (value === null || value === undefined)
|
|
7519
|
+
return newParameterized('null');
|
|
7520
|
+
return newParameterized('?', [String(value)]);
|
|
7521
|
+
}
|
|
7500
7522
|
if (engine === 'sqlite') {
|
|
7501
7523
|
if (isJsonObject(value)) {
|
|
7502
7524
|
const jsonValue = JSON.stringify(value);
|
|
@@ -8196,7 +8218,7 @@ function requireNewSingleCommandCore () {
|
|
|
8196
8218
|
if (engine === 'pg') {
|
|
8197
8219
|
return newParameterized(columnSql + ' IS NOT DISTINCT FROM ' + encoded.sql(), encoded.parameters);
|
|
8198
8220
|
}
|
|
8199
|
-
if (engine === 'mysql') {
|
|
8221
|
+
if (engine === 'mysql' || engine === 'mariadb') {
|
|
8200
8222
|
return newParameterized(columnSql + ' <=> ' + encoded.sql(), encoded.parameters);
|
|
8201
8223
|
}
|
|
8202
8224
|
if (engine === 'sqlite') {
|
|
@@ -8237,6 +8259,10 @@ function requireNewSingleCommandCore () {
|
|
|
8237
8259
|
const jsonValue = JSON.stringify(value === undefined ? null : value);
|
|
8238
8260
|
return newParameterized('CAST(? AS JSON)', [jsonValue]);
|
|
8239
8261
|
}
|
|
8262
|
+
if (engine === 'mariadb') {
|
|
8263
|
+
const jsonValue = JSON.stringify(value === undefined ? null : value);
|
|
8264
|
+
return newParameterized('JSON_EXTRACT(?, \'$\')', [jsonValue]);
|
|
8265
|
+
}
|
|
8240
8266
|
if (engine === 'sqlite') {
|
|
8241
8267
|
if (isJsonObject(value)) {
|
|
8242
8268
|
const jsonValue = JSON.stringify(value);
|
|
@@ -8869,6 +8895,10 @@ function requireDbRowToRow () {
|
|
|
8869
8895
|
function dbRowToRow(context, span, dbRow) {
|
|
8870
8896
|
var table = span.table;
|
|
8871
8897
|
var row = decodeDbRow(context, span, table, dbRow);
|
|
8898
|
+
if (!hasPrimaryKey(row, table)) {
|
|
8899
|
+
skipNestedLegs(span, dbRow);
|
|
8900
|
+
return null;
|
|
8901
|
+
}
|
|
8872
8902
|
var cache = table._cache;
|
|
8873
8903
|
if (!cache.tryGet(context, row)) {
|
|
8874
8904
|
var queryContext = span.queryContext;
|
|
@@ -8885,13 +8915,15 @@ function requireDbRowToRow () {
|
|
|
8885
8915
|
var c = {};
|
|
8886
8916
|
|
|
8887
8917
|
c.visitOne = function(leg) {
|
|
8888
|
-
dbRowToRow(context, leg.span, dbRow);
|
|
8889
|
-
|
|
8918
|
+
let child = dbRowToRow(context, leg.span, dbRow);
|
|
8919
|
+
if (child)
|
|
8920
|
+
leg.expand(row);
|
|
8890
8921
|
};
|
|
8891
8922
|
|
|
8892
8923
|
c.visitJoin = function(leg) {
|
|
8893
|
-
dbRowToRow(context, leg.span, dbRow);
|
|
8894
|
-
|
|
8924
|
+
let child = dbRowToRow(context, leg.span, dbRow);
|
|
8925
|
+
if (child)
|
|
8926
|
+
leg.expand(row);
|
|
8895
8927
|
};
|
|
8896
8928
|
|
|
8897
8929
|
c.visitMany = function() {
|
|
@@ -8906,6 +8938,33 @@ function requireDbRowToRow () {
|
|
|
8906
8938
|
return row;
|
|
8907
8939
|
}
|
|
8908
8940
|
|
|
8941
|
+
function hasPrimaryKey(row, table) {
|
|
8942
|
+
return table._primaryColumns.every((column) => {
|
|
8943
|
+
let value = row[column.alias];
|
|
8944
|
+
return value !== null && value !== undefined;
|
|
8945
|
+
});
|
|
8946
|
+
}
|
|
8947
|
+
|
|
8948
|
+
function skipNestedLegs(span, dbRow) {
|
|
8949
|
+
span.legs.forEach((leg) => {
|
|
8950
|
+
leg.accept({
|
|
8951
|
+
visitOne() {
|
|
8952
|
+
skipSpan(leg.span, dbRow);
|
|
8953
|
+
},
|
|
8954
|
+
visitJoin() {
|
|
8955
|
+
skipSpan(leg.span, dbRow);
|
|
8956
|
+
},
|
|
8957
|
+
visitMany() {
|
|
8958
|
+
}
|
|
8959
|
+
});
|
|
8960
|
+
});
|
|
8961
|
+
}
|
|
8962
|
+
|
|
8963
|
+
function skipSpan(span, dbRow) {
|
|
8964
|
+
decodeDbRow(undefined, span, span.table, dbRow);
|
|
8965
|
+
skipNestedLegs(span, dbRow);
|
|
8966
|
+
}
|
|
8967
|
+
|
|
8909
8968
|
dbRowToRow_1 = dbRowToRow;
|
|
8910
8969
|
return dbRowToRow_1;
|
|
8911
8970
|
}
|
|
@@ -10247,10 +10306,9 @@ function requireWhere$1 () {
|
|
|
10247
10306
|
function newWhere(_relations, _depth) {
|
|
10248
10307
|
|
|
10249
10308
|
function where(context, fn) {
|
|
10250
|
-
|
|
10251
|
-
let { relations, alias } = extract(includeMany, _relations);
|
|
10309
|
+
let { relations, alias } = extract(_relations);
|
|
10252
10310
|
const table = relations[relations.length - 1].childTable;
|
|
10253
|
-
if (!relations[0].isMany
|
|
10311
|
+
if (!relations[0].isMany)
|
|
10254
10312
|
table._rootAlias = alias;
|
|
10255
10313
|
|
|
10256
10314
|
try {
|
|
@@ -10266,11 +10324,11 @@ function requireWhere$1 () {
|
|
|
10266
10324
|
}
|
|
10267
10325
|
return where;
|
|
10268
10326
|
|
|
10269
|
-
function extract(
|
|
10327
|
+
function extract(relations) {
|
|
10270
10328
|
let alias = relations[0].toLeg().table._dbName;
|
|
10271
10329
|
let result = [];
|
|
10272
10330
|
for (let i = 0; i < relations.length; i++) {
|
|
10273
|
-
if (relations[i].isMany
|
|
10331
|
+
if (relations[i].isMany) {
|
|
10274
10332
|
result = [relations[i]];
|
|
10275
10333
|
alias = relations[i].toLeg().table._dbName;
|
|
10276
10334
|
}
|
|
@@ -10297,10 +10355,9 @@ function requireAggregate$1 () {
|
|
|
10297
10355
|
function newAggregate(_relations) {
|
|
10298
10356
|
|
|
10299
10357
|
function aggregate(context, fn) {
|
|
10300
|
-
|
|
10301
|
-
let { relations, alias } = extract(includeMany, _relations);
|
|
10358
|
+
let { relations, alias } = extract(_relations);
|
|
10302
10359
|
const table = relations[relations.length - 1].childTable;
|
|
10303
|
-
if (!relations[0].isMany
|
|
10360
|
+
if (!relations[0].isMany)
|
|
10304
10361
|
table._rootAlias = alias;
|
|
10305
10362
|
|
|
10306
10363
|
try {
|
|
@@ -10315,11 +10372,11 @@ function requireAggregate$1 () {
|
|
|
10315
10372
|
}
|
|
10316
10373
|
return aggregate;
|
|
10317
10374
|
|
|
10318
|
-
function extract(
|
|
10375
|
+
function extract(relations) {
|
|
10319
10376
|
let alias = relations[0].toLeg().table._dbName;
|
|
10320
10377
|
let result = [];
|
|
10321
10378
|
for (let i = 0; i < relations.length; i++) {
|
|
10322
|
-
if (relations[i].isMany
|
|
10379
|
+
if (relations[i].isMany) {
|
|
10323
10380
|
result = [relations[i]];
|
|
10324
10381
|
alias = relations[i].toLeg().table._dbName;
|
|
10325
10382
|
}
|
|
@@ -10980,7 +11037,7 @@ function requireNewManyCacheCore () {
|
|
|
10980
11037
|
}
|
|
10981
11038
|
var rows = newArray();
|
|
10982
11039
|
rows.push(childRow);
|
|
10983
|
-
|
|
11040
|
+
cache.tryAdd(key, rows);
|
|
10984
11041
|
}
|
|
10985
11042
|
|
|
10986
11043
|
function newArray() {
|
|
@@ -11706,16 +11763,18 @@ function requireGetManyDto$1 () {
|
|
|
11706
11763
|
outRow[column.alias] = column.decode(context, row[keys[j]]);
|
|
11707
11764
|
}
|
|
11708
11765
|
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11766
|
+
if (outRow) {
|
|
11767
|
+
for (let j = 0; j < aggregateKeys.length; j++) {
|
|
11768
|
+
const key = aggregateKeys[j];
|
|
11769
|
+
const parse = span.aggregates[key].column?.decode || ((context, arg) => Number.parseFloat(arg));
|
|
11770
|
+
outRow[key] = parse(context, row[keys[j + columnsLength]]);
|
|
11771
|
+
}
|
|
11713
11772
|
}
|
|
11714
11773
|
|
|
11715
11774
|
outRows[i] = outRow;
|
|
11716
11775
|
if (updateParent)
|
|
11717
11776
|
updateParent(outRow, i);
|
|
11718
|
-
if (shouldCreateMap) {
|
|
11777
|
+
if (shouldCreateMap && outRow) {
|
|
11719
11778
|
fkIds[i] = getIds(outRow);
|
|
11720
11779
|
addToMap(rowsMap, fkIds[i], outRow);
|
|
11721
11780
|
}
|
|
@@ -12906,7 +12965,6 @@ function requirePatchTable () {
|
|
|
12906
12965
|
let result;
|
|
12907
12966
|
for (let i = 0; i < relation.columns.length; i++) {
|
|
12908
12967
|
let p = relation.columns[i].alias;
|
|
12909
|
-
row[p];
|
|
12910
12968
|
result = await remove({ path: ['dummy', p], oldValue: (oldValue || {})[p], op, options: options }, table, row) || result;
|
|
12911
12969
|
}
|
|
12912
12970
|
return result || {};
|
|
@@ -12919,8 +12977,7 @@ function requirePatchTable () {
|
|
|
12919
12977
|
let p = relation.columns[i].alias;
|
|
12920
12978
|
let childKey = relation.childTable._primaryColumns[i].alias;
|
|
12921
12979
|
if (path[1] === childKey) {
|
|
12922
|
-
|
|
12923
|
-
result = await remove({ path: ['dummy', p], oldValue: (oldValue || {})[p], op, options: options }, table, row) || result;
|
|
12980
|
+
result = await remove({ path: ['dummy', p], oldValue: oldValue[p], op, options: options }, table, row) || result;
|
|
12924
12981
|
break;
|
|
12925
12982
|
}
|
|
12926
12983
|
}
|
|
@@ -13510,6 +13567,11 @@ function requireCreateProviders () {
|
|
|
13510
13567
|
return createPool.bind(null, 'mysql');
|
|
13511
13568
|
}
|
|
13512
13569
|
});
|
|
13570
|
+
Object.defineProperty(dbMap, 'mariadb', {
|
|
13571
|
+
get: function() {
|
|
13572
|
+
return createPool.bind(null, 'mariadb');
|
|
13573
|
+
}
|
|
13574
|
+
});
|
|
13513
13575
|
Object.defineProperty(dbMap, 'sap', {
|
|
13514
13576
|
get: function() {
|
|
13515
13577
|
return createPool.bind(null, 'sap');
|
|
@@ -13574,6 +13636,9 @@ function requireCreateProviders () {
|
|
|
13574
13636
|
get mysql() {
|
|
13575
13637
|
return createPool.bind(null, 'mysql');
|
|
13576
13638
|
},
|
|
13639
|
+
get mariadb() {
|
|
13640
|
+
return createPool.bind(null, 'mariadb');
|
|
13641
|
+
},
|
|
13577
13642
|
get sap() {
|
|
13578
13643
|
return createPool.bind(null, 'sap');
|
|
13579
13644
|
},
|
|
@@ -13669,6 +13734,7 @@ function requireMap () {
|
|
|
13669
13734
|
context.mssql = connect.bind(null, 'mssql');
|
|
13670
13735
|
context.mssqlNative = connect.bind(null, 'mssqlNative');
|
|
13671
13736
|
context.mysql = connect.bind(null, 'mysql');
|
|
13737
|
+
context.mariadb = connect.bind(null, 'mariadb');
|
|
13672
13738
|
context.sap = connect.bind(null, 'sap');
|
|
13673
13739
|
context.oracle = connect.bind(null, 'oracle');
|
|
13674
13740
|
context.sqlite = connect.bind(null, 'sqlite');
|
|
@@ -14818,12 +14884,12 @@ function requireInsert$5 () {
|
|
|
14818
14884
|
return insert$4;
|
|
14819
14885
|
}
|
|
14820
14886
|
|
|
14821
|
-
var newTransaction$
|
|
14822
|
-
var hasRequiredNewTransaction$
|
|
14887
|
+
var newTransaction$c;
|
|
14888
|
+
var hasRequiredNewTransaction$c;
|
|
14823
14889
|
|
|
14824
|
-
function requireNewTransaction$
|
|
14825
|
-
if (hasRequiredNewTransaction$
|
|
14826
|
-
hasRequiredNewTransaction$
|
|
14890
|
+
function requireNewTransaction$c () {
|
|
14891
|
+
if (hasRequiredNewTransaction$c) return newTransaction$c;
|
|
14892
|
+
hasRequiredNewTransaction$c = 1;
|
|
14827
14893
|
const wrapQuery = requireWrapQuery$a();
|
|
14828
14894
|
const wrapCommand = requireWrapCommand$a();
|
|
14829
14895
|
const encodeBoolean = requireEncodeBoolean$5();
|
|
@@ -14844,6 +14910,9 @@ function requireNewTransaction$b () {
|
|
|
14844
14910
|
}
|
|
14845
14911
|
rdb.engine = 'mysql';
|
|
14846
14912
|
rdb.encodeBoolean = encodeBoolean;
|
|
14913
|
+
rdb.decodeJSON = decodeJSON;
|
|
14914
|
+
rdb.encodeDate = encodeDate;
|
|
14915
|
+
rdb.encodeDateTz = encodeDateTz;
|
|
14847
14916
|
rdb.encodeJSON = JSON.stringify;
|
|
14848
14917
|
rdb.deleteFromSql = deleteFromSql;
|
|
14849
14918
|
rdb.selectForUpdateSql = selectForUpdateSql;
|
|
@@ -14923,8 +14992,31 @@ function requireNewTransaction$b () {
|
|
|
14923
14992
|
};
|
|
14924
14993
|
}
|
|
14925
14994
|
|
|
14926
|
-
|
|
14927
|
-
|
|
14995
|
+
function decodeJSON(value) {
|
|
14996
|
+
return JSON.parse(value);
|
|
14997
|
+
}
|
|
14998
|
+
|
|
14999
|
+
function encodeDate(date) {
|
|
15000
|
+
date = date.toISOString ? removeTimezone(date.toISOString()) : removeTimezone(date);
|
|
15001
|
+
return date;
|
|
15002
|
+
}
|
|
15003
|
+
|
|
15004
|
+
function removeTimezone(isoString) {
|
|
15005
|
+
let dateTimePattern = /[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(.[0-9]{3})?/;
|
|
15006
|
+
let match = isoString.match(dateTimePattern);
|
|
15007
|
+
return match ? match[0] : isoString;
|
|
15008
|
+
}
|
|
15009
|
+
|
|
15010
|
+
function encodeDateTz(date) {
|
|
15011
|
+
if (date && date.toISOString)
|
|
15012
|
+
return removeTimezone(date.toISOString());
|
|
15013
|
+
if (typeof date === 'string' && /(Z|[+-][0-9]{2}:[0-9]{2})$/.test(date))
|
|
15014
|
+
return removeTimezone(new Date(date).toISOString());
|
|
15015
|
+
return date;
|
|
15016
|
+
}
|
|
15017
|
+
|
|
15018
|
+
newTransaction$c = newResolveTransaction;
|
|
15019
|
+
return newTransaction$c;
|
|
14928
15020
|
}
|
|
14929
15021
|
|
|
14930
15022
|
var beginCommand;
|
|
@@ -15734,12 +15826,12 @@ function requireNewGenericPool$7 () {
|
|
|
15734
15826
|
return newGenericPool_1$7;
|
|
15735
15827
|
}
|
|
15736
15828
|
|
|
15737
|
-
var newPool_1$
|
|
15738
|
-
var hasRequiredNewPool$
|
|
15829
|
+
var newPool_1$c;
|
|
15830
|
+
var hasRequiredNewPool$c;
|
|
15739
15831
|
|
|
15740
|
-
function requireNewPool$
|
|
15741
|
-
if (hasRequiredNewPool$
|
|
15742
|
-
hasRequiredNewPool$
|
|
15832
|
+
function requireNewPool$c () {
|
|
15833
|
+
if (hasRequiredNewPool$c) return newPool_1$c;
|
|
15834
|
+
hasRequiredNewPool$c = 1;
|
|
15743
15835
|
const promisify = requirePromisify();
|
|
15744
15836
|
const pools = requirePools();
|
|
15745
15837
|
const end = requireEnd$a();
|
|
@@ -15758,6 +15850,277 @@ function requireNewPool$b () {
|
|
|
15758
15850
|
return c;
|
|
15759
15851
|
}
|
|
15760
15852
|
|
|
15853
|
+
newPool_1$c = newPool;
|
|
15854
|
+
return newPool_1$c;
|
|
15855
|
+
}
|
|
15856
|
+
|
|
15857
|
+
var newDatabase_1$c;
|
|
15858
|
+
var hasRequiredNewDatabase$c;
|
|
15859
|
+
|
|
15860
|
+
function requireNewDatabase$c () {
|
|
15861
|
+
if (hasRequiredNewDatabase$c) return newDatabase_1$c;
|
|
15862
|
+
hasRequiredNewDatabase$c = 1;
|
|
15863
|
+
let createDomain = requireCreateDomain();
|
|
15864
|
+
let newTransaction = requireNewTransaction$c();
|
|
15865
|
+
let _begin = requireBegin();
|
|
15866
|
+
let commit = requireCommit();
|
|
15867
|
+
let rollback = requireRollback();
|
|
15868
|
+
let newPool = requireNewPool$c();
|
|
15869
|
+
let express = requireHostExpress();
|
|
15870
|
+
let hono = requireHostHono();
|
|
15871
|
+
let hostLocal = requireHostLocal();
|
|
15872
|
+
let doQuery = requireQuery();
|
|
15873
|
+
let releaseDbClient = requireReleaseDbClient();
|
|
15874
|
+
|
|
15875
|
+
function newDatabase(connectionString, poolOptions) {
|
|
15876
|
+
if (!connectionString)
|
|
15877
|
+
throw new Error('Connection string cannot be empty');
|
|
15878
|
+
poolOptions = poolOptions || { min: 1 };
|
|
15879
|
+
var pool = newPool(connectionString, poolOptions);
|
|
15880
|
+
|
|
15881
|
+
let c = { poolFactory: pool, hostLocal, express, hono };
|
|
15882
|
+
|
|
15883
|
+
c.transaction = function(options, fn) {
|
|
15884
|
+
if ((arguments.length === 1) && (typeof options === 'function')) {
|
|
15885
|
+
fn = options;
|
|
15886
|
+
options = undefined;
|
|
15887
|
+
}
|
|
15888
|
+
let domain = createDomain();
|
|
15889
|
+
|
|
15890
|
+
if (!fn)
|
|
15891
|
+
throw new Error('transaction requires a function');
|
|
15892
|
+
return domain.run(runInTransaction);
|
|
15893
|
+
|
|
15894
|
+
async function runInTransaction() {
|
|
15895
|
+
let result;
|
|
15896
|
+
let transaction = newTransaction(domain, pool, options);
|
|
15897
|
+
await new Promise(transaction)
|
|
15898
|
+
.then(begin)
|
|
15899
|
+
.then(() => fn(domain))
|
|
15900
|
+
.then((res) => result = res)
|
|
15901
|
+
.then(() => commit(domain))
|
|
15902
|
+
.then(null, (e) => rollback(domain, e));
|
|
15903
|
+
return result;
|
|
15904
|
+
}
|
|
15905
|
+
|
|
15906
|
+
function begin() {
|
|
15907
|
+
return _begin(domain, options);
|
|
15908
|
+
}
|
|
15909
|
+
|
|
15910
|
+
|
|
15911
|
+
};
|
|
15912
|
+
|
|
15913
|
+
c.createTransaction = function(options) {
|
|
15914
|
+
let domain = createDomain();
|
|
15915
|
+
let transaction = newTransaction(domain, pool);
|
|
15916
|
+
let p = domain.run(() => new Promise(transaction).then(begin));
|
|
15917
|
+
|
|
15918
|
+
function run(fn) {
|
|
15919
|
+
return p.then(() => fn(domain));
|
|
15920
|
+
}
|
|
15921
|
+
run.rollback = rollback.bind(null, domain);
|
|
15922
|
+
run.commit = commit.bind(null, domain);
|
|
15923
|
+
return run;
|
|
15924
|
+
|
|
15925
|
+
function begin() {
|
|
15926
|
+
return _begin(domain, options);
|
|
15927
|
+
}
|
|
15928
|
+
};
|
|
15929
|
+
|
|
15930
|
+
|
|
15931
|
+
c.query = function(query) {
|
|
15932
|
+
let domain = createDomain();
|
|
15933
|
+
let transaction = newTransaction(domain, pool);
|
|
15934
|
+
let p = domain.run(() => new Promise(transaction)
|
|
15935
|
+
.then(() => doQuery(domain, query).then(onResult, onError)));
|
|
15936
|
+
return p;
|
|
15937
|
+
|
|
15938
|
+
function onResult(result) {
|
|
15939
|
+
releaseDbClient(domain);
|
|
15940
|
+
return result;
|
|
15941
|
+
}
|
|
15942
|
+
|
|
15943
|
+
function onError(e) {
|
|
15944
|
+
releaseDbClient(domain);
|
|
15945
|
+
throw e;
|
|
15946
|
+
}
|
|
15947
|
+
};
|
|
15948
|
+
|
|
15949
|
+
|
|
15950
|
+
c.rollback = rollback;
|
|
15951
|
+
c.commit = commit;
|
|
15952
|
+
|
|
15953
|
+
c.end = function() {
|
|
15954
|
+
if (poolOptions)
|
|
15955
|
+
return pool.end();
|
|
15956
|
+
else
|
|
15957
|
+
return Promise.resolve();
|
|
15958
|
+
};
|
|
15959
|
+
|
|
15960
|
+
c.accept = function(caller) {
|
|
15961
|
+
caller.visitMySql();
|
|
15962
|
+
};
|
|
15963
|
+
|
|
15964
|
+
return c;
|
|
15965
|
+
}
|
|
15966
|
+
|
|
15967
|
+
newDatabase_1$c = newDatabase;
|
|
15968
|
+
return newDatabase_1$c;
|
|
15969
|
+
}
|
|
15970
|
+
|
|
15971
|
+
var newTransaction$b;
|
|
15972
|
+
var hasRequiredNewTransaction$b;
|
|
15973
|
+
|
|
15974
|
+
function requireNewTransaction$b () {
|
|
15975
|
+
if (hasRequiredNewTransaction$b) return newTransaction$b;
|
|
15976
|
+
hasRequiredNewTransaction$b = 1;
|
|
15977
|
+
const wrapQuery = requireWrapQuery$a();
|
|
15978
|
+
const wrapCommand = requireWrapCommand$a();
|
|
15979
|
+
const encodeBoolean = requireEncodeBoolean$5();
|
|
15980
|
+
const deleteFromSql = requireDeleteFromSql$5();
|
|
15981
|
+
const selectForUpdateSql = requireSelectForUpdateSql$5();
|
|
15982
|
+
const lastInsertedSql = requireLastInsertedSql$4();
|
|
15983
|
+
const limitAndOffset = requireLimitAndOffset$5();
|
|
15984
|
+
const formatBigintOut = requireFormatBigintOut$4();
|
|
15985
|
+
const insertSql = requireInsertSql$5();
|
|
15986
|
+
const insert = requireInsert$5();
|
|
15987
|
+
const quote = requireQuote$5();
|
|
15988
|
+
|
|
15989
|
+
function newResolveTransaction(domain, pool, { readonly = false } = {}) {
|
|
15990
|
+
var rdb = { poolFactory: pool };
|
|
15991
|
+
if (!pool.connect) {
|
|
15992
|
+
pool = pool();
|
|
15993
|
+
rdb.pool = pool;
|
|
15994
|
+
}
|
|
15995
|
+
rdb.engine = 'mariadb';
|
|
15996
|
+
rdb.encodeBoolean = encodeBoolean;
|
|
15997
|
+
rdb.decodeJSON = decodeJSON;
|
|
15998
|
+
rdb.encodeDate = encodeDate;
|
|
15999
|
+
rdb.encodeDateTz = encodeDateTz;
|
|
16000
|
+
rdb.encodeJSON = JSON.stringify;
|
|
16001
|
+
rdb.deleteFromSql = deleteFromSql;
|
|
16002
|
+
rdb.selectForUpdateSql = selectForUpdateSql;
|
|
16003
|
+
rdb.lastInsertedIsSeparate = true;
|
|
16004
|
+
rdb.lastInsertedSql = lastInsertedSql;
|
|
16005
|
+
rdb.formatBigintOut = formatBigintOut;
|
|
16006
|
+
rdb.insertSql = insertSql;
|
|
16007
|
+
rdb.insert = insert;
|
|
16008
|
+
rdb.multipleStatements = false;
|
|
16009
|
+
rdb.limitAndOffset = limitAndOffset;
|
|
16010
|
+
rdb.accept = function(caller) {
|
|
16011
|
+
caller.visitMySql();
|
|
16012
|
+
};
|
|
16013
|
+
rdb.aggregateCount = 0;
|
|
16014
|
+
rdb.quote = quote;
|
|
16015
|
+
rdb.cache = {};
|
|
16016
|
+
rdb.changes = [];
|
|
16017
|
+
|
|
16018
|
+
if (readonly) {
|
|
16019
|
+
rdb.dbClient = {
|
|
16020
|
+
executeQuery: function(query, callback) {
|
|
16021
|
+
pool.connect((err, client, done) => {
|
|
16022
|
+
if (err) {
|
|
16023
|
+
return callback(err);
|
|
16024
|
+
}
|
|
16025
|
+
try {
|
|
16026
|
+
wrapQuery(domain, client)(query, (err, res) => {
|
|
16027
|
+
done();
|
|
16028
|
+
callback(err, res);
|
|
16029
|
+
});
|
|
16030
|
+
} catch (e) {
|
|
16031
|
+
done();
|
|
16032
|
+
callback(e);
|
|
16033
|
+
}
|
|
16034
|
+
});
|
|
16035
|
+
},
|
|
16036
|
+
executeCommand: function(query, callback) {
|
|
16037
|
+
pool.connect((err, client, done) => {
|
|
16038
|
+
if (err) {
|
|
16039
|
+
return callback(err);
|
|
16040
|
+
}
|
|
16041
|
+
try {
|
|
16042
|
+
wrapCommand(domain, client)(query, (err, res) => {
|
|
16043
|
+
done();
|
|
16044
|
+
callback(err, res);
|
|
16045
|
+
});
|
|
16046
|
+
} catch (e) {
|
|
16047
|
+
done();
|
|
16048
|
+
callback(e);
|
|
16049
|
+
}
|
|
16050
|
+
});
|
|
16051
|
+
}
|
|
16052
|
+
};
|
|
16053
|
+
domain.rdb = rdb;
|
|
16054
|
+
return (onSuccess) => onSuccess();
|
|
16055
|
+
}
|
|
16056
|
+
|
|
16057
|
+
return function(onSuccess, onError) {
|
|
16058
|
+
pool.connect(onConnected);
|
|
16059
|
+
|
|
16060
|
+
function onConnected(err, client, done) {
|
|
16061
|
+
try {
|
|
16062
|
+
if (err) {
|
|
16063
|
+
onError(err);
|
|
16064
|
+
return;
|
|
16065
|
+
}
|
|
16066
|
+
client.executeQuery = wrapQuery(domain, client);
|
|
16067
|
+
client.executeCommand = wrapCommand(domain, client);
|
|
16068
|
+
rdb.dbClient = client;
|
|
16069
|
+
rdb.dbClientDone = done;
|
|
16070
|
+
domain.rdb = rdb;
|
|
16071
|
+
onSuccess();
|
|
16072
|
+
} catch (e) {
|
|
16073
|
+
onError(e);
|
|
16074
|
+
}
|
|
16075
|
+
}
|
|
16076
|
+
};
|
|
16077
|
+
}
|
|
16078
|
+
|
|
16079
|
+
function decodeJSON(value) {
|
|
16080
|
+
return JSON.parse(value);
|
|
16081
|
+
}
|
|
16082
|
+
|
|
16083
|
+
function encodeDate(date) {
|
|
16084
|
+
date = date.toISOString ? removeTimezone(date.toISOString()) : removeTimezone(date);
|
|
16085
|
+
return date;
|
|
16086
|
+
}
|
|
16087
|
+
|
|
16088
|
+
function removeTimezone(isoString) {
|
|
16089
|
+
let dateTimePattern = /[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(.[0-9]{3})?/;
|
|
16090
|
+
let match = isoString.match(dateTimePattern);
|
|
16091
|
+
return match ? match[0] : isoString;
|
|
16092
|
+
}
|
|
16093
|
+
|
|
16094
|
+
function encodeDateTz(date) {
|
|
16095
|
+
if (date && date.toISOString)
|
|
16096
|
+
return removeTimezone(date.toISOString());
|
|
16097
|
+
if (typeof date === 'string' && /(Z|[+-][0-9]{2}:[0-9]{2})$/.test(date))
|
|
16098
|
+
return removeTimezone(new Date(date).toISOString());
|
|
16099
|
+
return date;
|
|
16100
|
+
}
|
|
16101
|
+
|
|
16102
|
+
newTransaction$b = newResolveTransaction;
|
|
16103
|
+
return newTransaction$b;
|
|
16104
|
+
}
|
|
16105
|
+
|
|
16106
|
+
var newPool_1$b;
|
|
16107
|
+
var hasRequiredNewPool$b;
|
|
16108
|
+
|
|
16109
|
+
function requireNewPool$b () {
|
|
16110
|
+
if (hasRequiredNewPool$b) return newPool_1$b;
|
|
16111
|
+
hasRequiredNewPool$b = 1;
|
|
16112
|
+
const mySqlNewPool = requireNewPool$c();
|
|
16113
|
+
|
|
16114
|
+
function normalizeConnectionString(connectionString) {
|
|
16115
|
+
if (typeof connectionString === 'string' && connectionString.indexOf('mariadb://') === 0)
|
|
16116
|
+
return 'mysql://' + connectionString.slice('mariadb://'.length);
|
|
16117
|
+
return connectionString;
|
|
16118
|
+
}
|
|
16119
|
+
|
|
16120
|
+
function newPool(connectionString, poolOptions) {
|
|
16121
|
+
return mySqlNewPool(normalizeConnectionString(connectionString), poolOptions);
|
|
16122
|
+
}
|
|
16123
|
+
|
|
15761
16124
|
newPool_1$b = newPool;
|
|
15762
16125
|
return newPool_1$b;
|
|
15763
16126
|
}
|
|
@@ -15814,8 +16177,6 @@ function requireNewDatabase$b () {
|
|
|
15814
16177
|
function begin() {
|
|
15815
16178
|
return _begin(domain, options);
|
|
15816
16179
|
}
|
|
15817
|
-
|
|
15818
|
-
|
|
15819
16180
|
};
|
|
15820
16181
|
|
|
15821
16182
|
c.createTransaction = function(options) {
|
|
@@ -15835,7 +16196,6 @@ function requireNewDatabase$b () {
|
|
|
15835
16196
|
}
|
|
15836
16197
|
};
|
|
15837
16198
|
|
|
15838
|
-
|
|
15839
16199
|
c.query = function(query) {
|
|
15840
16200
|
let domain = createDomain();
|
|
15841
16201
|
let transaction = newTransaction(domain, pool);
|
|
@@ -15854,7 +16214,6 @@ function requireNewDatabase$b () {
|
|
|
15854
16214
|
}
|
|
15855
16215
|
};
|
|
15856
16216
|
|
|
15857
|
-
|
|
15858
16217
|
c.rollback = rollback;
|
|
15859
16218
|
c.commit = commit;
|
|
15860
16219
|
|
|
@@ -17669,7 +18028,7 @@ function requireNewPgPool () {
|
|
|
17669
18028
|
if (!pg) {
|
|
17670
18029
|
pg = await import('pg');
|
|
17671
18030
|
pg = pg.default || pg;
|
|
17672
|
-
let types = pg.types
|
|
18031
|
+
let types = pg.types;
|
|
17673
18032
|
types.setTypeParser(1700, function(val) {
|
|
17674
18033
|
return parseFloat(val);
|
|
17675
18034
|
});
|
|
@@ -18256,6 +18615,7 @@ function requireNewTransaction$7 () {
|
|
|
18256
18615
|
rdb.pool = pool;
|
|
18257
18616
|
}
|
|
18258
18617
|
rdb.engine = 'sqlite';
|
|
18618
|
+
rdb.maxParameters = 32766;
|
|
18259
18619
|
rdb.encodeBoolean = encodeBoolean;
|
|
18260
18620
|
rdb.encodeBinary = encodeBinary;
|
|
18261
18621
|
rdb.decodeBinary = decodeBinary;
|
|
@@ -18689,6 +19049,7 @@ function requireNewTransaction$6 () {
|
|
|
18689
19049
|
rdb.pool = pool;
|
|
18690
19050
|
}
|
|
18691
19051
|
rdb.engine = 'sqlite';
|
|
19052
|
+
rdb.maxParameters = 32766;
|
|
18692
19053
|
rdb.encodeBoolean = encodeBoolean;
|
|
18693
19054
|
rdb.encodeBinary = encodeBinary;
|
|
18694
19055
|
rdb.decodeBinary = decodeBinary;
|
|
@@ -19125,6 +19486,7 @@ function requireNewTransaction$5 () {
|
|
|
19125
19486
|
rdb.pool = pool;
|
|
19126
19487
|
}
|
|
19127
19488
|
rdb.engine = 'sqlite';
|
|
19489
|
+
rdb.maxParameters = 32766;
|
|
19128
19490
|
rdb.encodeBoolean = encodeBoolean;
|
|
19129
19491
|
rdb.decodeJSON = decodeJSON;
|
|
19130
19492
|
rdb.encodeJSON = JSON.stringify;
|
|
@@ -20543,6 +20905,7 @@ function requireNewTransaction$3 () {
|
|
|
20543
20905
|
rdb.pool = pool;
|
|
20544
20906
|
}
|
|
20545
20907
|
rdb.engine = 'mssqlNative';
|
|
20908
|
+
rdb.maxParameters = 2100;
|
|
20546
20909
|
rdb.encodeBoolean = encodeBoolean;
|
|
20547
20910
|
rdb.decodeJSON = decodeJSON;
|
|
20548
20911
|
rdb.encodeJSON = JSON.stringify;
|
|
@@ -21305,6 +21668,7 @@ function requireNewTransaction$2 () {
|
|
|
21305
21668
|
rdb.pool = pool;
|
|
21306
21669
|
}
|
|
21307
21670
|
rdb.engine = 'mssql';
|
|
21671
|
+
rdb.maxParameters = 2100;
|
|
21308
21672
|
rdb.encodeBoolean = encodeBoolean;
|
|
21309
21673
|
rdb.decodeJSON = decodeJSON;
|
|
21310
21674
|
rdb.encodeJSON = JSON.stringify;
|
|
@@ -22873,6 +23237,7 @@ function requireNewTransaction () {
|
|
|
22873
23237
|
|
|
22874
23238
|
rdb.begin = 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED';
|
|
22875
23239
|
rdb.engine = 'oracle';
|
|
23240
|
+
rdb.maxParameters = 32768;
|
|
22876
23241
|
rdb.encodeBoolean = encodeBoolean;
|
|
22877
23242
|
rdb.decodeJSON = decodeJSON;
|
|
22878
23243
|
rdb.encodeJSON = JSON.stringify;
|
|
@@ -23214,6 +23579,7 @@ function requireSrc () {
|
|
|
23214
23579
|
const runtimes = requireRuntimes();
|
|
23215
23580
|
|
|
23216
23581
|
let _mySql;
|
|
23582
|
+
let _mariadb;
|
|
23217
23583
|
let _pg;
|
|
23218
23584
|
let _pglite;
|
|
23219
23585
|
let _sqlite;
|
|
@@ -23224,7 +23590,9 @@ function requireSrc () {
|
|
|
23224
23590
|
let _d1;
|
|
23225
23591
|
|
|
23226
23592
|
var connectViaPool = function(connectionString) {
|
|
23227
|
-
if (connectionString.indexOf && connectionString.indexOf('
|
|
23593
|
+
if (connectionString.indexOf && connectionString.indexOf('mariadb') === 0)
|
|
23594
|
+
return connectViaPool.mariadb.apply(null, arguments);
|
|
23595
|
+
else if (connectionString.indexOf && connectionString.indexOf('mysql') === 0)
|
|
23228
23596
|
return connectViaPool.mySql.apply(null, arguments);
|
|
23229
23597
|
else if (connectionString.indexOf && connectionString.indexOf('postgres') === 0)
|
|
23230
23598
|
connectViaPool.pg.apply(null, arguments);
|
|
@@ -23253,7 +23621,7 @@ function requireSrc () {
|
|
|
23253
23621
|
Object.defineProperty(connectViaPool, 'mysql', {
|
|
23254
23622
|
get: function() {
|
|
23255
23623
|
if (!_mySql)
|
|
23256
|
-
_mySql = requireNewDatabase$
|
|
23624
|
+
_mySql = requireNewDatabase$c();
|
|
23257
23625
|
return _mySql;
|
|
23258
23626
|
}
|
|
23259
23627
|
});
|
|
@@ -23261,10 +23629,17 @@ function requireSrc () {
|
|
|
23261
23629
|
Object.defineProperty(connectViaPool, 'mySql', {
|
|
23262
23630
|
get: function() {
|
|
23263
23631
|
if (!_mySql)
|
|
23264
|
-
_mySql = requireNewDatabase$
|
|
23632
|
+
_mySql = requireNewDatabase$c();
|
|
23265
23633
|
return _mySql;
|
|
23266
23634
|
}
|
|
23267
23635
|
});
|
|
23636
|
+
Object.defineProperty(connectViaPool, 'mariadb', {
|
|
23637
|
+
get: function() {
|
|
23638
|
+
if (!_mariadb)
|
|
23639
|
+
_mariadb = requireNewDatabase$b();
|
|
23640
|
+
return _mariadb;
|
|
23641
|
+
}
|
|
23642
|
+
});
|
|
23268
23643
|
Object.defineProperty(connectViaPool, 'pglite', {
|
|
23269
23644
|
get: function() {
|
|
23270
23645
|
if (!_pglite)
|