orange-orm 4.7.0-beta.1 → 4.7.0-beta.2
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/dist/index.browser.mjs +893 -166
- package/package.json +1 -1
- package/src/indexBrowser.js +9 -0
package/dist/index.browser.mjs
CHANGED
|
@@ -2085,12 +2085,12 @@ function requireNegotiateParameters () {
|
|
|
2085
2085
|
return negotiateParameters_1;
|
|
2086
2086
|
}
|
|
2087
2087
|
|
|
2088
|
-
var wrapQuery_1$
|
|
2089
|
-
var hasRequiredWrapQuery$
|
|
2088
|
+
var wrapQuery_1$2;
|
|
2089
|
+
var hasRequiredWrapQuery$2;
|
|
2090
2090
|
|
|
2091
|
-
function requireWrapQuery$
|
|
2092
|
-
if (hasRequiredWrapQuery$
|
|
2093
|
-
hasRequiredWrapQuery$
|
|
2091
|
+
function requireWrapQuery$2 () {
|
|
2092
|
+
if (hasRequiredWrapQuery$2) return wrapQuery_1$2;
|
|
2093
|
+
hasRequiredWrapQuery$2 = 1;
|
|
2094
2094
|
var negotiateSql = requireNegotiateSql();
|
|
2095
2095
|
var negotiateParameters = requireNegotiateParameters();
|
|
2096
2096
|
|
|
@@ -2107,8 +2107,8 @@ function requireWrapQuery$1 () {
|
|
|
2107
2107
|
}
|
|
2108
2108
|
|
|
2109
2109
|
|
|
2110
|
-
wrapQuery_1$
|
|
2111
|
-
return wrapQuery_1$
|
|
2110
|
+
wrapQuery_1$2 = wrapQuery;
|
|
2111
|
+
return wrapQuery_1$2;
|
|
2112
2112
|
}
|
|
2113
2113
|
|
|
2114
2114
|
var query;
|
|
@@ -2118,7 +2118,7 @@ function requireQuery () {
|
|
|
2118
2118
|
if (hasRequiredQuery) return query;
|
|
2119
2119
|
hasRequiredQuery = 1;
|
|
2120
2120
|
var executeQueries = requireExecuteQueries();
|
|
2121
|
-
var wrapQuery = requireWrapQuery$
|
|
2121
|
+
var wrapQuery = requireWrapQuery$2();
|
|
2122
2122
|
|
|
2123
2123
|
function doQuery(context, query) {
|
|
2124
2124
|
var wrappedQuery = wrapQuery(query);
|
|
@@ -3749,11 +3749,11 @@ function requireEncodeFilterArg () {
|
|
|
3749
3749
|
}
|
|
3750
3750
|
|
|
3751
3751
|
var quote_1;
|
|
3752
|
-
var hasRequiredQuote$
|
|
3752
|
+
var hasRequiredQuote$2;
|
|
3753
3753
|
|
|
3754
|
-
function requireQuote$
|
|
3755
|
-
if (hasRequiredQuote$
|
|
3756
|
-
hasRequiredQuote$
|
|
3754
|
+
function requireQuote$2 () {
|
|
3755
|
+
if (hasRequiredQuote$2) return quote_1;
|
|
3756
|
+
hasRequiredQuote$2 = 1;
|
|
3757
3757
|
let tryGetSessionContext = requireTryGetSessionContext();
|
|
3758
3758
|
|
|
3759
3759
|
function quote(context, name) {
|
|
@@ -3777,7 +3777,7 @@ function requireEqual () {
|
|
|
3777
3777
|
var newBoolean = requireNewBoolean();
|
|
3778
3778
|
var nullOperator = ' is ';
|
|
3779
3779
|
var encodeFilterArg = requireEncodeFilterArg();
|
|
3780
|
-
var quote = requireQuote$
|
|
3780
|
+
var quote = requireQuote$2();
|
|
3781
3781
|
|
|
3782
3782
|
function equal(context, column,arg,alias) {
|
|
3783
3783
|
var operator = '=';
|
|
@@ -3802,7 +3802,7 @@ function requireNotEqual () {
|
|
|
3802
3802
|
var newBoolean = requireNewBoolean();
|
|
3803
3803
|
var encodeFilterArg = requireEncodeFilterArg();
|
|
3804
3804
|
var nullOperator = ' is not ';
|
|
3805
|
-
var quote = requireQuote$
|
|
3805
|
+
var quote = requireQuote$2();
|
|
3806
3806
|
|
|
3807
3807
|
function notEqual(context, column,arg,alias) {
|
|
3808
3808
|
var operator = '<>';
|
|
@@ -3826,7 +3826,7 @@ function requireLessThan () {
|
|
|
3826
3826
|
hasRequiredLessThan = 1;
|
|
3827
3827
|
var newBoolean = requireNewBoolean();
|
|
3828
3828
|
var encodeFilterArg = requireEncodeFilterArg();
|
|
3829
|
-
var quote = requireQuote$
|
|
3829
|
+
var quote = requireQuote$2();
|
|
3830
3830
|
|
|
3831
3831
|
function lessThanOrEqual(context, column,arg,alias) {
|
|
3832
3832
|
var operator = '<';
|
|
@@ -3871,7 +3871,7 @@ function requireGreaterThan () {
|
|
|
3871
3871
|
hasRequiredGreaterThan = 1;
|
|
3872
3872
|
var newBoolean = requireNewBoolean();
|
|
3873
3873
|
var encodeFilterArg = requireEncodeFilterArg();
|
|
3874
|
-
var quote = requireQuote$
|
|
3874
|
+
var quote = requireQuote$2();
|
|
3875
3875
|
|
|
3876
3876
|
function greaterThan(context, column,arg,alias) {
|
|
3877
3877
|
var operator = '>';
|
|
@@ -3893,7 +3893,7 @@ function requireGreaterThanOrEqual () {
|
|
|
3893
3893
|
hasRequiredGreaterThanOrEqual = 1;
|
|
3894
3894
|
var newBoolean = requireNewBoolean();
|
|
3895
3895
|
var encodeFilterArg = requireEncodeFilterArg();
|
|
3896
|
-
var quote = requireQuote$
|
|
3896
|
+
var quote = requireQuote$2();
|
|
3897
3897
|
|
|
3898
3898
|
function greaterThanOrEqual(context, column,arg,alias) {
|
|
3899
3899
|
var operator = '>=';
|
|
@@ -3915,7 +3915,7 @@ function require_in () {
|
|
|
3915
3915
|
hasRequired_in = 1;
|
|
3916
3916
|
const newParameterized = requireNewParameterized();
|
|
3917
3917
|
const newBoolean = requireNewBoolean();
|
|
3918
|
-
const quote = requireQuote$
|
|
3918
|
+
const quote = requireQuote$2();
|
|
3919
3919
|
|
|
3920
3920
|
function _in(context, column,values,alias) {
|
|
3921
3921
|
let filter;
|
|
@@ -4140,7 +4140,7 @@ function requireNewColumn () {
|
|
|
4140
4140
|
const greaterThanOrEqual = requireGreaterThanOrEqual();
|
|
4141
4141
|
const _in = require_in();
|
|
4142
4142
|
const _extractAlias = requireExtractAlias();
|
|
4143
|
-
const quote = requireQuote$
|
|
4143
|
+
const quote = requireQuote$2();
|
|
4144
4144
|
const aggregate = requireColumnAggregate$1();
|
|
4145
4145
|
const aggregateGroup = requireColumnAggregateGroup$1();
|
|
4146
4146
|
|
|
@@ -4328,7 +4328,7 @@ function requireStartsWithCore () {
|
|
|
4328
4328
|
hasRequiredStartsWithCore = 1;
|
|
4329
4329
|
var newBoolean = requireNewBoolean();
|
|
4330
4330
|
var nullOperator = ' is ';
|
|
4331
|
-
var quote = requireQuote$
|
|
4331
|
+
var quote = requireQuote$2();
|
|
4332
4332
|
|
|
4333
4333
|
function startsWithCore(context, operator, column,arg,alias) {
|
|
4334
4334
|
operator = ' ' + operator + ' ';
|
|
@@ -4364,7 +4364,7 @@ var hasRequiredEndsWithCore;
|
|
|
4364
4364
|
function requireEndsWithCore () {
|
|
4365
4365
|
if (hasRequiredEndsWithCore) return endsWithCore_1;
|
|
4366
4366
|
hasRequiredEndsWithCore = 1;
|
|
4367
|
-
const quote = requireQuote$
|
|
4367
|
+
const quote = requireQuote$2();
|
|
4368
4368
|
var newBoolean = requireNewBoolean();
|
|
4369
4369
|
var nullOperator = ' is ';
|
|
4370
4370
|
|
|
@@ -4403,7 +4403,7 @@ var hasRequiredContainsCore;
|
|
|
4403
4403
|
function requireContainsCore () {
|
|
4404
4404
|
if (hasRequiredContainsCore) return containsCore;
|
|
4405
4405
|
hasRequiredContainsCore = 1;
|
|
4406
|
-
const quote = requireQuote$
|
|
4406
|
+
const quote = requireQuote$2();
|
|
4407
4407
|
var newBoolean = requireNewBoolean();
|
|
4408
4408
|
var nullOperator = ' is ';
|
|
4409
4409
|
|
|
@@ -4481,7 +4481,7 @@ function requireIEqual () {
|
|
|
4481
4481
|
var newBoolean = requireNewBoolean();
|
|
4482
4482
|
var nullOperator = ' is ';
|
|
4483
4483
|
var encodeFilterArg = requireEncodeFilterArg();
|
|
4484
|
-
const quote = requireQuote$
|
|
4484
|
+
const quote = requireQuote$2();
|
|
4485
4485
|
|
|
4486
4486
|
function iEqual(context, column,arg,alias) {
|
|
4487
4487
|
var operator = ' ILIKE ';
|
|
@@ -4673,7 +4673,7 @@ function requireFormatOut$1 () {
|
|
|
4673
4673
|
if (hasRequiredFormatOut$1) return formatOut_1$1;
|
|
4674
4674
|
hasRequiredFormatOut$1 = 1;
|
|
4675
4675
|
var getSessionSingleton = requireGetSessionSingleton();
|
|
4676
|
-
const quote = requireQuote$
|
|
4676
|
+
const quote = requireQuote$2();
|
|
4677
4677
|
|
|
4678
4678
|
function formatOut(context, column, alias) {
|
|
4679
4679
|
var formatColumn = getSessionSingleton(context, 'formatJSONOut');
|
|
@@ -4964,7 +4964,7 @@ function requireFormatOut () {
|
|
|
4964
4964
|
if (hasRequiredFormatOut) return formatOut_1;
|
|
4965
4965
|
hasRequiredFormatOut = 1;
|
|
4966
4966
|
var getSessionSingleton = requireGetSessionSingleton();
|
|
4967
|
-
const quote = requireQuote$
|
|
4967
|
+
const quote = requireQuote$2();
|
|
4968
4968
|
|
|
4969
4969
|
function formatOut(context, column, alias) {
|
|
4970
4970
|
var formatColumn = getSessionSingleton(context, 'formatDateOut');
|
|
@@ -6102,7 +6102,7 @@ function requireNewSingleQuery$1 () {
|
|
|
6102
6102
|
var negotiateLimit = requireNegotiateLimit();
|
|
6103
6103
|
var negotiateExclusive = requireNegotiateExclusive();
|
|
6104
6104
|
var newParameterized = requireNewParameterized();
|
|
6105
|
-
var quote = requireQuote$
|
|
6105
|
+
var quote = requireQuote$2();
|
|
6106
6106
|
|
|
6107
6107
|
function _new(context, table, filter, span, alias, innerJoin, orderBy, limit, offset, exclusive) {
|
|
6108
6108
|
|
|
@@ -6764,7 +6764,7 @@ function requireSelectSql$1 () {
|
|
|
6764
6764
|
hasRequiredSelectSql$1 = 1;
|
|
6765
6765
|
const newParameterized = requireNewParameterized();
|
|
6766
6766
|
const newBoolean = requireNewBoolean();
|
|
6767
|
-
const quote = requireQuote$
|
|
6767
|
+
const quote = requireQuote$2();
|
|
6768
6768
|
|
|
6769
6769
|
function newSelectSql(context, table, alias) {
|
|
6770
6770
|
const colName = quote(context, table._primaryColumns[0]._dbName);
|
|
@@ -9322,7 +9322,7 @@ function requireChildColumn () {
|
|
|
9322
9322
|
var getSessionContext = requireGetSessionContext();
|
|
9323
9323
|
var newJoinCore = requireNewShallowJoinSqlCore();
|
|
9324
9324
|
const getSessionSingleton = requireGetSessionSingleton();
|
|
9325
|
-
const _quote = requireQuote$
|
|
9325
|
+
const _quote = requireQuote$2();
|
|
9326
9326
|
|
|
9327
9327
|
|
|
9328
9328
|
function childColumn(context, column, relations) {
|
|
@@ -10644,7 +10644,7 @@ function requireCount () {
|
|
|
10644
10644
|
const negotiateRawSqlFilter = requireNegotiateRawSqlFilter();
|
|
10645
10645
|
const extractFilter = requireExtractFilter();
|
|
10646
10646
|
const newWhereSql = requireNewWhereSql();
|
|
10647
|
-
const quote = requireQuote$
|
|
10647
|
+
const quote = requireQuote$2();
|
|
10648
10648
|
|
|
10649
10649
|
async function count(context, table, filter) {
|
|
10650
10650
|
let alias = table._dbName;
|
|
@@ -11371,11 +11371,11 @@ function requireNewRow () {
|
|
|
11371
11371
|
}
|
|
11372
11372
|
|
|
11373
11373
|
var insert_1;
|
|
11374
|
-
var hasRequiredInsert$
|
|
11374
|
+
var hasRequiredInsert$2;
|
|
11375
11375
|
|
|
11376
|
-
function requireInsert$
|
|
11377
|
-
if (hasRequiredInsert$
|
|
11378
|
-
hasRequiredInsert$
|
|
11376
|
+
function requireInsert$2 () {
|
|
11377
|
+
if (hasRequiredInsert$2) return insert_1;
|
|
11378
|
+
hasRequiredInsert$2 = 1;
|
|
11379
11379
|
let getSessionContext = requireGetSessionContext();
|
|
11380
11380
|
let newRow = requireNewRow();
|
|
11381
11381
|
|
|
@@ -11682,7 +11682,7 @@ function requireTable () {
|
|
|
11682
11682
|
const tryGetFirst = requireTryGetFirstFromDb();
|
|
11683
11683
|
const newCache = requireNewRowCache();
|
|
11684
11684
|
const newContext = requireNewObject();
|
|
11685
|
-
const insert = requireInsert$
|
|
11685
|
+
const insert = requireInsert$2();
|
|
11686
11686
|
const _delete = require_delete();
|
|
11687
11687
|
const cascadeDelete = requireCascadeDelete();
|
|
11688
11688
|
const patchTable = requirePatchTable();
|
|
@@ -12524,12 +12524,12 @@ function requireCreateDomain () {
|
|
|
12524
12524
|
return createDomain_1;
|
|
12525
12525
|
}
|
|
12526
12526
|
|
|
12527
|
-
var wrapQuery_1;
|
|
12528
|
-
var hasRequiredWrapQuery;
|
|
12527
|
+
var wrapQuery_1$1;
|
|
12528
|
+
var hasRequiredWrapQuery$1;
|
|
12529
12529
|
|
|
12530
|
-
function requireWrapQuery () {
|
|
12531
|
-
if (hasRequiredWrapQuery) return wrapQuery_1;
|
|
12532
|
-
hasRequiredWrapQuery = 1;
|
|
12530
|
+
function requireWrapQuery$1 () {
|
|
12531
|
+
if (hasRequiredWrapQuery$1) return wrapQuery_1$1;
|
|
12532
|
+
hasRequiredWrapQuery$1 = 1;
|
|
12533
12533
|
var log = requireLog();
|
|
12534
12534
|
|
|
12535
12535
|
function wrapQuery(_context, client) {
|
|
@@ -12551,8 +12551,8 @@ function requireWrapQuery () {
|
|
|
12551
12551
|
|
|
12552
12552
|
}
|
|
12553
12553
|
|
|
12554
|
-
wrapQuery_1 = wrapQuery;
|
|
12555
|
-
return wrapQuery_1;
|
|
12554
|
+
wrapQuery_1$1 = wrapQuery;
|
|
12555
|
+
return wrapQuery_1$1;
|
|
12556
12556
|
}
|
|
12557
12557
|
|
|
12558
12558
|
var encodeBoolean_1;
|
|
@@ -12589,55 +12589,55 @@ function requireFormat () {
|
|
|
12589
12589
|
return format_1;
|
|
12590
12590
|
}
|
|
12591
12591
|
|
|
12592
|
-
var quote;
|
|
12593
|
-
var hasRequiredQuote;
|
|
12592
|
+
var quote$1;
|
|
12593
|
+
var hasRequiredQuote$1;
|
|
12594
12594
|
|
|
12595
|
-
function requireQuote () {
|
|
12596
|
-
if (hasRequiredQuote) return quote;
|
|
12597
|
-
hasRequiredQuote = 1;
|
|
12598
|
-
quote = (name) => `"${name}"`;
|
|
12599
|
-
return quote;
|
|
12595
|
+
function requireQuote$1 () {
|
|
12596
|
+
if (hasRequiredQuote$1) return quote$1;
|
|
12597
|
+
hasRequiredQuote$1 = 1;
|
|
12598
|
+
quote$1 = (name) => `"${name}"`;
|
|
12599
|
+
return quote$1;
|
|
12600
12600
|
}
|
|
12601
12601
|
|
|
12602
|
-
var deleteFromSql_1;
|
|
12603
|
-
var hasRequiredDeleteFromSql;
|
|
12602
|
+
var deleteFromSql_1$1;
|
|
12603
|
+
var hasRequiredDeleteFromSql$1;
|
|
12604
12604
|
|
|
12605
|
-
function requireDeleteFromSql () {
|
|
12606
|
-
if (hasRequiredDeleteFromSql) return deleteFromSql_1;
|
|
12607
|
-
hasRequiredDeleteFromSql = 1;
|
|
12605
|
+
function requireDeleteFromSql$1 () {
|
|
12606
|
+
if (hasRequiredDeleteFromSql$1) return deleteFromSql_1$1;
|
|
12607
|
+
hasRequiredDeleteFromSql$1 = 1;
|
|
12608
12608
|
const format = 'delete from %s where %s.rowId in (SELECT %s.rowId FROM %s %s%s)';
|
|
12609
12609
|
const formatString = requireFormat();
|
|
12610
|
-
const quote = requireQuote();
|
|
12610
|
+
const quote = requireQuote$1();
|
|
12611
12611
|
|
|
12612
12612
|
function deleteFromSql(table, alias, whereSql) {
|
|
12613
12613
|
const name = quote(table._dbName);
|
|
12614
12614
|
alias = quote(alias);
|
|
12615
12615
|
return formatString(format, name, name, alias, name, alias, whereSql);
|
|
12616
12616
|
}
|
|
12617
|
-
deleteFromSql_1 = deleteFromSql;
|
|
12618
|
-
return deleteFromSql_1;
|
|
12617
|
+
deleteFromSql_1$1 = deleteFromSql;
|
|
12618
|
+
return deleteFromSql_1$1;
|
|
12619
12619
|
}
|
|
12620
12620
|
|
|
12621
|
-
var selectForUpdateSql;
|
|
12622
|
-
var hasRequiredSelectForUpdateSql;
|
|
12621
|
+
var selectForUpdateSql$1;
|
|
12622
|
+
var hasRequiredSelectForUpdateSql$1;
|
|
12623
12623
|
|
|
12624
|
-
function requireSelectForUpdateSql () {
|
|
12625
|
-
if (hasRequiredSelectForUpdateSql) return selectForUpdateSql;
|
|
12626
|
-
hasRequiredSelectForUpdateSql = 1;
|
|
12627
|
-
const quote = requireQuote$
|
|
12624
|
+
function requireSelectForUpdateSql$1 () {
|
|
12625
|
+
if (hasRequiredSelectForUpdateSql$1) return selectForUpdateSql$1;
|
|
12626
|
+
hasRequiredSelectForUpdateSql$1 = 1;
|
|
12627
|
+
const quote = requireQuote$2();
|
|
12628
12628
|
|
|
12629
|
-
selectForUpdateSql = function(alias) {
|
|
12629
|
+
selectForUpdateSql$1 = function(alias) {
|
|
12630
12630
|
return ' FOR UPDATE OF ' + quote(alias);
|
|
12631
12631
|
};
|
|
12632
|
-
return selectForUpdateSql;
|
|
12632
|
+
return selectForUpdateSql$1;
|
|
12633
12633
|
}
|
|
12634
12634
|
|
|
12635
|
-
var lastInsertedSql_1;
|
|
12636
|
-
var hasRequiredLastInsertedSql;
|
|
12635
|
+
var lastInsertedSql_1$1;
|
|
12636
|
+
var hasRequiredLastInsertedSql$1;
|
|
12637
12637
|
|
|
12638
|
-
function requireLastInsertedSql () {
|
|
12639
|
-
if (hasRequiredLastInsertedSql) return lastInsertedSql_1;
|
|
12640
|
-
hasRequiredLastInsertedSql = 1;
|
|
12638
|
+
function requireLastInsertedSql$1 () {
|
|
12639
|
+
if (hasRequiredLastInsertedSql$1) return lastInsertedSql_1$1;
|
|
12640
|
+
hasRequiredLastInsertedSql$1 = 1;
|
|
12641
12641
|
function lastInsertedSql(context, table, keyValues) {
|
|
12642
12642
|
return keyValues.map((value,i) => {
|
|
12643
12643
|
let column = table._primaryColumns[i];
|
|
@@ -12649,16 +12649,16 @@ function requireLastInsertedSql () {
|
|
|
12649
12649
|
|
|
12650
12650
|
}
|
|
12651
12651
|
|
|
12652
|
-
lastInsertedSql_1 = lastInsertedSql;
|
|
12653
|
-
return lastInsertedSql_1;
|
|
12652
|
+
lastInsertedSql_1$1 = lastInsertedSql;
|
|
12653
|
+
return lastInsertedSql_1$1;
|
|
12654
12654
|
}
|
|
12655
12655
|
|
|
12656
|
-
var limitAndOffset_1;
|
|
12657
|
-
var hasRequiredLimitAndOffset;
|
|
12656
|
+
var limitAndOffset_1$1;
|
|
12657
|
+
var hasRequiredLimitAndOffset$1;
|
|
12658
12658
|
|
|
12659
|
-
function requireLimitAndOffset () {
|
|
12660
|
-
if (hasRequiredLimitAndOffset) return limitAndOffset_1;
|
|
12661
|
-
hasRequiredLimitAndOffset = 1;
|
|
12659
|
+
function requireLimitAndOffset$1 () {
|
|
12660
|
+
if (hasRequiredLimitAndOffset$1) return limitAndOffset_1$1;
|
|
12661
|
+
hasRequiredLimitAndOffset$1 = 1;
|
|
12662
12662
|
function limitAndOffset(span) {
|
|
12663
12663
|
if (span.offset)
|
|
12664
12664
|
return ` limit ${limit()} offset ${span.offset}`;
|
|
@@ -12676,17 +12676,17 @@ function requireLimitAndOffset () {
|
|
|
12676
12676
|
|
|
12677
12677
|
}
|
|
12678
12678
|
|
|
12679
|
-
limitAndOffset_1 = limitAndOffset;
|
|
12680
|
-
return limitAndOffset_1;
|
|
12679
|
+
limitAndOffset_1$1 = limitAndOffset;
|
|
12680
|
+
return limitAndOffset_1$1;
|
|
12681
12681
|
}
|
|
12682
12682
|
|
|
12683
|
-
var insertSql_1;
|
|
12684
|
-
var hasRequiredInsertSql;
|
|
12683
|
+
var insertSql_1$1;
|
|
12684
|
+
var hasRequiredInsertSql$1;
|
|
12685
12685
|
|
|
12686
|
-
function requireInsertSql () {
|
|
12687
|
-
if (hasRequiredInsertSql) return insertSql_1;
|
|
12688
|
-
hasRequiredInsertSql = 1;
|
|
12689
|
-
const quote = requireQuote();
|
|
12686
|
+
function requireInsertSql$1 () {
|
|
12687
|
+
if (hasRequiredInsertSql$1) return insertSql_1$1;
|
|
12688
|
+
hasRequiredInsertSql$1 = 1;
|
|
12689
|
+
const quote = requireQuote$1();
|
|
12690
12690
|
|
|
12691
12691
|
function insertSql(_context, table, row, options) {
|
|
12692
12692
|
let columnNames = [];
|
|
@@ -12752,8 +12752,8 @@ function requireInsertSql () {
|
|
|
12752
12752
|
}
|
|
12753
12753
|
}
|
|
12754
12754
|
|
|
12755
|
-
insertSql_1 = insertSql;
|
|
12756
|
-
return insertSql_1;
|
|
12755
|
+
insertSql_1$1 = insertSql;
|
|
12756
|
+
return insertSql_1$1;
|
|
12757
12757
|
}
|
|
12758
12758
|
|
|
12759
12759
|
var newInsertCommand_1;
|
|
@@ -12830,7 +12830,7 @@ function requireGetSqlTemplate () {
|
|
|
12830
12830
|
if (hasRequiredGetSqlTemplate) return getSqlTemplate_1;
|
|
12831
12831
|
hasRequiredGetSqlTemplate = 1;
|
|
12832
12832
|
let getSessionContext = requireGetSessionContext();
|
|
12833
|
-
let quote = requireQuote$
|
|
12833
|
+
let quote = requireQuote$2();
|
|
12834
12834
|
|
|
12835
12835
|
function getSqlTemplate(context, _table, _row) {
|
|
12836
12836
|
let rdb = getSessionContext(context);
|
|
@@ -12944,7 +12944,7 @@ function requireNewGetLastInsertedCommandCore () {
|
|
|
12944
12944
|
const newParameterized = requireNewParameterized();
|
|
12945
12945
|
const getSessionContext = requireGetSessionContext();
|
|
12946
12946
|
const newDiscriminatorSql = requireNewDiscriminatorSql$1();
|
|
12947
|
-
const quote = requireQuote$
|
|
12947
|
+
const quote = requireQuote$2();
|
|
12948
12948
|
|
|
12949
12949
|
function newGetLastInsertedCommandCore(context, table, row) {
|
|
12950
12950
|
let parameters = [];
|
|
@@ -13046,12 +13046,12 @@ function requireNewGetLastInsertedCommand () {
|
|
|
13046
13046
|
return newGetLastInsertedCommand_1;
|
|
13047
13047
|
}
|
|
13048
13048
|
|
|
13049
|
-
var insert;
|
|
13050
|
-
var hasRequiredInsert;
|
|
13049
|
+
var insert$1;
|
|
13050
|
+
var hasRequiredInsert$1;
|
|
13051
13051
|
|
|
13052
|
-
function requireInsert () {
|
|
13053
|
-
if (hasRequiredInsert) return insert;
|
|
13054
|
-
hasRequiredInsert = 1;
|
|
13052
|
+
function requireInsert$1 () {
|
|
13053
|
+
if (hasRequiredInsert$1) return insert$1;
|
|
13054
|
+
hasRequiredInsert$1 = 1;
|
|
13055
13055
|
let newInsertCommand = requireNewInsertCommand();
|
|
13056
13056
|
let newInsertCommandCore = requireNewInsertCommandCore();
|
|
13057
13057
|
let newGetLastInsertedCommand = requireNewGetLastInsertedCommand();
|
|
@@ -13072,24 +13072,24 @@ function requireInsert () {
|
|
|
13072
13072
|
|
|
13073
13073
|
}
|
|
13074
13074
|
|
|
13075
|
-
insert = insertDefault;
|
|
13076
|
-
return insert;
|
|
13075
|
+
insert$1 = insertDefault;
|
|
13076
|
+
return insert$1;
|
|
13077
13077
|
}
|
|
13078
13078
|
|
|
13079
|
-
var newTransaction;
|
|
13080
|
-
var hasRequiredNewTransaction;
|
|
13079
|
+
var newTransaction$1;
|
|
13080
|
+
var hasRequiredNewTransaction$1;
|
|
13081
13081
|
|
|
13082
|
-
function requireNewTransaction () {
|
|
13083
|
-
if (hasRequiredNewTransaction) return newTransaction;
|
|
13084
|
-
hasRequiredNewTransaction = 1;
|
|
13085
|
-
const wrapQuery = requireWrapQuery();
|
|
13082
|
+
function requireNewTransaction$1 () {
|
|
13083
|
+
if (hasRequiredNewTransaction$1) return newTransaction$1;
|
|
13084
|
+
hasRequiredNewTransaction$1 = 1;
|
|
13085
|
+
const wrapQuery = requireWrapQuery$1();
|
|
13086
13086
|
const encodeBoolean = requireEncodeBoolean();
|
|
13087
|
-
const deleteFromSql = requireDeleteFromSql();
|
|
13088
|
-
const selectForUpdateSql = requireSelectForUpdateSql();
|
|
13089
|
-
const lastInsertedSql = requireLastInsertedSql();
|
|
13090
|
-
const limitAndOffset = requireLimitAndOffset();
|
|
13091
|
-
const insertSql = requireInsertSql();
|
|
13092
|
-
const insert = requireInsert();
|
|
13087
|
+
const deleteFromSql = requireDeleteFromSql$1();
|
|
13088
|
+
const selectForUpdateSql = requireSelectForUpdateSql$1();
|
|
13089
|
+
const lastInsertedSql = requireLastInsertedSql$1();
|
|
13090
|
+
const limitAndOffset = requireLimitAndOffset$1();
|
|
13091
|
+
const insertSql = requireInsertSql$1();
|
|
13092
|
+
const insert = requireInsert$1();
|
|
13093
13093
|
|
|
13094
13094
|
function newResolveTransaction(domain, pool, { readonly = false } = {}) {
|
|
13095
13095
|
var rdb = {poolFactory: pool};
|
|
@@ -13165,8 +13165,8 @@ function requireNewTransaction () {
|
|
|
13165
13165
|
return JSON.parse(value);
|
|
13166
13166
|
}
|
|
13167
13167
|
|
|
13168
|
-
newTransaction = newResolveTransaction;
|
|
13169
|
-
return newTransaction;
|
|
13168
|
+
newTransaction$1 = newResolveTransaction;
|
|
13169
|
+
return newTransaction$1;
|
|
13170
13170
|
}
|
|
13171
13171
|
|
|
13172
13172
|
var beginCommand;
|
|
@@ -13247,12 +13247,12 @@ function requirePromisify () {
|
|
|
13247
13247
|
return promisify_1;
|
|
13248
13248
|
}
|
|
13249
13249
|
|
|
13250
|
-
var end;
|
|
13251
|
-
var hasRequiredEnd;
|
|
13250
|
+
var end$1;
|
|
13251
|
+
var hasRequiredEnd$1;
|
|
13252
13252
|
|
|
13253
|
-
function requireEnd () {
|
|
13254
|
-
if (hasRequiredEnd) return end;
|
|
13255
|
-
hasRequiredEnd = 1;
|
|
13253
|
+
function requireEnd$1 () {
|
|
13254
|
+
if (hasRequiredEnd$1) return end$1;
|
|
13255
|
+
hasRequiredEnd$1 = 1;
|
|
13256
13256
|
var pools = requirePools();
|
|
13257
13257
|
|
|
13258
13258
|
function endPool(genericPool, id, done) {
|
|
@@ -13265,8 +13265,8 @@ function requireEnd () {
|
|
|
13265
13265
|
}
|
|
13266
13266
|
}
|
|
13267
13267
|
|
|
13268
|
-
end = endPool;
|
|
13269
|
-
return end;
|
|
13268
|
+
end$1 = endPool;
|
|
13269
|
+
return end$1;
|
|
13270
13270
|
}
|
|
13271
13271
|
|
|
13272
13272
|
var poolDefaults;
|
|
@@ -13954,15 +13954,15 @@ function requireNewGenericPool () {
|
|
|
13954
13954
|
return newGenericPool_1;
|
|
13955
13955
|
}
|
|
13956
13956
|
|
|
13957
|
-
var newPool_1;
|
|
13958
|
-
var hasRequiredNewPool;
|
|
13957
|
+
var newPool_1$1;
|
|
13958
|
+
var hasRequiredNewPool$1;
|
|
13959
13959
|
|
|
13960
|
-
function requireNewPool () {
|
|
13961
|
-
if (hasRequiredNewPool) return newPool_1;
|
|
13962
|
-
hasRequiredNewPool = 1;
|
|
13960
|
+
function requireNewPool$1 () {
|
|
13961
|
+
if (hasRequiredNewPool$1) return newPool_1$1;
|
|
13962
|
+
hasRequiredNewPool$1 = 1;
|
|
13963
13963
|
const promisify = requirePromisify();
|
|
13964
13964
|
const pools = requirePools();
|
|
13965
|
-
const end = requireEnd();
|
|
13965
|
+
const end = requireEnd$1();
|
|
13966
13966
|
const newGenericPool = requireNewGenericPool();
|
|
13967
13967
|
const newId = requireNewId();
|
|
13968
13968
|
|
|
@@ -13978,22 +13978,22 @@ function requireNewPool () {
|
|
|
13978
13978
|
return c;
|
|
13979
13979
|
}
|
|
13980
13980
|
|
|
13981
|
-
newPool_1 = newPool;
|
|
13982
|
-
return newPool_1;
|
|
13981
|
+
newPool_1$1 = newPool;
|
|
13982
|
+
return newPool_1$1;
|
|
13983
13983
|
}
|
|
13984
13984
|
|
|
13985
|
-
var newDatabase_1;
|
|
13986
|
-
var hasRequiredNewDatabase;
|
|
13985
|
+
var newDatabase_1$1;
|
|
13986
|
+
var hasRequiredNewDatabase$1;
|
|
13987
13987
|
|
|
13988
|
-
function requireNewDatabase () {
|
|
13989
|
-
if (hasRequiredNewDatabase) return newDatabase_1;
|
|
13990
|
-
hasRequiredNewDatabase = 1;
|
|
13988
|
+
function requireNewDatabase$1 () {
|
|
13989
|
+
if (hasRequiredNewDatabase$1) return newDatabase_1$1;
|
|
13990
|
+
hasRequiredNewDatabase$1 = 1;
|
|
13991
13991
|
let createDomain = requireCreateDomain();
|
|
13992
|
-
let newTransaction = requireNewTransaction();
|
|
13992
|
+
let newTransaction = requireNewTransaction$1();
|
|
13993
13993
|
let _begin = requireBegin();
|
|
13994
13994
|
let commit = requireCommit();
|
|
13995
13995
|
let rollback = requireRollback();
|
|
13996
|
-
let newPool = requireNewPool();
|
|
13996
|
+
let newPool = requireNewPool$1();
|
|
13997
13997
|
let express = requireHostExpress();
|
|
13998
13998
|
let hostLocal = requireHostLocal();
|
|
13999
13999
|
let doQuery = requireQuery();
|
|
@@ -14106,49 +14106,776 @@ function requireNewDatabase () {
|
|
|
14106
14106
|
return c;
|
|
14107
14107
|
}
|
|
14108
14108
|
|
|
14109
|
-
newDatabase_1 = newDatabase;
|
|
14110
|
-
return newDatabase_1;
|
|
14109
|
+
newDatabase_1$1 = newDatabase;
|
|
14110
|
+
return newDatabase_1$1;
|
|
14111
14111
|
}
|
|
14112
14112
|
|
|
14113
|
-
var
|
|
14114
|
-
var
|
|
14113
|
+
var replaceParamChar_1;
|
|
14114
|
+
var hasRequiredReplaceParamChar;
|
|
14115
14115
|
|
|
14116
|
-
function
|
|
14117
|
-
if (
|
|
14118
|
-
|
|
14119
|
-
|
|
14120
|
-
|
|
14121
|
-
|
|
14122
|
-
|
|
14123
|
-
|
|
14116
|
+
function requireReplaceParamChar () {
|
|
14117
|
+
if (hasRequiredReplaceParamChar) return replaceParamChar_1;
|
|
14118
|
+
hasRequiredReplaceParamChar = 1;
|
|
14119
|
+
function replaceParamChar(query, params) {
|
|
14120
|
+
if (params.length === 0)
|
|
14121
|
+
return query.sql();
|
|
14122
|
+
var splitted = query.sql().split('?');
|
|
14123
|
+
var sql = '';
|
|
14124
|
+
var lastIndex = splitted.length - 1;
|
|
14125
|
+
for (var i = 0; i < lastIndex; i++) {
|
|
14126
|
+
sql += splitted[i] + '$' + (i + 1);
|
|
14127
|
+
}
|
|
14128
|
+
sql += splitted[lastIndex];
|
|
14129
|
+
return sql;
|
|
14130
|
+
}
|
|
14124
14131
|
|
|
14125
|
-
|
|
14126
|
-
|
|
14127
|
-
|
|
14128
|
-
connectViaPool.createPatch = client.createPatch;
|
|
14129
|
-
connectViaPool.table = requireTable();
|
|
14130
|
-
connectViaPool.filter = requireEmptyFilter();
|
|
14131
|
-
connectViaPool.commit = requireCommit();
|
|
14132
|
-
connectViaPool.rollback = requireRollback();
|
|
14133
|
-
connectViaPool.end = requirePools().end;
|
|
14134
|
-
connectViaPool.log = requireLog().registerLogger;
|
|
14135
|
-
connectViaPool.on = requireLog().on;
|
|
14136
|
-
connectViaPool.off = requireLog().off;
|
|
14137
|
-
connectViaPool.query = requireQuery();
|
|
14138
|
-
connectViaPool.lock = requireLock();
|
|
14139
|
-
connectViaPool.schema = requireSchema();
|
|
14140
|
-
connectViaPool.map = map.bind(null, connectViaPool);
|
|
14132
|
+
replaceParamChar_1 = replaceParamChar;
|
|
14133
|
+
return replaceParamChar_1;
|
|
14134
|
+
}
|
|
14141
14135
|
|
|
14142
|
-
|
|
14143
|
-
|
|
14136
|
+
var wrapQuery_1;
|
|
14137
|
+
var hasRequiredWrapQuery;
|
|
14138
|
+
|
|
14139
|
+
function requireWrapQuery () {
|
|
14140
|
+
if (hasRequiredWrapQuery) return wrapQuery_1;
|
|
14141
|
+
hasRequiredWrapQuery = 1;
|
|
14142
|
+
var log = requireLog();
|
|
14143
|
+
var replaceParamChar = requireReplaceParamChar();
|
|
14144
|
+
|
|
14145
|
+
function wrapQuery(_context, connection) {
|
|
14146
|
+
var runOriginalQuery = connection.query;
|
|
14147
|
+
return runQuery;
|
|
14148
|
+
|
|
14149
|
+
function runQuery(query, onCompleted) {
|
|
14150
|
+
var params = query.parameters;
|
|
14151
|
+
var sql = replaceParamChar(query, params);
|
|
14152
|
+
log.emitQuery({sql, parameters: params});
|
|
14153
|
+
runOriginalQuery.call(connection, sql, params).then((result) => onInnerCompleted(null, result), (e) => onInnerCompleted(e));
|
|
14154
|
+
|
|
14155
|
+
function onInnerCompleted(err, result) {
|
|
14156
|
+
if (err)
|
|
14157
|
+
onCompleted(err);
|
|
14158
|
+
else {
|
|
14159
|
+
if (Array.isArray(result))
|
|
14160
|
+
result = result[result.length-1];
|
|
14161
|
+
onCompleted(null, result.rows);
|
|
14162
|
+
}
|
|
14163
|
+
}
|
|
14164
|
+
}
|
|
14165
|
+
|
|
14166
|
+
}
|
|
14167
|
+
|
|
14168
|
+
wrapQuery_1 = wrapQuery;
|
|
14169
|
+
return wrapQuery_1;
|
|
14170
|
+
}
|
|
14171
|
+
|
|
14172
|
+
var encodeDate_1;
|
|
14173
|
+
var hasRequiredEncodeDate;
|
|
14174
|
+
|
|
14175
|
+
function requireEncodeDate () {
|
|
14176
|
+
if (hasRequiredEncodeDate) return encodeDate_1;
|
|
14177
|
+
hasRequiredEncodeDate = 1;
|
|
14178
|
+
function encodeDate(date) {
|
|
14179
|
+
if (date.toISOString)
|
|
14180
|
+
return '\'' + date.toISOString() + '\'';
|
|
14181
|
+
return '\'' + date + '\'';
|
|
14182
|
+
}
|
|
14183
|
+
|
|
14184
|
+
encodeDate_1 = encodeDate;
|
|
14185
|
+
return encodeDate_1;
|
|
14186
|
+
}
|
|
14187
|
+
|
|
14188
|
+
var encodeBinary_1;
|
|
14189
|
+
var hasRequiredEncodeBinary;
|
|
14190
|
+
|
|
14191
|
+
function requireEncodeBinary () {
|
|
14192
|
+
if (hasRequiredEncodeBinary) return encodeBinary_1;
|
|
14193
|
+
hasRequiredEncodeBinary = 1;
|
|
14194
|
+
function encodeBinary(base64) {
|
|
14195
|
+
// Decode base64 to a binary string
|
|
14196
|
+
const binaryString = atob(base64);
|
|
14197
|
+
|
|
14198
|
+
// Create a new Uint8Array with the same length as the binary string
|
|
14199
|
+
const len = binaryString.length;
|
|
14200
|
+
const bytes = new Uint8Array(len);
|
|
14201
|
+
|
|
14202
|
+
// Populate the Uint8Array with numeric character codes
|
|
14203
|
+
for (let i = 0; i < len; i++) {
|
|
14204
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
14205
|
+
}
|
|
14206
|
+
|
|
14207
|
+
return bytes;
|
|
14208
|
+
}
|
|
14209
|
+
|
|
14210
|
+
encodeBinary_1 = encodeBinary;
|
|
14211
|
+
return encodeBinary_1;
|
|
14212
|
+
}
|
|
14213
|
+
|
|
14214
|
+
var decodeBinary_1;
|
|
14215
|
+
var hasRequiredDecodeBinary;
|
|
14216
|
+
|
|
14217
|
+
function requireDecodeBinary () {
|
|
14218
|
+
if (hasRequiredDecodeBinary) return decodeBinary_1;
|
|
14219
|
+
hasRequiredDecodeBinary = 1;
|
|
14220
|
+
function decodeBinary(u8Arr) {
|
|
14221
|
+
let binaryString = '';
|
|
14222
|
+
for (let i = 0; i < u8Arr.length; i++) {
|
|
14223
|
+
binaryString += String.fromCharCode(u8Arr[i]);
|
|
14224
|
+
}
|
|
14225
|
+
return btoa(binaryString);
|
|
14226
|
+
}
|
|
14227
|
+
|
|
14228
|
+
decodeBinary_1 = decodeBinary;
|
|
14229
|
+
return decodeBinary_1;
|
|
14230
|
+
}
|
|
14231
|
+
|
|
14232
|
+
var quote;
|
|
14233
|
+
var hasRequiredQuote;
|
|
14234
|
+
|
|
14235
|
+
function requireQuote () {
|
|
14236
|
+
if (hasRequiredQuote) return quote;
|
|
14237
|
+
hasRequiredQuote = 1;
|
|
14238
|
+
quote = (name) => `"${name}"`;
|
|
14239
|
+
return quote;
|
|
14240
|
+
}
|
|
14241
|
+
|
|
14242
|
+
var deleteFromSql_1;
|
|
14243
|
+
var hasRequiredDeleteFromSql;
|
|
14244
|
+
|
|
14245
|
+
function requireDeleteFromSql () {
|
|
14246
|
+
if (hasRequiredDeleteFromSql) return deleteFromSql_1;
|
|
14247
|
+
hasRequiredDeleteFromSql = 1;
|
|
14248
|
+
const format = 'delete from %s %s%s';
|
|
14249
|
+
const formatString = requireFormat();
|
|
14250
|
+
const quote = requireQuote();
|
|
14251
|
+
|
|
14252
|
+
function deleteFromSql(table, alias, whereSql) {
|
|
14253
|
+
const name = quote(table._dbName);
|
|
14254
|
+
alias = quote(alias);
|
|
14255
|
+
return formatString(format, name, alias, whereSql);
|
|
14256
|
+
}
|
|
14257
|
+
deleteFromSql_1 = deleteFromSql;
|
|
14258
|
+
return deleteFromSql_1;
|
|
14259
|
+
}
|
|
14260
|
+
|
|
14261
|
+
var selectForUpdateSql;
|
|
14262
|
+
var hasRequiredSelectForUpdateSql;
|
|
14263
|
+
|
|
14264
|
+
function requireSelectForUpdateSql () {
|
|
14265
|
+
if (hasRequiredSelectForUpdateSql) return selectForUpdateSql;
|
|
14266
|
+
hasRequiredSelectForUpdateSql = 1;
|
|
14267
|
+
const quote = requireQuote$2();
|
|
14268
|
+
|
|
14269
|
+
selectForUpdateSql = function(alias) {
|
|
14270
|
+
return ' FOR UPDATE OF ' + quote(alias);
|
|
14144
14271
|
};
|
|
14272
|
+
return selectForUpdateSql;
|
|
14273
|
+
}
|
|
14145
14274
|
|
|
14275
|
+
var limitAndOffset_1;
|
|
14276
|
+
var hasRequiredLimitAndOffset;
|
|
14146
14277
|
|
|
14147
|
-
|
|
14148
|
-
|
|
14149
|
-
|
|
14150
|
-
|
|
14151
|
-
|
|
14278
|
+
function requireLimitAndOffset () {
|
|
14279
|
+
if (hasRequiredLimitAndOffset) return limitAndOffset_1;
|
|
14280
|
+
hasRequiredLimitAndOffset = 1;
|
|
14281
|
+
function limitAndOffset(span) {
|
|
14282
|
+
if (span.offset)
|
|
14283
|
+
return ` limit ${limit()} offset ${span.offset}`;
|
|
14284
|
+
else if (span.limit || span.limit === 0)
|
|
14285
|
+
return ` limit ${span.limit}`;
|
|
14286
|
+
else
|
|
14287
|
+
return '';
|
|
14288
|
+
|
|
14289
|
+
function limit() {
|
|
14290
|
+
if (span.limit || span.limit === 0)
|
|
14291
|
+
return span.limit;
|
|
14292
|
+
else
|
|
14293
|
+
return 'all';
|
|
14294
|
+
}
|
|
14295
|
+
|
|
14296
|
+
}
|
|
14297
|
+
|
|
14298
|
+
limitAndOffset_1 = limitAndOffset;
|
|
14299
|
+
return limitAndOffset_1;
|
|
14300
|
+
}
|
|
14301
|
+
|
|
14302
|
+
var formatDateOut_1;
|
|
14303
|
+
var hasRequiredFormatDateOut;
|
|
14304
|
+
|
|
14305
|
+
function requireFormatDateOut () {
|
|
14306
|
+
if (hasRequiredFormatDateOut) return formatDateOut_1;
|
|
14307
|
+
hasRequiredFormatDateOut = 1;
|
|
14308
|
+
function formatDateOut(column, alias) {
|
|
14309
|
+
return `${alias}."${(column._dbName)}"::text`;
|
|
14310
|
+
}
|
|
14311
|
+
|
|
14312
|
+
formatDateOut_1 = formatDateOut;
|
|
14313
|
+
return formatDateOut_1;
|
|
14314
|
+
}
|
|
14315
|
+
|
|
14316
|
+
var lastInsertedSql_1;
|
|
14317
|
+
var hasRequiredLastInsertedSql;
|
|
14318
|
+
|
|
14319
|
+
function requireLastInsertedSql () {
|
|
14320
|
+
if (hasRequiredLastInsertedSql) return lastInsertedSql_1;
|
|
14321
|
+
hasRequiredLastInsertedSql = 1;
|
|
14322
|
+
const quote = requireQuote();
|
|
14323
|
+
|
|
14324
|
+
function lastInsertedSql(table) {
|
|
14325
|
+
let separator = '';
|
|
14326
|
+
let result = 'RETURNING ';
|
|
14327
|
+
for (let i = 0; i < table._columns.length; i++) {
|
|
14328
|
+
result += separator + quote(table._columns[i]._dbName);
|
|
14329
|
+
separator = ',';
|
|
14330
|
+
}
|
|
14331
|
+
return result;
|
|
14332
|
+
}
|
|
14333
|
+
|
|
14334
|
+
lastInsertedSql_1 = lastInsertedSql;
|
|
14335
|
+
return lastInsertedSql_1;
|
|
14336
|
+
}
|
|
14337
|
+
|
|
14338
|
+
var insertSql_1;
|
|
14339
|
+
var hasRequiredInsertSql;
|
|
14340
|
+
|
|
14341
|
+
function requireInsertSql () {
|
|
14342
|
+
if (hasRequiredInsertSql) return insertSql_1;
|
|
14343
|
+
hasRequiredInsertSql = 1;
|
|
14344
|
+
let lastInsertedSql = requireLastInsertedSql();
|
|
14345
|
+
const quote = requireQuote();
|
|
14346
|
+
|
|
14347
|
+
function insertSql(_context, table, row, options) {
|
|
14348
|
+
let columnNames = [];
|
|
14349
|
+
let conflictColumnUpdateSql = '';
|
|
14350
|
+
let values = [];
|
|
14351
|
+
let sql = 'INSERT INTO ' + quote(table._dbName) + ' ';
|
|
14352
|
+
addDiscriminators();
|
|
14353
|
+
addColumns();
|
|
14354
|
+
if (columnNames.length === 0)
|
|
14355
|
+
sql += `${outputInserted()}DEFAULT VALUES ${lastInsertedSql(table)}`;
|
|
14356
|
+
else
|
|
14357
|
+
sql = sql + '(' + columnNames.join(',') + ') ' + outputInserted() + 'VALUES (' + values.join(',') + ')' + onConflict() + lastInsertedSql(table);
|
|
14358
|
+
return sql;
|
|
14359
|
+
|
|
14360
|
+
function onConflict() {
|
|
14361
|
+
if (options.concurrency === 'skipOnConflict' || options.concurrency === 'overwrite') {
|
|
14362
|
+
const primaryKeys = table._primaryColumns.map(x => quote(x._dbName)).join(',');
|
|
14363
|
+
return ` ON CONFLICT(${primaryKeys}) ${conflictColumnUpdateSql} `;
|
|
14364
|
+
}
|
|
14365
|
+
else return '';
|
|
14366
|
+
}
|
|
14367
|
+
|
|
14368
|
+
function addDiscriminators() {
|
|
14369
|
+
let discriminators = table._columnDiscriminators;
|
|
14370
|
+
for (let i = 0; i < discriminators.length; i++) {
|
|
14371
|
+
let parts = discriminators[i].split('=');
|
|
14372
|
+
columnNames.push(quote(parts[0]));
|
|
14373
|
+
values.push(parts[1]);
|
|
14374
|
+
}
|
|
14375
|
+
}
|
|
14376
|
+
|
|
14377
|
+
function addColumns() {
|
|
14378
|
+
let conflictColumnUpdates = [];
|
|
14379
|
+
let columns = table._columns;
|
|
14380
|
+
for (let i = 0; i < columns.length; i++) {
|
|
14381
|
+
let column = columns[i];
|
|
14382
|
+
const columnName = quote(column._dbName);
|
|
14383
|
+
if (row['__' + column.alias] !== undefined) {
|
|
14384
|
+
columnNames.push(columnName);
|
|
14385
|
+
values.push('%s');
|
|
14386
|
+
addConflictUpdate(column);
|
|
14387
|
+
}
|
|
14388
|
+
}
|
|
14389
|
+
if (conflictColumnUpdates.length === 0)
|
|
14390
|
+
conflictColumnUpdateSql = 'DO NOTHING';
|
|
14391
|
+
else
|
|
14392
|
+
conflictColumnUpdateSql = 'DO UPDATE SET ' + conflictColumnUpdates.join(',');
|
|
14393
|
+
|
|
14394
|
+
function addConflictUpdate(column) {
|
|
14395
|
+
let concurrency = options[column.alias]?.concurrency || options.concurrency;
|
|
14396
|
+
const columnName = quote(column._dbName);
|
|
14397
|
+
const tableName = quote(table._dbName);
|
|
14398
|
+
if (concurrency === 'overwrite')
|
|
14399
|
+
conflictColumnUpdates.push(`${columnName}=EXCLUDED.${columnName}`);
|
|
14400
|
+
else if (concurrency === 'optimistic')
|
|
14401
|
+
conflictColumnUpdates.push(`${columnName} = CASE WHEN ${tableName}.${columnName} <> EXCLUDED.${columnName} THEN CAST(random()::int || '12345678-1234-1234-1234-123456789012Conflict when updating ${columnName}12345678-1234-1234-1234-123456789012' AS INTEGER) ELSE ${tableName}.${columnName} END`);
|
|
14402
|
+
}
|
|
14403
|
+
}
|
|
14404
|
+
|
|
14405
|
+
|
|
14406
|
+
function outputInserted() {
|
|
14407
|
+
return '';
|
|
14408
|
+
}
|
|
14409
|
+
}
|
|
14410
|
+
|
|
14411
|
+
insertSql_1 = insertSql;
|
|
14412
|
+
return insertSql_1;
|
|
14413
|
+
}
|
|
14414
|
+
|
|
14415
|
+
var insert;
|
|
14416
|
+
var hasRequiredInsert;
|
|
14417
|
+
|
|
14418
|
+
function requireInsert () {
|
|
14419
|
+
if (hasRequiredInsert) return insert;
|
|
14420
|
+
hasRequiredInsert = 1;
|
|
14421
|
+
let newInsertCommand = requireNewInsertCommand();
|
|
14422
|
+
let newInsertCommandCore = requireNewInsertCommandCore();
|
|
14423
|
+
let executeQueries = requireExecuteQueries();
|
|
14424
|
+
|
|
14425
|
+
|
|
14426
|
+
function insertDefault(context, table, row, options) {
|
|
14427
|
+
let insertCmd = newInsertCommand(newInsertCommandCore.bind(null, context), table, row, options);
|
|
14428
|
+
insertCmd.disallowCompress = true;
|
|
14429
|
+
|
|
14430
|
+
return executeQueries(context, [insertCmd]).then((result) => result[result.length - 1]);
|
|
14431
|
+
|
|
14432
|
+
}
|
|
14433
|
+
|
|
14434
|
+
insert = insertDefault;
|
|
14435
|
+
return insert;
|
|
14436
|
+
}
|
|
14437
|
+
|
|
14438
|
+
var newTransaction;
|
|
14439
|
+
var hasRequiredNewTransaction;
|
|
14440
|
+
|
|
14441
|
+
function requireNewTransaction () {
|
|
14442
|
+
if (hasRequiredNewTransaction) return newTransaction;
|
|
14443
|
+
hasRequiredNewTransaction = 1;
|
|
14444
|
+
var wrapQuery = requireWrapQuery();
|
|
14445
|
+
var encodeDate = requireEncodeDate();
|
|
14446
|
+
const encodeBinary = requireEncodeBinary();
|
|
14447
|
+
const decodeBinary = requireDecodeBinary();
|
|
14448
|
+
var deleteFromSql = requireDeleteFromSql();
|
|
14449
|
+
var selectForUpdateSql = requireSelectForUpdateSql();
|
|
14450
|
+
var limitAndOffset = requireLimitAndOffset();
|
|
14451
|
+
var formatDateOut = requireFormatDateOut();
|
|
14452
|
+
var insertSql = requireInsertSql();
|
|
14453
|
+
var insert = requireInsert();
|
|
14454
|
+
var quote = requireQuote();
|
|
14455
|
+
|
|
14456
|
+
function newResolveTransaction(domain, pool, { readonly = false } = {}) {
|
|
14457
|
+
var rdb = { poolFactory: pool };
|
|
14458
|
+
if (!pool.connect) {
|
|
14459
|
+
pool = pool();
|
|
14460
|
+
rdb.pool = pool;
|
|
14461
|
+
}
|
|
14462
|
+
|
|
14463
|
+
rdb.engine = 'pg';
|
|
14464
|
+
rdb.encodeDate = encodeDate;
|
|
14465
|
+
rdb.encodeBinary = encodeBinary;
|
|
14466
|
+
rdb.decodeBinary = decodeBinary;
|
|
14467
|
+
rdb.formatDateOut = formatDateOut;
|
|
14468
|
+
rdb.deleteFromSql = deleteFromSql;
|
|
14469
|
+
rdb.selectForUpdateSql = selectForUpdateSql;
|
|
14470
|
+
rdb.lastInsertedIsSeparate = false;
|
|
14471
|
+
rdb.insertSql = insertSql;
|
|
14472
|
+
rdb.insert = insert;
|
|
14473
|
+
rdb.multipleStatements = true;
|
|
14474
|
+
rdb.limitAndOffset = limitAndOffset;
|
|
14475
|
+
rdb.accept = function(caller) {
|
|
14476
|
+
caller.visitPg();
|
|
14477
|
+
};
|
|
14478
|
+
rdb.aggregateCount = 0;
|
|
14479
|
+
rdb.quote = quote;
|
|
14480
|
+
rdb.cache = {};
|
|
14481
|
+
|
|
14482
|
+
if (readonly) {
|
|
14483
|
+
rdb.dbClient = {
|
|
14484
|
+
executeQuery: function(query, callback) {
|
|
14485
|
+
pool.connect((err, client, done) => {
|
|
14486
|
+
if (err) {
|
|
14487
|
+
return callback(err);
|
|
14488
|
+
}
|
|
14489
|
+
try {
|
|
14490
|
+
wrapQuery(domain, client)(query, (err, res) => {
|
|
14491
|
+
done();
|
|
14492
|
+
callback(err, res);
|
|
14493
|
+
});
|
|
14494
|
+
} catch (e) {
|
|
14495
|
+
done();
|
|
14496
|
+
callback(e);
|
|
14497
|
+
}
|
|
14498
|
+
});
|
|
14499
|
+
}
|
|
14500
|
+
};
|
|
14501
|
+
domain.rdb = rdb;
|
|
14502
|
+
return (onSuccess) => onSuccess();
|
|
14503
|
+
}
|
|
14504
|
+
|
|
14505
|
+
return function(onSuccess, onError) {
|
|
14506
|
+
pool.connect(onConnected);
|
|
14507
|
+
|
|
14508
|
+
function onConnected(err, client, done) {
|
|
14509
|
+
try {
|
|
14510
|
+
if (err) {
|
|
14511
|
+
onError(err);
|
|
14512
|
+
return;
|
|
14513
|
+
}
|
|
14514
|
+
client.executeQuery = wrapQuery(domain, client);
|
|
14515
|
+
rdb.dbClient = client;
|
|
14516
|
+
rdb.dbClientDone = done;
|
|
14517
|
+
domain.rdb = rdb;
|
|
14518
|
+
onSuccess();
|
|
14519
|
+
} catch (e) {
|
|
14520
|
+
onError(e);
|
|
14521
|
+
}
|
|
14522
|
+
}
|
|
14523
|
+
};
|
|
14524
|
+
}
|
|
14525
|
+
|
|
14526
|
+
newTransaction = newResolveTransaction;
|
|
14527
|
+
return newTransaction;
|
|
14528
|
+
}
|
|
14529
|
+
|
|
14530
|
+
var end;
|
|
14531
|
+
var hasRequiredEnd;
|
|
14532
|
+
|
|
14533
|
+
function requireEnd () {
|
|
14534
|
+
if (hasRequiredEnd) return end;
|
|
14535
|
+
hasRequiredEnd = 1;
|
|
14536
|
+
var pools = requirePools();
|
|
14537
|
+
|
|
14538
|
+
function endPool(pgPool, id, done) {
|
|
14539
|
+
pgPool.drain(onDrained);
|
|
14540
|
+
|
|
14541
|
+
function onDrained() {
|
|
14542
|
+
//todo await
|
|
14543
|
+
pgPool.destroyAllNow();
|
|
14544
|
+
delete pools[id];
|
|
14545
|
+
done();
|
|
14546
|
+
}
|
|
14547
|
+
}
|
|
14548
|
+
|
|
14549
|
+
end = endPool;
|
|
14550
|
+
return end;
|
|
14551
|
+
}
|
|
14552
|
+
|
|
14553
|
+
/* eslint-disable no-prototype-builtins */
|
|
14554
|
+
|
|
14555
|
+
var newPgPool_1;
|
|
14556
|
+
var hasRequiredNewPgPool;
|
|
14557
|
+
|
|
14558
|
+
function requireNewPgPool () {
|
|
14559
|
+
if (hasRequiredNewPgPool) return newPgPool_1;
|
|
14560
|
+
hasRequiredNewPgPool = 1;
|
|
14561
|
+
// Simplified pool creator using URL API and handling search_path param
|
|
14562
|
+
|
|
14563
|
+
const log = requireLog();
|
|
14564
|
+
const defaults = requirePoolDefaults();
|
|
14565
|
+
const genericPool = requireGenericPool();
|
|
14566
|
+
let PGlite;
|
|
14567
|
+
|
|
14568
|
+
function newPgPool(connectionString, poolOptions = {}) {
|
|
14569
|
+
let { connStr, searchPath } = extractSearchPath(connectionString);
|
|
14570
|
+
|
|
14571
|
+
//@ts-ignore
|
|
14572
|
+
const pool = genericPool.Pool({
|
|
14573
|
+
max: poolOptions.size || poolOptions.poolSize || defaults.poolSize,
|
|
14574
|
+
idleTimeoutMillis: poolOptions.idleTimeout || defaults.poolIdleTimeout,
|
|
14575
|
+
reapIntervalMillis: poolOptions.reapIntervalMillis || defaults.reapIntervalMillis,
|
|
14576
|
+
log: poolOptions.log,
|
|
14577
|
+
|
|
14578
|
+
create: async (cb) => {
|
|
14579
|
+
try {
|
|
14580
|
+
if (!PGlite) ({ PGlite } = await import('@electric-sql/pglite'));
|
|
14581
|
+
const client = connStr === undefined ? new PGlite() : new PGlite(connStr);
|
|
14582
|
+
client.poolCount = 0;
|
|
14583
|
+
await applySearchPath(client, searchPath);
|
|
14584
|
+
cb(null, client);
|
|
14585
|
+
} catch (err) {
|
|
14586
|
+
cb(err, null);
|
|
14587
|
+
}
|
|
14588
|
+
},
|
|
14589
|
+
|
|
14590
|
+
destroy: (client) => {
|
|
14591
|
+
client._destroying = true;
|
|
14592
|
+
client.poolCount = undefined;
|
|
14593
|
+
client.close();
|
|
14594
|
+
},
|
|
14595
|
+
});
|
|
14596
|
+
|
|
14597
|
+
pool.connect = (cb) => {
|
|
14598
|
+
pool.acquire((err, client) => {
|
|
14599
|
+
if (err) return cb(err, null, () => { });
|
|
14600
|
+
client.poolCount++;
|
|
14601
|
+
cb(null, client, (releaseErr) => {
|
|
14602
|
+
releaseErr ? pool.destroy(client) : pool.release(client);
|
|
14603
|
+
});
|
|
14604
|
+
});
|
|
14605
|
+
};
|
|
14606
|
+
|
|
14607
|
+
return pool;
|
|
14608
|
+
}
|
|
14609
|
+
|
|
14610
|
+
async function applySearchPath(client, searchPath) {
|
|
14611
|
+
if (searchPath) {
|
|
14612
|
+
const sql = `SET search_path TO ${searchPath}`;
|
|
14613
|
+
log.emitQuery({ sql, parameters: [] });
|
|
14614
|
+
await client.exec(sql);
|
|
14615
|
+
}
|
|
14616
|
+
}
|
|
14617
|
+
|
|
14618
|
+
function extractSearchPath(connectionString) {
|
|
14619
|
+
let connStr = connectionString;
|
|
14620
|
+
let searchPath;
|
|
14621
|
+
|
|
14622
|
+
// Guard: nothing to do
|
|
14623
|
+
if (typeof connectionString !== 'string' || connectionString.length === 0) {
|
|
14624
|
+
return { connStr, searchPath };
|
|
14625
|
+
}
|
|
14626
|
+
|
|
14627
|
+
// Split on the *first* "?" only
|
|
14628
|
+
const qPos = connectionString.indexOf('?');
|
|
14629
|
+
if (qPos === -1) {
|
|
14630
|
+
// No query-string segment
|
|
14631
|
+
return { connStr, searchPath };
|
|
14632
|
+
}
|
|
14633
|
+
|
|
14634
|
+
const pathPart = connectionString.slice(0, qPos);
|
|
14635
|
+
const qsPart = connectionString.slice(qPos + 1);
|
|
14636
|
+
|
|
14637
|
+
// Robust query-string handling via URLSearchParams
|
|
14638
|
+
const params = new URLSearchParams(qsPart);
|
|
14639
|
+
|
|
14640
|
+
const paramName = 'search_path';
|
|
14641
|
+
|
|
14642
|
+
{
|
|
14643
|
+
searchPath = params.get(paramName);
|
|
14644
|
+
params.delete(paramName);
|
|
14645
|
+
}
|
|
14646
|
+
|
|
14647
|
+
// Re-assemble the cleaned connection string
|
|
14648
|
+
const remainingQs = params.toString();
|
|
14649
|
+
connStr = remainingQs ? `${pathPart}?${remainingQs}` : pathPart;
|
|
14650
|
+
|
|
14651
|
+
return { connStr, searchPath };
|
|
14652
|
+
}
|
|
14653
|
+
|
|
14654
|
+
|
|
14655
|
+
newPgPool_1 = newPgPool;
|
|
14656
|
+
return newPgPool_1;
|
|
14657
|
+
}
|
|
14658
|
+
|
|
14659
|
+
var newPool_1;
|
|
14660
|
+
var hasRequiredNewPool;
|
|
14661
|
+
|
|
14662
|
+
function requireNewPool () {
|
|
14663
|
+
if (hasRequiredNewPool) return newPool_1;
|
|
14664
|
+
hasRequiredNewPool = 1;
|
|
14665
|
+
const promisify = requirePromisify();
|
|
14666
|
+
const pools = requirePools();
|
|
14667
|
+
const end = requireEnd();
|
|
14668
|
+
const newPgPool = requireNewPgPool();
|
|
14669
|
+
const newId = requireNewId();
|
|
14670
|
+
|
|
14671
|
+
function newPool(connectionString, poolOptions) {
|
|
14672
|
+
let pool = newPgPool(connectionString, poolOptions);
|
|
14673
|
+
let id = newId();
|
|
14674
|
+
let boundEnd = end.bind(null, pool, id);
|
|
14675
|
+
let c = {};
|
|
14676
|
+
|
|
14677
|
+
c.connect = pool.connect;
|
|
14678
|
+
c.end = promisify(boundEnd);
|
|
14679
|
+
pools[id] = c;
|
|
14680
|
+
return c;
|
|
14681
|
+
}
|
|
14682
|
+
|
|
14683
|
+
newPool_1 = newPool;
|
|
14684
|
+
return newPool_1;
|
|
14685
|
+
}
|
|
14686
|
+
|
|
14687
|
+
var newDatabase_1;
|
|
14688
|
+
var hasRequiredNewDatabase;
|
|
14689
|
+
|
|
14690
|
+
function requireNewDatabase () {
|
|
14691
|
+
if (hasRequiredNewDatabase) return newDatabase_1;
|
|
14692
|
+
hasRequiredNewDatabase = 1;
|
|
14693
|
+
let createDomain = requireCreateDomain();
|
|
14694
|
+
let newTransaction = requireNewTransaction();
|
|
14695
|
+
let _begin = requireBegin();
|
|
14696
|
+
let commit = requireCommit();
|
|
14697
|
+
let rollback = requireRollback();
|
|
14698
|
+
let newPool = requireNewPool();
|
|
14699
|
+
let lock = requireLock();
|
|
14700
|
+
let executeSchema = requireSchema();
|
|
14701
|
+
let express = requireHostExpress();
|
|
14702
|
+
let hostLocal = requireHostLocal();
|
|
14703
|
+
let doQuery = requireQuery();
|
|
14704
|
+
let releaseDbClient = requireReleaseDbClient();
|
|
14705
|
+
let setSessionSingleton = requireSetSessionSingleton();
|
|
14706
|
+
|
|
14707
|
+
function newDatabase(connectionString, poolOptions) {
|
|
14708
|
+
var pool;
|
|
14709
|
+
if (!poolOptions)
|
|
14710
|
+
pool = newPool.bind(null, connectionString, poolOptions);
|
|
14711
|
+
else
|
|
14712
|
+
pool = newPool(connectionString, poolOptions);
|
|
14713
|
+
|
|
14714
|
+
let c = { poolFactory: pool, hostLocal, express };
|
|
14715
|
+
|
|
14716
|
+
c.transaction = function(options, fn) {
|
|
14717
|
+
if ((arguments.length === 1) && (typeof options === 'function')) {
|
|
14718
|
+
fn = options;
|
|
14719
|
+
options = undefined;
|
|
14720
|
+
}
|
|
14721
|
+
let domain = createDomain();
|
|
14722
|
+
|
|
14723
|
+
if (fn)
|
|
14724
|
+
return domain.run(runInTransaction);
|
|
14725
|
+
else
|
|
14726
|
+
return domain.run(run);
|
|
14727
|
+
|
|
14728
|
+
async function runInTransaction() {
|
|
14729
|
+
let result;
|
|
14730
|
+
let transaction = newTransaction(domain, pool, options);
|
|
14731
|
+
await new Promise(transaction)
|
|
14732
|
+
.then(begin)
|
|
14733
|
+
.then(negotiateSchema)
|
|
14734
|
+
.then(() => fn(domain))
|
|
14735
|
+
.then((res) => result = res)
|
|
14736
|
+
.then(() => commit(domain))
|
|
14737
|
+
.then(null, (e) => rollback(domain,e));
|
|
14738
|
+
return result;
|
|
14739
|
+
}
|
|
14740
|
+
|
|
14741
|
+
function begin() {
|
|
14742
|
+
return _begin(domain, options);
|
|
14743
|
+
}
|
|
14744
|
+
|
|
14745
|
+
function run() {
|
|
14746
|
+
let p;
|
|
14747
|
+
let transaction = newTransaction(domain, pool, options);
|
|
14748
|
+
p = new Promise(transaction);
|
|
14749
|
+
|
|
14750
|
+
return p.then(begin)
|
|
14751
|
+
.then(negotiateSchema);
|
|
14752
|
+
}
|
|
14753
|
+
|
|
14754
|
+
function negotiateSchema(previous) {
|
|
14755
|
+
let schema = options && options.schema;
|
|
14756
|
+
if (!schema)
|
|
14757
|
+
return previous;
|
|
14758
|
+
return executeSchema(domain, schema);
|
|
14759
|
+
}
|
|
14760
|
+
};
|
|
14761
|
+
|
|
14762
|
+
c.createTransaction = function(options) {
|
|
14763
|
+
let domain = createDomain();
|
|
14764
|
+
let transaction = newTransaction(domain, pool, options);
|
|
14765
|
+
let p = domain.run(() => new Promise(transaction)
|
|
14766
|
+
.then(begin).then(negotiateSchema));
|
|
14767
|
+
|
|
14768
|
+
function run(fn) {
|
|
14769
|
+
return p.then(domain.run.bind(domain, fn));
|
|
14770
|
+
}
|
|
14771
|
+
|
|
14772
|
+
function begin() {
|
|
14773
|
+
return _begin(domain, options);
|
|
14774
|
+
}
|
|
14775
|
+
|
|
14776
|
+
function negotiateSchema(previous) {
|
|
14777
|
+
let schema = options && options.schema;
|
|
14778
|
+
if (!schema)
|
|
14779
|
+
return previous;
|
|
14780
|
+
return executeSchema(domain,schema);
|
|
14781
|
+
}
|
|
14782
|
+
|
|
14783
|
+
run.rollback = rollback.bind(null, domain);
|
|
14784
|
+
run.commit = commit.bind(null, domain);
|
|
14785
|
+
|
|
14786
|
+
return run;
|
|
14787
|
+
};
|
|
14788
|
+
|
|
14789
|
+
c.query = function(query) {
|
|
14790
|
+
let domain = createDomain();
|
|
14791
|
+
let transaction = newTransaction(domain, pool);
|
|
14792
|
+
let p = domain.run(() => new Promise(transaction)
|
|
14793
|
+
.then(() => setSessionSingleton(domain, 'changes', []))
|
|
14794
|
+
.then(() => doQuery(domain, query).then(onResult, onError)));
|
|
14795
|
+
return p;
|
|
14796
|
+
|
|
14797
|
+
function onResult(result) {
|
|
14798
|
+
releaseDbClient(domain);
|
|
14799
|
+
return result;
|
|
14800
|
+
}
|
|
14801
|
+
|
|
14802
|
+
function onError(e) {
|
|
14803
|
+
releaseDbClient(domain);
|
|
14804
|
+
throw e;
|
|
14805
|
+
}
|
|
14806
|
+
};
|
|
14807
|
+
|
|
14808
|
+
c.rollback = rollback;
|
|
14809
|
+
c.commit = commit;
|
|
14810
|
+
c.lock = lock;
|
|
14811
|
+
c.schema = executeSchema;
|
|
14812
|
+
|
|
14813
|
+
c.end = function() {
|
|
14814
|
+
if (poolOptions)
|
|
14815
|
+
return pool.end();
|
|
14816
|
+
else
|
|
14817
|
+
return Promise.resolve();
|
|
14818
|
+
};
|
|
14819
|
+
|
|
14820
|
+
c.accept = function(caller) {
|
|
14821
|
+
caller.visitPg();
|
|
14822
|
+
};
|
|
14823
|
+
|
|
14824
|
+
return c;
|
|
14825
|
+
}
|
|
14826
|
+
|
|
14827
|
+
newDatabase_1 = newDatabase;
|
|
14828
|
+
return newDatabase_1;
|
|
14829
|
+
}
|
|
14830
|
+
|
|
14831
|
+
var indexBrowser$1;
|
|
14832
|
+
var hasRequiredIndexBrowser;
|
|
14833
|
+
|
|
14834
|
+
function requireIndexBrowser () {
|
|
14835
|
+
if (hasRequiredIndexBrowser) return indexBrowser$1;
|
|
14836
|
+
hasRequiredIndexBrowser = 1;
|
|
14837
|
+
const hostExpress = requireHostExpress();
|
|
14838
|
+
const hostLocal = requireHostLocal();
|
|
14839
|
+
const client = requireClient();
|
|
14840
|
+
const map = requireMap();
|
|
14841
|
+
let _d1;
|
|
14842
|
+
let _pglite;
|
|
14843
|
+
|
|
14844
|
+
var connectViaPool = function() {
|
|
14845
|
+
return client.apply(null, arguments);
|
|
14846
|
+
};
|
|
14847
|
+
connectViaPool.createPatch = client.createPatch;
|
|
14848
|
+
connectViaPool.table = requireTable();
|
|
14849
|
+
connectViaPool.filter = requireEmptyFilter();
|
|
14850
|
+
connectViaPool.commit = requireCommit();
|
|
14851
|
+
connectViaPool.rollback = requireRollback();
|
|
14852
|
+
connectViaPool.end = requirePools().end;
|
|
14853
|
+
connectViaPool.log = requireLog().registerLogger;
|
|
14854
|
+
connectViaPool.on = requireLog().on;
|
|
14855
|
+
connectViaPool.off = requireLog().off;
|
|
14856
|
+
connectViaPool.query = requireQuery();
|
|
14857
|
+
connectViaPool.lock = requireLock();
|
|
14858
|
+
connectViaPool.schema = requireSchema();
|
|
14859
|
+
connectViaPool.map = map.bind(null, connectViaPool);
|
|
14860
|
+
|
|
14861
|
+
connectViaPool.http = function(url) {
|
|
14862
|
+
return url;
|
|
14863
|
+
};
|
|
14864
|
+
|
|
14865
|
+
|
|
14866
|
+
Object.defineProperty(connectViaPool, 'd1', {
|
|
14867
|
+
get: function() {
|
|
14868
|
+
if (!_d1)
|
|
14869
|
+
_d1 = requireNewDatabase$1();
|
|
14870
|
+
return _d1;
|
|
14871
|
+
}
|
|
14872
|
+
});
|
|
14873
|
+
|
|
14874
|
+
Object.defineProperty(connectViaPool, 'pglite', {
|
|
14875
|
+
get: function() {
|
|
14876
|
+
if (!_pglite)
|
|
14877
|
+
_pglite = requireNewDatabase();
|
|
14878
|
+
return _pglite;
|
|
14152
14879
|
}
|
|
14153
14880
|
});
|
|
14154
14881
|
|
package/package.json
CHANGED
package/src/indexBrowser.js
CHANGED
|
@@ -3,6 +3,7 @@ const hostLocal = require('./hostLocal');
|
|
|
3
3
|
const client = require('./client/index.js');
|
|
4
4
|
const map = require('./client/map');
|
|
5
5
|
let _d1;
|
|
6
|
+
let _pglite;
|
|
6
7
|
|
|
7
8
|
var connectViaPool = function() {
|
|
8
9
|
return client.apply(null, arguments);
|
|
@@ -34,6 +35,14 @@ Object.defineProperty(connectViaPool, 'd1', {
|
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
|
|
38
|
+
Object.defineProperty(connectViaPool, 'pglite', {
|
|
39
|
+
get: function() {
|
|
40
|
+
if (!_pglite)
|
|
41
|
+
_pglite = require('./pglite/newDatabase');
|
|
42
|
+
return _pglite;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
37
46
|
connectViaPool.express = hostExpress.bind(null, hostLocal);
|
|
38
47
|
|
|
39
48
|
module.exports = connectViaPool;
|