orange-orm 4.7.16 → 4.7.17
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 +659 -145
- package/docs/changelog.md +2 -0
- package/package.json +2 -2
- package/src/indexBrowser.js +18 -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$3;
|
|
2089
|
+
var hasRequiredWrapQuery$3;
|
|
2090
2090
|
|
|
2091
|
-
function requireWrapQuery$
|
|
2092
|
-
if (hasRequiredWrapQuery$
|
|
2093
|
-
hasRequiredWrapQuery$
|
|
2091
|
+
function requireWrapQuery$3 () {
|
|
2092
|
+
if (hasRequiredWrapQuery$3) return wrapQuery_1$3;
|
|
2093
|
+
hasRequiredWrapQuery$3 = 1;
|
|
2094
2094
|
var negotiateSql = requireNegotiateSql();
|
|
2095
2095
|
var negotiateParameters = requireNegotiateParameters();
|
|
2096
2096
|
|
|
@@ -2107,8 +2107,8 @@ function requireWrapQuery$2 () {
|
|
|
2107
2107
|
}
|
|
2108
2108
|
|
|
2109
2109
|
|
|
2110
|
-
wrapQuery_1$
|
|
2111
|
-
return wrapQuery_1$
|
|
2110
|
+
wrapQuery_1$3 = wrapQuery;
|
|
2111
|
+
return wrapQuery_1$3;
|
|
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$3();
|
|
2122
2122
|
|
|
2123
2123
|
function doQuery(context, query) {
|
|
2124
2124
|
var wrappedQuery = wrapQuery(query);
|
|
@@ -12617,12 +12617,12 @@ function requireCreateDomain () {
|
|
|
12617
12617
|
return createDomain_1;
|
|
12618
12618
|
}
|
|
12619
12619
|
|
|
12620
|
-
var wrapQuery_1$
|
|
12621
|
-
var hasRequiredWrapQuery$
|
|
12620
|
+
var wrapQuery_1$2;
|
|
12621
|
+
var hasRequiredWrapQuery$2;
|
|
12622
12622
|
|
|
12623
|
-
function requireWrapQuery$
|
|
12624
|
-
if (hasRequiredWrapQuery$
|
|
12625
|
-
hasRequiredWrapQuery$
|
|
12623
|
+
function requireWrapQuery$2 () {
|
|
12624
|
+
if (hasRequiredWrapQuery$2) return wrapQuery_1$2;
|
|
12625
|
+
hasRequiredWrapQuery$2 = 1;
|
|
12626
12626
|
var log = requireLog();
|
|
12627
12627
|
|
|
12628
12628
|
function wrapQuery(_context, client) {
|
|
@@ -12644,24 +12644,24 @@ function requireWrapQuery$1 () {
|
|
|
12644
12644
|
|
|
12645
12645
|
}
|
|
12646
12646
|
|
|
12647
|
-
wrapQuery_1$
|
|
12648
|
-
return wrapQuery_1$
|
|
12647
|
+
wrapQuery_1$2 = wrapQuery;
|
|
12648
|
+
return wrapQuery_1$2;
|
|
12649
12649
|
}
|
|
12650
12650
|
|
|
12651
|
-
var encodeBoolean_1;
|
|
12652
|
-
var hasRequiredEncodeBoolean;
|
|
12651
|
+
var encodeBoolean_1$1;
|
|
12652
|
+
var hasRequiredEncodeBoolean$1;
|
|
12653
12653
|
|
|
12654
|
-
function requireEncodeBoolean () {
|
|
12655
|
-
if (hasRequiredEncodeBoolean) return encodeBoolean_1;
|
|
12656
|
-
hasRequiredEncodeBoolean = 1;
|
|
12654
|
+
function requireEncodeBoolean$1 () {
|
|
12655
|
+
if (hasRequiredEncodeBoolean$1) return encodeBoolean_1$1;
|
|
12656
|
+
hasRequiredEncodeBoolean$1 = 1;
|
|
12657
12657
|
function encodeBoolean(bool) {
|
|
12658
12658
|
if (bool)
|
|
12659
12659
|
return 1;
|
|
12660
12660
|
return 0;
|
|
12661
12661
|
}
|
|
12662
12662
|
|
|
12663
|
-
encodeBoolean_1 = encodeBoolean;
|
|
12664
|
-
return encodeBoolean_1;
|
|
12663
|
+
encodeBoolean_1$1 = encodeBoolean;
|
|
12664
|
+
return encodeBoolean_1$1;
|
|
12665
12665
|
}
|
|
12666
12666
|
|
|
12667
12667
|
var quote$1;
|
|
@@ -13199,14 +13199,14 @@ function requireInsert$1 () {
|
|
|
13199
13199
|
return insert$1;
|
|
13200
13200
|
}
|
|
13201
13201
|
|
|
13202
|
-
var newTransaction$
|
|
13203
|
-
var hasRequiredNewTransaction$
|
|
13202
|
+
var newTransaction$2;
|
|
13203
|
+
var hasRequiredNewTransaction$2;
|
|
13204
13204
|
|
|
13205
|
-
function requireNewTransaction$
|
|
13206
|
-
if (hasRequiredNewTransaction$
|
|
13207
|
-
hasRequiredNewTransaction$
|
|
13208
|
-
const wrapQuery = requireWrapQuery$
|
|
13209
|
-
const encodeBoolean = requireEncodeBoolean();
|
|
13205
|
+
function requireNewTransaction$2 () {
|
|
13206
|
+
if (hasRequiredNewTransaction$2) return newTransaction$2;
|
|
13207
|
+
hasRequiredNewTransaction$2 = 1;
|
|
13208
|
+
const wrapQuery = requireWrapQuery$2();
|
|
13209
|
+
const encodeBoolean = requireEncodeBoolean$1();
|
|
13210
13210
|
const formatBigintOut = requireFormatBigintOut();
|
|
13211
13211
|
const deleteFromSql = requireDeleteFromSql$1();
|
|
13212
13212
|
const selectForUpdateSql = requireSelectForUpdateSql$1();
|
|
@@ -13290,8 +13290,8 @@ function requireNewTransaction$1 () {
|
|
|
13290
13290
|
return JSON.parse(value);
|
|
13291
13291
|
}
|
|
13292
13292
|
|
|
13293
|
-
newTransaction$
|
|
13294
|
-
return newTransaction$
|
|
13293
|
+
newTransaction$2 = newResolveTransaction;
|
|
13294
|
+
return newTransaction$2;
|
|
13295
13295
|
}
|
|
13296
13296
|
|
|
13297
13297
|
var beginCommand;
|
|
@@ -13372,12 +13372,12 @@ function requirePromisify () {
|
|
|
13372
13372
|
return promisify_1;
|
|
13373
13373
|
}
|
|
13374
13374
|
|
|
13375
|
-
var end$
|
|
13376
|
-
var hasRequiredEnd$
|
|
13375
|
+
var end$2;
|
|
13376
|
+
var hasRequiredEnd$2;
|
|
13377
13377
|
|
|
13378
|
-
function requireEnd$
|
|
13379
|
-
if (hasRequiredEnd$
|
|
13380
|
-
hasRequiredEnd$
|
|
13378
|
+
function requireEnd$2 () {
|
|
13379
|
+
if (hasRequiredEnd$2) return end$2;
|
|
13380
|
+
hasRequiredEnd$2 = 1;
|
|
13381
13381
|
var pools = requirePools();
|
|
13382
13382
|
|
|
13383
13383
|
function endPool(genericPool, id, done) {
|
|
@@ -13390,8 +13390,8 @@ function requireEnd$1 () {
|
|
|
13390
13390
|
}
|
|
13391
13391
|
}
|
|
13392
13392
|
|
|
13393
|
-
end$
|
|
13394
|
-
return end$
|
|
13393
|
+
end$2 = endPool;
|
|
13394
|
+
return end$2;
|
|
13395
13395
|
}
|
|
13396
13396
|
|
|
13397
13397
|
var poolDefaults;
|
|
@@ -14080,15 +14080,15 @@ function requireNewGenericPool () {
|
|
|
14080
14080
|
return newGenericPool_1;
|
|
14081
14081
|
}
|
|
14082
14082
|
|
|
14083
|
-
var newPool_1$
|
|
14084
|
-
var hasRequiredNewPool$
|
|
14083
|
+
var newPool_1$2;
|
|
14084
|
+
var hasRequiredNewPool$2;
|
|
14085
14085
|
|
|
14086
|
-
function requireNewPool$
|
|
14087
|
-
if (hasRequiredNewPool$
|
|
14088
|
-
hasRequiredNewPool$
|
|
14086
|
+
function requireNewPool$2 () {
|
|
14087
|
+
if (hasRequiredNewPool$2) return newPool_1$2;
|
|
14088
|
+
hasRequiredNewPool$2 = 1;
|
|
14089
14089
|
const promisify = requirePromisify();
|
|
14090
14090
|
const pools = requirePools();
|
|
14091
|
-
const end = requireEnd$
|
|
14091
|
+
const end = requireEnd$2();
|
|
14092
14092
|
const newGenericPool = requireNewGenericPool();
|
|
14093
14093
|
const newId = requireNewId();
|
|
14094
14094
|
|
|
@@ -14104,22 +14104,22 @@ function requireNewPool$1 () {
|
|
|
14104
14104
|
return c;
|
|
14105
14105
|
}
|
|
14106
14106
|
|
|
14107
|
-
newPool_1$
|
|
14108
|
-
return newPool_1$
|
|
14107
|
+
newPool_1$2 = newPool;
|
|
14108
|
+
return newPool_1$2;
|
|
14109
14109
|
}
|
|
14110
14110
|
|
|
14111
|
-
var newDatabase_1$
|
|
14112
|
-
var hasRequiredNewDatabase$
|
|
14111
|
+
var newDatabase_1$2;
|
|
14112
|
+
var hasRequiredNewDatabase$2;
|
|
14113
14113
|
|
|
14114
|
-
function requireNewDatabase$
|
|
14115
|
-
if (hasRequiredNewDatabase$
|
|
14116
|
-
hasRequiredNewDatabase$
|
|
14114
|
+
function requireNewDatabase$2 () {
|
|
14115
|
+
if (hasRequiredNewDatabase$2) return newDatabase_1$2;
|
|
14116
|
+
hasRequiredNewDatabase$2 = 1;
|
|
14117
14117
|
let createDomain = requireCreateDomain();
|
|
14118
|
-
let newTransaction = requireNewTransaction$
|
|
14118
|
+
let newTransaction = requireNewTransaction$2();
|
|
14119
14119
|
let _begin = requireBegin();
|
|
14120
14120
|
let commit = requireCommit();
|
|
14121
14121
|
let rollback = requireRollback();
|
|
14122
|
-
let newPool = requireNewPool$
|
|
14122
|
+
let newPool = requireNewPool$2();
|
|
14123
14123
|
let express = requireHostExpress();
|
|
14124
14124
|
let hostLocal = requireHostLocal();
|
|
14125
14125
|
let doQuery = requireQuery();
|
|
@@ -14229,8 +14229,8 @@ function requireNewDatabase$1 () {
|
|
|
14229
14229
|
return c;
|
|
14230
14230
|
}
|
|
14231
14231
|
|
|
14232
|
-
newDatabase_1$
|
|
14233
|
-
return newDatabase_1$
|
|
14232
|
+
newDatabase_1$2 = newDatabase;
|
|
14233
|
+
return newDatabase_1$2;
|
|
14234
14234
|
}
|
|
14235
14235
|
|
|
14236
14236
|
var replaceParamChar_1;
|
|
@@ -14256,12 +14256,12 @@ function requireReplaceParamChar () {
|
|
|
14256
14256
|
return replaceParamChar_1;
|
|
14257
14257
|
}
|
|
14258
14258
|
|
|
14259
|
-
var wrapQuery_1;
|
|
14260
|
-
var hasRequiredWrapQuery;
|
|
14259
|
+
var wrapQuery_1$1;
|
|
14260
|
+
var hasRequiredWrapQuery$1;
|
|
14261
14261
|
|
|
14262
|
-
function requireWrapQuery () {
|
|
14263
|
-
if (hasRequiredWrapQuery) return wrapQuery_1;
|
|
14264
|
-
hasRequiredWrapQuery = 1;
|
|
14262
|
+
function requireWrapQuery$1 () {
|
|
14263
|
+
if (hasRequiredWrapQuery$1) return wrapQuery_1$1;
|
|
14264
|
+
hasRequiredWrapQuery$1 = 1;
|
|
14265
14265
|
var log = requireLog();
|
|
14266
14266
|
var replaceParamChar = requireReplaceParamChar();
|
|
14267
14267
|
|
|
@@ -14288,8 +14288,8 @@ function requireWrapQuery () {
|
|
|
14288
14288
|
|
|
14289
14289
|
}
|
|
14290
14290
|
|
|
14291
|
-
wrapQuery_1 = wrapQuery;
|
|
14292
|
-
return wrapQuery_1;
|
|
14291
|
+
wrapQuery_1$1 = wrapQuery;
|
|
14292
|
+
return wrapQuery_1$1;
|
|
14293
14293
|
}
|
|
14294
14294
|
|
|
14295
14295
|
var encodeDate_1;
|
|
@@ -14561,13 +14561,13 @@ function requireInsert () {
|
|
|
14561
14561
|
return insert;
|
|
14562
14562
|
}
|
|
14563
14563
|
|
|
14564
|
-
var newTransaction;
|
|
14565
|
-
var hasRequiredNewTransaction;
|
|
14564
|
+
var newTransaction$1;
|
|
14565
|
+
var hasRequiredNewTransaction$1;
|
|
14566
14566
|
|
|
14567
|
-
function requireNewTransaction () {
|
|
14568
|
-
if (hasRequiredNewTransaction) return newTransaction;
|
|
14569
|
-
hasRequiredNewTransaction = 1;
|
|
14570
|
-
var wrapQuery = requireWrapQuery();
|
|
14567
|
+
function requireNewTransaction$1 () {
|
|
14568
|
+
if (hasRequiredNewTransaction$1) return newTransaction$1;
|
|
14569
|
+
hasRequiredNewTransaction$1 = 1;
|
|
14570
|
+
var wrapQuery = requireWrapQuery$1();
|
|
14571
14571
|
var encodeDate = requireEncodeDate();
|
|
14572
14572
|
const encodeBinary = requireEncodeBinary();
|
|
14573
14573
|
const decodeBinary = requireDecodeBinary();
|
|
@@ -14647,16 +14647,16 @@ function requireNewTransaction () {
|
|
|
14647
14647
|
};
|
|
14648
14648
|
}
|
|
14649
14649
|
|
|
14650
|
-
newTransaction = newResolveTransaction;
|
|
14651
|
-
return newTransaction;
|
|
14650
|
+
newTransaction$1 = newResolveTransaction;
|
|
14651
|
+
return newTransaction$1;
|
|
14652
14652
|
}
|
|
14653
14653
|
|
|
14654
|
-
var end;
|
|
14655
|
-
var hasRequiredEnd;
|
|
14654
|
+
var end$1;
|
|
14655
|
+
var hasRequiredEnd$1;
|
|
14656
14656
|
|
|
14657
|
-
function requireEnd () {
|
|
14658
|
-
if (hasRequiredEnd) return end;
|
|
14659
|
-
hasRequiredEnd = 1;
|
|
14657
|
+
function requireEnd$1 () {
|
|
14658
|
+
if (hasRequiredEnd$1) return end$1;
|
|
14659
|
+
hasRequiredEnd$1 = 1;
|
|
14660
14660
|
var pools = requirePools();
|
|
14661
14661
|
|
|
14662
14662
|
function endPool(pgPool, id, done) {
|
|
@@ -14670,18 +14670,18 @@ function requireEnd () {
|
|
|
14670
14670
|
}
|
|
14671
14671
|
}
|
|
14672
14672
|
|
|
14673
|
-
end = endPool;
|
|
14674
|
-
return end;
|
|
14673
|
+
end$1 = endPool;
|
|
14674
|
+
return end$1;
|
|
14675
14675
|
}
|
|
14676
14676
|
|
|
14677
14677
|
/* eslint-disable no-prototype-builtins */
|
|
14678
14678
|
|
|
14679
|
-
var newPgPool_1;
|
|
14680
|
-
var hasRequiredNewPgPool;
|
|
14679
|
+
var newPgPool_1$1;
|
|
14680
|
+
var hasRequiredNewPgPool$1;
|
|
14681
14681
|
|
|
14682
|
-
function requireNewPgPool () {
|
|
14683
|
-
if (hasRequiredNewPgPool) return newPgPool_1;
|
|
14684
|
-
hasRequiredNewPgPool = 1;
|
|
14682
|
+
function requireNewPgPool$1 () {
|
|
14683
|
+
if (hasRequiredNewPgPool$1) return newPgPool_1$1;
|
|
14684
|
+
hasRequiredNewPgPool$1 = 1;
|
|
14685
14685
|
// Simplified pool creator using URL API and handling search_path param
|
|
14686
14686
|
|
|
14687
14687
|
const log = requireLog();
|
|
@@ -14777,20 +14777,20 @@ function requireNewPgPool () {
|
|
|
14777
14777
|
}
|
|
14778
14778
|
|
|
14779
14779
|
|
|
14780
|
-
newPgPool_1 = newPgPool;
|
|
14781
|
-
return newPgPool_1;
|
|
14780
|
+
newPgPool_1$1 = newPgPool;
|
|
14781
|
+
return newPgPool_1$1;
|
|
14782
14782
|
}
|
|
14783
14783
|
|
|
14784
|
-
var newPool_1;
|
|
14785
|
-
var hasRequiredNewPool;
|
|
14784
|
+
var newPool_1$1;
|
|
14785
|
+
var hasRequiredNewPool$1;
|
|
14786
14786
|
|
|
14787
|
-
function requireNewPool () {
|
|
14788
|
-
if (hasRequiredNewPool) return newPool_1;
|
|
14789
|
-
hasRequiredNewPool = 1;
|
|
14787
|
+
function requireNewPool$1 () {
|
|
14788
|
+
if (hasRequiredNewPool$1) return newPool_1$1;
|
|
14789
|
+
hasRequiredNewPool$1 = 1;
|
|
14790
14790
|
const promisify = requirePromisify();
|
|
14791
14791
|
const pools = requirePools();
|
|
14792
|
-
const end = requireEnd();
|
|
14793
|
-
const newPgPool = requireNewPgPool();
|
|
14792
|
+
const end = requireEnd$1();
|
|
14793
|
+
const newPgPool = requireNewPgPool$1();
|
|
14794
14794
|
const newId = requireNewId();
|
|
14795
14795
|
|
|
14796
14796
|
function newPool(connectionString, poolOptions) {
|
|
@@ -14805,22 +14805,22 @@ function requireNewPool () {
|
|
|
14805
14805
|
return c;
|
|
14806
14806
|
}
|
|
14807
14807
|
|
|
14808
|
-
newPool_1 = newPool;
|
|
14809
|
-
return newPool_1;
|
|
14808
|
+
newPool_1$1 = newPool;
|
|
14809
|
+
return newPool_1$1;
|
|
14810
14810
|
}
|
|
14811
14811
|
|
|
14812
|
-
var newDatabase_1;
|
|
14813
|
-
var hasRequiredNewDatabase;
|
|
14812
|
+
var newDatabase_1$1;
|
|
14813
|
+
var hasRequiredNewDatabase$1;
|
|
14814
14814
|
|
|
14815
|
-
function requireNewDatabase () {
|
|
14816
|
-
if (hasRequiredNewDatabase) return newDatabase_1;
|
|
14817
|
-
hasRequiredNewDatabase = 1;
|
|
14815
|
+
function requireNewDatabase$1 () {
|
|
14816
|
+
if (hasRequiredNewDatabase$1) return newDatabase_1$1;
|
|
14817
|
+
hasRequiredNewDatabase$1 = 1;
|
|
14818
14818
|
let createDomain = requireCreateDomain();
|
|
14819
|
-
let newTransaction = requireNewTransaction();
|
|
14819
|
+
let newTransaction = requireNewTransaction$1();
|
|
14820
14820
|
let _begin = requireBegin();
|
|
14821
14821
|
let commit = requireCommit();
|
|
14822
14822
|
let rollback = requireRollback();
|
|
14823
|
-
let newPool = requireNewPool();
|
|
14823
|
+
let newPool = requireNewPool$1();
|
|
14824
14824
|
let lock = requireLock();
|
|
14825
14825
|
let executeSchema = requireSchema();
|
|
14826
14826
|
let express = requireHostExpress();
|
|
@@ -14946,61 +14946,575 @@ function requireNewDatabase () {
|
|
|
14946
14946
|
return c;
|
|
14947
14947
|
}
|
|
14948
14948
|
|
|
14949
|
-
newDatabase_1 = newDatabase;
|
|
14950
|
-
return newDatabase_1;
|
|
14949
|
+
newDatabase_1$1 = newDatabase;
|
|
14950
|
+
return newDatabase_1$1;
|
|
14951
14951
|
}
|
|
14952
14952
|
|
|
14953
|
-
var
|
|
14954
|
-
var
|
|
14953
|
+
var wrapQuery_1;
|
|
14954
|
+
var hasRequiredWrapQuery;
|
|
14955
14955
|
|
|
14956
|
-
function
|
|
14957
|
-
if (
|
|
14958
|
-
|
|
14959
|
-
|
|
14960
|
-
|
|
14961
|
-
const client = requireClient();
|
|
14962
|
-
const map = requireMap();
|
|
14963
|
-
let _d1;
|
|
14964
|
-
let _pglite;
|
|
14956
|
+
function requireWrapQuery () {
|
|
14957
|
+
if (hasRequiredWrapQuery) return wrapQuery_1;
|
|
14958
|
+
hasRequiredWrapQuery = 1;
|
|
14959
|
+
var log = requireLog();
|
|
14960
|
+
var replaceParamChar = requireReplaceParamChar();
|
|
14965
14961
|
|
|
14966
|
-
|
|
14967
|
-
|
|
14968
|
-
|
|
14969
|
-
connectViaPool.createPatch = client.createPatch;
|
|
14970
|
-
connectViaPool.table = requireTable();
|
|
14971
|
-
connectViaPool.filter = requireEmptyFilter();
|
|
14972
|
-
connectViaPool.commit = requireCommit();
|
|
14973
|
-
connectViaPool.rollback = requireRollback();
|
|
14974
|
-
connectViaPool.end = requirePools().end;
|
|
14975
|
-
connectViaPool.close = connectViaPool.end;
|
|
14976
|
-
connectViaPool.log = requireLog().registerLogger;
|
|
14977
|
-
connectViaPool.on = requireLog().on;
|
|
14978
|
-
connectViaPool.off = requireLog().off;
|
|
14979
|
-
connectViaPool.query = requireQuery();
|
|
14980
|
-
connectViaPool.lock = requireLock();
|
|
14981
|
-
connectViaPool.schema = requireSchema();
|
|
14982
|
-
connectViaPool.map = map.bind(null, connectViaPool);
|
|
14962
|
+
function wrapQuery(_context, connection) {
|
|
14963
|
+
var runOriginalQuery = connection.query;
|
|
14964
|
+
return runQuery;
|
|
14983
14965
|
|
|
14984
|
-
|
|
14985
|
-
|
|
14986
|
-
|
|
14966
|
+
function runQuery(query, onCompleted) {
|
|
14967
|
+
var params = query.parameters;
|
|
14968
|
+
log.emitQuery({sql: query.sql(), parameters: params});
|
|
14969
|
+
var sql = replaceParamChar(query, params);
|
|
14970
|
+
query = {
|
|
14971
|
+
text: sql,
|
|
14972
|
+
values: params,
|
|
14973
|
+
types: query.types
|
|
14974
|
+
};
|
|
14987
14975
|
|
|
14976
|
+
runOriginalQuery.call(connection, query, onInnerCompleted);
|
|
14988
14977
|
|
|
14989
|
-
|
|
14990
|
-
|
|
14991
|
-
|
|
14992
|
-
|
|
14993
|
-
|
|
14978
|
+
function onInnerCompleted(err, result) {
|
|
14979
|
+
if (err)
|
|
14980
|
+
onCompleted(err);
|
|
14981
|
+
else {
|
|
14982
|
+
if (Array.isArray(result))
|
|
14983
|
+
result = result[result.length-1];
|
|
14984
|
+
onCompleted(null, result.rows);
|
|
14985
|
+
}
|
|
14986
|
+
}
|
|
14994
14987
|
}
|
|
14995
|
-
});
|
|
14996
14988
|
|
|
14997
|
-
|
|
14998
|
-
|
|
14999
|
-
|
|
15000
|
-
|
|
15001
|
-
|
|
14989
|
+
}
|
|
14990
|
+
|
|
14991
|
+
wrapQuery_1 = wrapQuery;
|
|
14992
|
+
return wrapQuery_1;
|
|
14993
|
+
}
|
|
14994
|
+
|
|
14995
|
+
var encodeBoolean_1;
|
|
14996
|
+
var hasRequiredEncodeBoolean;
|
|
14997
|
+
|
|
14998
|
+
function requireEncodeBoolean () {
|
|
14999
|
+
if (hasRequiredEncodeBoolean) return encodeBoolean_1;
|
|
15000
|
+
hasRequiredEncodeBoolean = 1;
|
|
15001
|
+
function encodeBoolean(bool) {
|
|
15002
|
+
return bool.toString();
|
|
15003
|
+
}
|
|
15004
|
+
|
|
15005
|
+
encodeBoolean_1 = encodeBoolean;
|
|
15006
|
+
return encodeBoolean_1;
|
|
15007
|
+
}
|
|
15008
|
+
|
|
15009
|
+
var encodeJSON;
|
|
15010
|
+
var hasRequiredEncodeJSON;
|
|
15011
|
+
|
|
15012
|
+
function requireEncodeJSON () {
|
|
15013
|
+
if (hasRequiredEncodeJSON) return encodeJSON;
|
|
15014
|
+
hasRequiredEncodeJSON = 1;
|
|
15015
|
+
function encode(arg) {
|
|
15016
|
+
if (Array.isArray(arg))
|
|
15017
|
+
return new JsonBArrayParam(arg);
|
|
15018
|
+
else
|
|
15019
|
+
return arg;
|
|
15020
|
+
}
|
|
15021
|
+
|
|
15022
|
+
class JsonBArrayParam {
|
|
15023
|
+
constructor(actualArray) { this.actualArray = actualArray; }
|
|
15024
|
+
toPostgres() {
|
|
15025
|
+
return JSON.stringify(this.actualArray);
|
|
15002
15026
|
}
|
|
15003
|
-
}
|
|
15027
|
+
}
|
|
15028
|
+
|
|
15029
|
+
encodeJSON = encode;
|
|
15030
|
+
return encodeJSON;
|
|
15031
|
+
}
|
|
15032
|
+
|
|
15033
|
+
var newTransaction;
|
|
15034
|
+
var hasRequiredNewTransaction;
|
|
15035
|
+
|
|
15036
|
+
function requireNewTransaction () {
|
|
15037
|
+
if (hasRequiredNewTransaction) return newTransaction;
|
|
15038
|
+
hasRequiredNewTransaction = 1;
|
|
15039
|
+
var wrapQuery = requireWrapQuery();
|
|
15040
|
+
var encodeDate = requireEncodeDate();
|
|
15041
|
+
var encodeBoolean = requireEncodeBoolean();
|
|
15042
|
+
var deleteFromSql = requireDeleteFromSql();
|
|
15043
|
+
var selectForUpdateSql = requireSelectForUpdateSql();
|
|
15044
|
+
var limitAndOffset = requireLimitAndOffset();
|
|
15045
|
+
var formatDateOut = requireFormatDateOut();
|
|
15046
|
+
var encodeJSON = requireEncodeJSON();
|
|
15047
|
+
var insertSql = requireInsertSql();
|
|
15048
|
+
var insert = requireInsert();
|
|
15049
|
+
var quote = requireQuote();
|
|
15050
|
+
|
|
15051
|
+
function newResolveTransaction(domain, pool, { readonly = false } = {}) {
|
|
15052
|
+
var rdb = { poolFactory: pool };
|
|
15053
|
+
if (!pool.connect) {
|
|
15054
|
+
pool = pool();
|
|
15055
|
+
rdb.pool = pool;
|
|
15056
|
+
}
|
|
15057
|
+
|
|
15058
|
+
rdb.engine = 'pg';
|
|
15059
|
+
rdb.encodeBoolean = encodeBoolean;
|
|
15060
|
+
rdb.encodeDate = encodeDate;
|
|
15061
|
+
rdb.encodeJSON = encodeJSON;
|
|
15062
|
+
rdb.formatDateOut = formatDateOut;
|
|
15063
|
+
rdb.deleteFromSql = deleteFromSql;
|
|
15064
|
+
rdb.selectForUpdateSql = selectForUpdateSql;
|
|
15065
|
+
rdb.lastInsertedIsSeparate = false;
|
|
15066
|
+
rdb.insertSql = insertSql;
|
|
15067
|
+
rdb.insert = insert;
|
|
15068
|
+
rdb.multipleStatements = true;
|
|
15069
|
+
rdb.limitAndOffset = limitAndOffset;
|
|
15070
|
+
rdb.accept = function(caller) {
|
|
15071
|
+
caller.visitPg();
|
|
15072
|
+
};
|
|
15073
|
+
rdb.aggregateCount = 0;
|
|
15074
|
+
rdb.quote = quote;
|
|
15075
|
+
rdb.cache = {};
|
|
15076
|
+
|
|
15077
|
+
if (readonly) {
|
|
15078
|
+
rdb.dbClient = {
|
|
15079
|
+
executeQuery: function(query, callback) {
|
|
15080
|
+
pool.connect((err, client, done) => {
|
|
15081
|
+
if (err) {
|
|
15082
|
+
return callback(err);
|
|
15083
|
+
}
|
|
15084
|
+
try {
|
|
15085
|
+
wrapQuery(domain, client)(query, (err, res) => {
|
|
15086
|
+
done();
|
|
15087
|
+
callback(err, res);
|
|
15088
|
+
});
|
|
15089
|
+
} catch (e) {
|
|
15090
|
+
done();
|
|
15091
|
+
callback(e);
|
|
15092
|
+
}
|
|
15093
|
+
});
|
|
15094
|
+
}
|
|
15095
|
+
};
|
|
15096
|
+
domain.rdb = rdb;
|
|
15097
|
+
return (onSuccess) => onSuccess();
|
|
15098
|
+
}
|
|
15099
|
+
|
|
15100
|
+
return function(onSuccess, onError) {
|
|
15101
|
+
pool.connect(onConnected);
|
|
15102
|
+
|
|
15103
|
+
function onConnected(err, client, done) {
|
|
15104
|
+
try {
|
|
15105
|
+
if (err) {
|
|
15106
|
+
onError(err);
|
|
15107
|
+
return;
|
|
15108
|
+
}
|
|
15109
|
+
client.executeQuery = wrapQuery(domain, client);
|
|
15110
|
+
rdb.dbClient = client;
|
|
15111
|
+
rdb.dbClientDone = done;
|
|
15112
|
+
domain.rdb = rdb;
|
|
15113
|
+
onSuccess();
|
|
15114
|
+
} catch (e) {
|
|
15115
|
+
onError(e);
|
|
15116
|
+
}
|
|
15117
|
+
}
|
|
15118
|
+
};
|
|
15119
|
+
}
|
|
15120
|
+
|
|
15121
|
+
newTransaction = newResolveTransaction;
|
|
15122
|
+
return newTransaction;
|
|
15123
|
+
}
|
|
15124
|
+
|
|
15125
|
+
var end;
|
|
15126
|
+
var hasRequiredEnd;
|
|
15127
|
+
|
|
15128
|
+
function requireEnd () {
|
|
15129
|
+
if (hasRequiredEnd) return end;
|
|
15130
|
+
hasRequiredEnd = 1;
|
|
15131
|
+
var pools = requirePools();
|
|
15132
|
+
|
|
15133
|
+
function endPool(pgPool, id, done) {
|
|
15134
|
+
pgPool.drain(onDrained);
|
|
15135
|
+
|
|
15136
|
+
function onDrained() {
|
|
15137
|
+
pgPool.destroyAllNow();
|
|
15138
|
+
delete pools[id];
|
|
15139
|
+
done();
|
|
15140
|
+
}
|
|
15141
|
+
}
|
|
15142
|
+
|
|
15143
|
+
end = endPool;
|
|
15144
|
+
return end;
|
|
15145
|
+
}
|
|
15146
|
+
|
|
15147
|
+
var parseSearchPathParam_1;
|
|
15148
|
+
var hasRequiredParseSearchPathParam;
|
|
15149
|
+
|
|
15150
|
+
function requireParseSearchPathParam () {
|
|
15151
|
+
if (hasRequiredParseSearchPathParam) return parseSearchPathParam_1;
|
|
15152
|
+
hasRequiredParseSearchPathParam = 1;
|
|
15153
|
+
function parseSearchPathParam(connectionString = '') {
|
|
15154
|
+
const [, queryString] = connectionString.split('?');
|
|
15155
|
+
if (!queryString)
|
|
15156
|
+
return;
|
|
15157
|
+
const params = new URLSearchParams(queryString);
|
|
15158
|
+
const searchPath = params.get('search_path');
|
|
15159
|
+
return searchPath;
|
|
15160
|
+
}
|
|
15161
|
+
|
|
15162
|
+
parseSearchPathParam_1 = parseSearchPathParam;
|
|
15163
|
+
return parseSearchPathParam_1;
|
|
15164
|
+
}
|
|
15165
|
+
|
|
15166
|
+
/* eslint-disable no-prototype-builtins */
|
|
15167
|
+
|
|
15168
|
+
var newPgPool_1;
|
|
15169
|
+
var hasRequiredNewPgPool;
|
|
15170
|
+
|
|
15171
|
+
function requireNewPgPool () {
|
|
15172
|
+
if (hasRequiredNewPgPool) return newPgPool_1;
|
|
15173
|
+
hasRequiredNewPgPool = 1;
|
|
15174
|
+
//slightly modified code from github.com/brianc/node-postgres
|
|
15175
|
+
var log = requireLog();
|
|
15176
|
+
|
|
15177
|
+
var defaults = requirePoolDefaults();
|
|
15178
|
+
var genericPool = requireGenericPool();
|
|
15179
|
+
var pg;
|
|
15180
|
+
var parseSearchPathParam = requireParseSearchPathParam();
|
|
15181
|
+
|
|
15182
|
+
function newPgPool(connectionString, poolOptions) {
|
|
15183
|
+
poolOptions = poolOptions || {};
|
|
15184
|
+
|
|
15185
|
+
// @ts-ignore
|
|
15186
|
+
var pool = genericPool.Pool({
|
|
15187
|
+
min: poolOptions.min || 0,
|
|
15188
|
+
max: poolOptions.size || poolOptions.poolSize || defaults.poolSize,
|
|
15189
|
+
idleTimeoutMillis: poolOptions.idleTimeout || defaults.poolIdleTimeout,
|
|
15190
|
+
reapIntervalMillis: poolOptions.reapIntervalMillis || defaults.reapIntervalMillis,
|
|
15191
|
+
log: poolOptions.log,
|
|
15192
|
+
create: async function(cb) {
|
|
15193
|
+
try {
|
|
15194
|
+
if (!pg) {
|
|
15195
|
+
pg = await import('pg');
|
|
15196
|
+
pg = pg.default || pg;
|
|
15197
|
+
let types = pg.types || pg.types;
|
|
15198
|
+
types.setTypeParser(1700, function(val) {
|
|
15199
|
+
return parseFloat(val);
|
|
15200
|
+
});
|
|
15201
|
+
}
|
|
15202
|
+
}
|
|
15203
|
+
catch(e) {
|
|
15204
|
+
return cb(e, null);
|
|
15205
|
+
}
|
|
15206
|
+
var client = new pg.Client(connectionString);
|
|
15207
|
+
client.connect(function(err) {
|
|
15208
|
+
if (err) return cb(err, null);
|
|
15209
|
+
|
|
15210
|
+
//handle connected client background errors by emitting event
|
|
15211
|
+
//via the pg object and then removing errored client from the pool
|
|
15212
|
+
client.on('error', function(e) {
|
|
15213
|
+
pool.emit('error', e, client);
|
|
15214
|
+
|
|
15215
|
+
// If the client is already being destroyed, the error
|
|
15216
|
+
// occurred during stream ending. Do not attempt to destroy
|
|
15217
|
+
// the client again.
|
|
15218
|
+
if (!client._destroying) {
|
|
15219
|
+
pool.destroy(client);
|
|
15220
|
+
}
|
|
15221
|
+
});
|
|
15222
|
+
|
|
15223
|
+
// Remove connection from pool on disconnect
|
|
15224
|
+
client.on('end', function(_e) {
|
|
15225
|
+
// Do not enter infinite loop between pool.destroy
|
|
15226
|
+
// and client 'end' event...
|
|
15227
|
+
if (!client._destroying) {
|
|
15228
|
+
pool.destroy(client);
|
|
15229
|
+
}
|
|
15230
|
+
});
|
|
15231
|
+
client.poolCount = 0;
|
|
15232
|
+
negotiateSearchPath(client, connectionString, (err) => cb(err, client));
|
|
15233
|
+
|
|
15234
|
+
});
|
|
15235
|
+
},
|
|
15236
|
+
destroy: function(client) {
|
|
15237
|
+
client._destroying = true;
|
|
15238
|
+
client.poolCount = undefined;
|
|
15239
|
+
client.end();
|
|
15240
|
+
}
|
|
15241
|
+
});
|
|
15242
|
+
//monkey-patch with connect method
|
|
15243
|
+
pool.connect = function(cb) {
|
|
15244
|
+
pool.acquire(function(err, client) {
|
|
15245
|
+
if (err) return cb(err, null, function() {
|
|
15246
|
+
/*NOOP*/
|
|
15247
|
+
});
|
|
15248
|
+
client.poolCount++;
|
|
15249
|
+
cb(null, client, function(err) {
|
|
15250
|
+
if (err) {
|
|
15251
|
+
pool.destroy(client);
|
|
15252
|
+
} else {
|
|
15253
|
+
pool.release(client);
|
|
15254
|
+
}
|
|
15255
|
+
});
|
|
15256
|
+
});
|
|
15257
|
+
};
|
|
15258
|
+
return pool;
|
|
15259
|
+
}
|
|
15260
|
+
|
|
15261
|
+
function negotiateSearchPath(client, connectionString, cb) {
|
|
15262
|
+
const searchPath = parseSearchPathParam(connectionString);
|
|
15263
|
+
if (searchPath) {
|
|
15264
|
+
const sql = `set search_path to ${searchPath}`;
|
|
15265
|
+
log.emitQuery({sql, parameters: []});
|
|
15266
|
+
return client.query(sql, cb);
|
|
15267
|
+
}
|
|
15268
|
+
else
|
|
15269
|
+
cb();
|
|
15270
|
+
|
|
15271
|
+
|
|
15272
|
+
}
|
|
15273
|
+
|
|
15274
|
+
newPgPool_1 = newPgPool;
|
|
15275
|
+
return newPgPool_1;
|
|
15276
|
+
}
|
|
15277
|
+
|
|
15278
|
+
var newPool_1;
|
|
15279
|
+
var hasRequiredNewPool;
|
|
15280
|
+
|
|
15281
|
+
function requireNewPool () {
|
|
15282
|
+
if (hasRequiredNewPool) return newPool_1;
|
|
15283
|
+
hasRequiredNewPool = 1;
|
|
15284
|
+
const promisify = requirePromisify();
|
|
15285
|
+
const pools = requirePools();
|
|
15286
|
+
const end = requireEnd();
|
|
15287
|
+
const newPgPool = requireNewPgPool();
|
|
15288
|
+
const newId = requireNewId();
|
|
15289
|
+
|
|
15290
|
+
function newPool(connectionString, poolOptions) {
|
|
15291
|
+
let pool = newPgPool(connectionString, poolOptions);
|
|
15292
|
+
let id = newId();
|
|
15293
|
+
let boundEnd = end.bind(null, pool, id);
|
|
15294
|
+
let c = {};
|
|
15295
|
+
|
|
15296
|
+
c.connect = pool.connect;
|
|
15297
|
+
c.end = promisify(boundEnd);
|
|
15298
|
+
pools[id] = c;
|
|
15299
|
+
return c;
|
|
15300
|
+
}
|
|
15301
|
+
|
|
15302
|
+
newPool_1 = newPool;
|
|
15303
|
+
return newPool_1;
|
|
15304
|
+
}
|
|
15305
|
+
|
|
15306
|
+
var newDatabase_1;
|
|
15307
|
+
var hasRequiredNewDatabase;
|
|
15308
|
+
|
|
15309
|
+
function requireNewDatabase () {
|
|
15310
|
+
if (hasRequiredNewDatabase) return newDatabase_1;
|
|
15311
|
+
hasRequiredNewDatabase = 1;
|
|
15312
|
+
let createDomain = requireCreateDomain();
|
|
15313
|
+
let newTransaction = requireNewTransaction();
|
|
15314
|
+
let _begin = requireBegin();
|
|
15315
|
+
let commit = requireCommit();
|
|
15316
|
+
let rollback = requireRollback();
|
|
15317
|
+
let newPool = requireNewPool();
|
|
15318
|
+
let lock = requireLock();
|
|
15319
|
+
let executeSchema = requireSchema();
|
|
15320
|
+
let express = requireHostExpress();
|
|
15321
|
+
let hostLocal = requireHostLocal();
|
|
15322
|
+
let doQuery = requireQuery();
|
|
15323
|
+
let releaseDbClient = requireReleaseDbClient();
|
|
15324
|
+
let setSessionSingleton = requireSetSessionSingleton();
|
|
15325
|
+
|
|
15326
|
+
function newDatabase(connectionString, poolOptions) {
|
|
15327
|
+
if (!connectionString)
|
|
15328
|
+
throw new Error('Connection string cannot be empty');
|
|
15329
|
+
poolOptions = poolOptions || { min: 1 };
|
|
15330
|
+
var pool = newPool(connectionString, poolOptions);
|
|
15331
|
+
|
|
15332
|
+
let c = { poolFactory: pool, hostLocal, express };
|
|
15333
|
+
|
|
15334
|
+
c.transaction = function(options, fn) {
|
|
15335
|
+
if ((arguments.length === 1) && (typeof options === 'function')) {
|
|
15336
|
+
fn = options;
|
|
15337
|
+
options = undefined;
|
|
15338
|
+
}
|
|
15339
|
+
let domain = createDomain();
|
|
15340
|
+
|
|
15341
|
+
if (fn)
|
|
15342
|
+
return domain.run(runInTransaction);
|
|
15343
|
+
else
|
|
15344
|
+
return domain.run(run);
|
|
15345
|
+
|
|
15346
|
+
async function runInTransaction() {
|
|
15347
|
+
let result;
|
|
15348
|
+
let transaction = newTransaction(domain, pool, options);
|
|
15349
|
+
await new Promise(transaction)
|
|
15350
|
+
.then(begin)
|
|
15351
|
+
.then(negotiateSchema)
|
|
15352
|
+
.then(() => fn(domain))
|
|
15353
|
+
.then((res) => result = res)
|
|
15354
|
+
.then(() => commit(domain))
|
|
15355
|
+
.then(null, (e) => rollback(domain,e));
|
|
15356
|
+
return result;
|
|
15357
|
+
}
|
|
15358
|
+
|
|
15359
|
+
function begin() {
|
|
15360
|
+
return _begin(domain, options);
|
|
15361
|
+
}
|
|
15362
|
+
|
|
15363
|
+
function run() {
|
|
15364
|
+
let p;
|
|
15365
|
+
let transaction = newTransaction(domain, pool, options);
|
|
15366
|
+
p = new Promise(transaction);
|
|
15367
|
+
|
|
15368
|
+
return p.then(begin)
|
|
15369
|
+
.then(negotiateSchema);
|
|
15370
|
+
}
|
|
15371
|
+
|
|
15372
|
+
function negotiateSchema(previous) {
|
|
15373
|
+
let schema = options && options.schema;
|
|
15374
|
+
if (!schema)
|
|
15375
|
+
return previous;
|
|
15376
|
+
return executeSchema(domain, schema);
|
|
15377
|
+
}
|
|
15378
|
+
};
|
|
15379
|
+
|
|
15380
|
+
c.createTransaction = function(options) {
|
|
15381
|
+
let domain = createDomain();
|
|
15382
|
+
let transaction = newTransaction(domain, pool, options);
|
|
15383
|
+
let p = domain.run(() => new Promise(transaction)
|
|
15384
|
+
.then(begin).then(negotiateSchema));
|
|
15385
|
+
|
|
15386
|
+
function run(fn) {
|
|
15387
|
+
return p.then(domain.run.bind(domain, fn));
|
|
15388
|
+
}
|
|
15389
|
+
|
|
15390
|
+
function begin() {
|
|
15391
|
+
return _begin(domain, options);
|
|
15392
|
+
}
|
|
15393
|
+
|
|
15394
|
+
function negotiateSchema(previous) {
|
|
15395
|
+
let schema = options && options.schema;
|
|
15396
|
+
if (!schema)
|
|
15397
|
+
return previous;
|
|
15398
|
+
return executeSchema(domain,schema);
|
|
15399
|
+
}
|
|
15400
|
+
|
|
15401
|
+
run.rollback = rollback.bind(null, domain);
|
|
15402
|
+
run.commit = commit.bind(null, domain);
|
|
15403
|
+
|
|
15404
|
+
return run;
|
|
15405
|
+
};
|
|
15406
|
+
|
|
15407
|
+
c.query = function(query) {
|
|
15408
|
+
let domain = createDomain();
|
|
15409
|
+
let transaction = newTransaction(domain, pool);
|
|
15410
|
+
let p = domain.run(() => new Promise(transaction)
|
|
15411
|
+
.then(() => setSessionSingleton(domain, 'changes', []))
|
|
15412
|
+
.then(() => doQuery(domain, query).then(onResult, onError)));
|
|
15413
|
+
return p;
|
|
15414
|
+
|
|
15415
|
+
function onResult(result) {
|
|
15416
|
+
releaseDbClient(domain);
|
|
15417
|
+
return result;
|
|
15418
|
+
}
|
|
15419
|
+
|
|
15420
|
+
function onError(e) {
|
|
15421
|
+
releaseDbClient(domain);
|
|
15422
|
+
throw e;
|
|
15423
|
+
}
|
|
15424
|
+
};
|
|
15425
|
+
|
|
15426
|
+
c.rollback = rollback;
|
|
15427
|
+
c.commit = commit;
|
|
15428
|
+
c.lock = lock;
|
|
15429
|
+
c.schema = executeSchema;
|
|
15430
|
+
|
|
15431
|
+
c.end = function() {
|
|
15432
|
+
if (poolOptions)
|
|
15433
|
+
return pool.end();
|
|
15434
|
+
else
|
|
15435
|
+
return Promise.resolve();
|
|
15436
|
+
};
|
|
15437
|
+
|
|
15438
|
+
c.accept = function(caller) {
|
|
15439
|
+
caller.visitPg();
|
|
15440
|
+
};
|
|
15441
|
+
|
|
15442
|
+
return c;
|
|
15443
|
+
}
|
|
15444
|
+
|
|
15445
|
+
newDatabase_1 = newDatabase;
|
|
15446
|
+
return newDatabase_1;
|
|
15447
|
+
}
|
|
15448
|
+
|
|
15449
|
+
var indexBrowser$1;
|
|
15450
|
+
var hasRequiredIndexBrowser;
|
|
15451
|
+
|
|
15452
|
+
function requireIndexBrowser () {
|
|
15453
|
+
if (hasRequiredIndexBrowser) return indexBrowser$1;
|
|
15454
|
+
hasRequiredIndexBrowser = 1;
|
|
15455
|
+
const hostExpress = requireHostExpress();
|
|
15456
|
+
const hostLocal = requireHostLocal();
|
|
15457
|
+
const client = requireClient();
|
|
15458
|
+
const map = requireMap();
|
|
15459
|
+
let _d1;
|
|
15460
|
+
let _pg;
|
|
15461
|
+
let _pglite;
|
|
15462
|
+
|
|
15463
|
+
var connectViaPool = function() {
|
|
15464
|
+
return client.apply(null, arguments);
|
|
15465
|
+
};
|
|
15466
|
+
connectViaPool.createPatch = client.createPatch;
|
|
15467
|
+
connectViaPool.table = requireTable();
|
|
15468
|
+
connectViaPool.filter = requireEmptyFilter();
|
|
15469
|
+
connectViaPool.commit = requireCommit();
|
|
15470
|
+
connectViaPool.rollback = requireRollback();
|
|
15471
|
+
connectViaPool.end = requirePools().end;
|
|
15472
|
+
connectViaPool.close = connectViaPool.end;
|
|
15473
|
+
connectViaPool.log = requireLog().registerLogger;
|
|
15474
|
+
connectViaPool.on = requireLog().on;
|
|
15475
|
+
connectViaPool.off = requireLog().off;
|
|
15476
|
+
connectViaPool.query = requireQuery();
|
|
15477
|
+
connectViaPool.lock = requireLock();
|
|
15478
|
+
connectViaPool.schema = requireSchema();
|
|
15479
|
+
connectViaPool.map = map.bind(null, connectViaPool);
|
|
15480
|
+
|
|
15481
|
+
connectViaPool.http = function(url) {
|
|
15482
|
+
return url;
|
|
15483
|
+
};
|
|
15484
|
+
|
|
15485
|
+
|
|
15486
|
+
Object.defineProperty(connectViaPool, 'd1', {
|
|
15487
|
+
get: function() {
|
|
15488
|
+
if (!_d1)
|
|
15489
|
+
_d1 = requireNewDatabase$2();
|
|
15490
|
+
return _d1;
|
|
15491
|
+
}
|
|
15492
|
+
});
|
|
15493
|
+
|
|
15494
|
+
Object.defineProperty(connectViaPool, 'pglite', {
|
|
15495
|
+
get: function() {
|
|
15496
|
+
if (!_pglite)
|
|
15497
|
+
_pglite = requireNewDatabase$1();
|
|
15498
|
+
return _pglite;
|
|
15499
|
+
}
|
|
15500
|
+
});
|
|
15501
|
+
|
|
15502
|
+
Object.defineProperty(connectViaPool, 'postgres', {
|
|
15503
|
+
get: function() {
|
|
15504
|
+
if (!_pg)
|
|
15505
|
+
_pg = requireNewDatabase();
|
|
15506
|
+
return _pg;
|
|
15507
|
+
}
|
|
15508
|
+
});
|
|
15509
|
+
|
|
15510
|
+
Object.defineProperty(connectViaPool, 'pg', {
|
|
15511
|
+
get: function() {
|
|
15512
|
+
if (!_pg)
|
|
15513
|
+
_pg = requireNewDatabase();
|
|
15514
|
+
return _pg;
|
|
15515
|
+
}
|
|
15516
|
+
});
|
|
15517
|
+
|
|
15004
15518
|
|
|
15005
15519
|
connectViaPool.express = hostExpress.bind(null, hostLocal);
|
|
15006
15520
|
|
package/docs/changelog.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orange-orm",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.17",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"scripts": {
|
|
55
55
|
"test": "vitest run --pool=forks --poolOptions.forks.singleFork",
|
|
56
56
|
"test:bun": "bun test --timeout=30000 ./tests/*.bun.test.js",
|
|
57
|
-
"test:deno": "deno test --allow-all --unstable-detect-cjs ./tests/*.deno.test.js",
|
|
57
|
+
"test:deno": "deno test --allow-all --no-check --unstable-detect-cjs ./tests/*.deno.test.js",
|
|
58
58
|
"test:all": "echo 'Running Node.js tests...' && npm run test:node && echo 'Running Bun tests...' && npm run test:bun && echo 'Running Deno tests...' && npm run test:deno && echo 'All tests completed!'",
|
|
59
59
|
"test:all:parallel": "concurrently \"npm:test:node\" \"npm:test:bun\" \"npm:test:deno\"",
|
|
60
60
|
"coverage": "vitest run --coverage.enabled --coverage.reporter='text-summary' --pool=forks --poolOptions.forks.singleFork",
|
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 _pg;
|
|
6
7
|
let _pglite;
|
|
7
8
|
|
|
8
9
|
var connectViaPool = function() {
|
|
@@ -44,6 +45,23 @@ Object.defineProperty(connectViaPool, 'pglite', {
|
|
|
44
45
|
}
|
|
45
46
|
});
|
|
46
47
|
|
|
48
|
+
Object.defineProperty(connectViaPool, 'postgres', {
|
|
49
|
+
get: function() {
|
|
50
|
+
if (!_pg)
|
|
51
|
+
_pg = require('./pg/newDatabase');
|
|
52
|
+
return _pg;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
Object.defineProperty(connectViaPool, 'pg', {
|
|
57
|
+
get: function() {
|
|
58
|
+
if (!_pg)
|
|
59
|
+
_pg = require('./pg/newDatabase');
|
|
60
|
+
return _pg;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
|
|
47
65
|
connectViaPool.express = hostExpress.bind(null, hostLocal);
|
|
48
66
|
|
|
49
67
|
module.exports = connectViaPool;
|