@nicia-ai/typegraph 0.36.0 → 0.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/postgres/index.cjs +24 -24
- package/dist/backend/postgres/index.d.cts +6 -6
- package/dist/backend/postgres/index.d.ts +6 -6
- package/dist/backend/postgres/index.js +11 -11
- package/dist/backend/postgres/pglite.cjs +16 -16
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +11 -11
- package/dist/backend/sqlite/index.cjs +22 -21
- package/dist/backend/sqlite/index.d.cts +11 -9
- package/dist/backend/sqlite/index.d.ts +11 -9
- package/dist/backend/sqlite/index.js +10 -9
- package/dist/backend/sqlite/libsql.cjs +15 -14
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +11 -10
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +30 -23
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +18 -11
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/{chunk-TCOCYN2P.cjs → chunk-27SSDCEP.cjs} +14 -14
- package/dist/{chunk-TCOCYN2P.cjs.map → chunk-27SSDCEP.cjs.map} +1 -1
- package/dist/{chunk-5AQIKK56.cjs → chunk-2N6EOBTH.cjs} +16 -16
- package/dist/{chunk-5AQIKK56.cjs.map → chunk-2N6EOBTH.cjs.map} +1 -1
- package/dist/{chunk-FN35DLCN.cjs → chunk-3C2RYI6L.cjs} +13 -107
- package/dist/chunk-3C2RYI6L.cjs.map +1 -0
- package/dist/{chunk-HW3LW7DH.cjs → chunk-3DS7Z4T4.cjs} +39 -39
- package/dist/{chunk-HW3LW7DH.cjs.map → chunk-3DS7Z4T4.cjs.map} +1 -1
- package/dist/{chunk-RSSQKPSZ.cjs → chunk-3GH67G4Z.cjs} +5 -5
- package/dist/{chunk-RSSQKPSZ.cjs.map → chunk-3GH67G4Z.cjs.map} +1 -1
- package/dist/{chunk-M75SUBFG.js → chunk-3RWZPJKV.js} +24 -9
- package/dist/chunk-3RWZPJKV.js.map +1 -0
- package/dist/{chunk-SKCOUWAX.js → chunk-3SLPDKHQ.js} +4 -4
- package/dist/chunk-3SLPDKHQ.js.map +1 -0
- package/dist/{chunk-5A6FNS6N.cjs → chunk-3XXGYU62.cjs} +11 -11
- package/dist/{chunk-5A6FNS6N.cjs.map → chunk-3XXGYU62.cjs.map} +1 -1
- package/dist/{chunk-IU46OHVW.js → chunk-44TA22QT.js} +58 -11
- package/dist/chunk-44TA22QT.js.map +1 -0
- package/dist/{chunk-7BQLPXK6.cjs → chunk-5AVRFNP4.cjs} +2955 -898
- package/dist/chunk-5AVRFNP4.cjs.map +1 -0
- package/dist/{chunk-2THZ3TQI.cjs → chunk-5KEQ74YU.cjs} +14 -14
- package/dist/chunk-5KEQ74YU.cjs.map +1 -0
- package/dist/{chunk-Q5TEXCTB.js → chunk-5KPNWT6X.js} +3 -3
- package/dist/{chunk-Q5TEXCTB.js.map → chunk-5KPNWT6X.js.map} +1 -1
- package/dist/{chunk-WI7ISNQF.js → chunk-5PNMDJ7J.js} +94 -5
- package/dist/chunk-5PNMDJ7J.js.map +1 -0
- package/dist/{chunk-AW4A3P5A.cjs → chunk-5VQM6VWP.cjs} +2 -2
- package/dist/{chunk-AW4A3P5A.cjs.map → chunk-5VQM6VWP.cjs.map} +1 -1
- package/dist/{chunk-A3W7QG7K.js → chunk-5WWVZMVX.js} +2 -2
- package/dist/{chunk-A3W7QG7K.js.map → chunk-5WWVZMVX.js.map} +1 -1
- package/dist/{chunk-FACJJWGF.cjs → chunk-6EEO3OVU.cjs} +7 -7
- package/dist/{chunk-FACJJWGF.cjs.map → chunk-6EEO3OVU.cjs.map} +1 -1
- package/dist/{chunk-DIK74MXX.cjs → chunk-BVRDGYXQ.cjs} +97 -4
- package/dist/chunk-BVRDGYXQ.cjs.map +1 -0
- package/dist/{chunk-4BCU6VFZ.cjs → chunk-DEFQM7JU.cjs} +7 -7
- package/dist/{chunk-4BCU6VFZ.cjs.map → chunk-DEFQM7JU.cjs.map} +1 -1
- package/dist/{chunk-456Z2U7Y.cjs → chunk-DIQ3AV5W.cjs} +574 -268
- package/dist/chunk-DIQ3AV5W.cjs.map +1 -0
- package/dist/{chunk-JFMEONLG.cjs → chunk-EJYMTO3K.cjs} +332 -188
- package/dist/chunk-EJYMTO3K.cjs.map +1 -0
- package/dist/{chunk-FPIZFYHE.js → chunk-EXU3RASM.js} +74 -15
- package/dist/chunk-EXU3RASM.js.map +1 -0
- package/dist/{chunk-5DIPR3L3.js → chunk-GA4TT3DH.js} +2338 -281
- package/dist/chunk-GA4TT3DH.js.map +1 -0
- package/dist/{chunk-H7YNSMA7.cjs → chunk-HAHNRASW.cjs} +20 -2
- package/dist/chunk-HAHNRASW.cjs.map +1 -0
- package/dist/{chunk-J3LEGNQB.cjs → chunk-IP3CGGPA.cjs} +8 -8
- package/dist/{chunk-J3LEGNQB.cjs.map → chunk-IP3CGGPA.cjs.map} +1 -1
- package/dist/{chunk-X4JBT642.cjs → chunk-IPSVVTWT.cjs} +94 -35
- package/dist/chunk-IPSVVTWT.cjs.map +1 -0
- package/dist/{chunk-VQEXF5D4.js → chunk-IXGYRP2P.js} +184 -92
- package/dist/chunk-IXGYRP2P.js.map +1 -0
- package/dist/{chunk-4GX2JJXS.js → chunk-K3Q3LJY3.js} +520 -221
- package/dist/chunk-K3Q3LJY3.js.map +1 -0
- package/dist/{chunk-OR5ZA5WP.js → chunk-K5UBVGJN.js} +4 -4
- package/dist/{chunk-OR5ZA5WP.js.map → chunk-K5UBVGJN.js.map} +1 -1
- package/dist/{chunk-UZV3AZKF.js → chunk-KQJ54OG5.js} +3 -3
- package/dist/{chunk-UZV3AZKF.js.map → chunk-KQJ54OG5.js.map} +1 -1
- package/dist/{chunk-SXGE7ITL.js → chunk-L7HQ2OSI.js} +4 -4
- package/dist/{chunk-SXGE7ITL.js.map → chunk-L7HQ2OSI.js.map} +1 -1
- package/dist/{chunk-RAXU3RMB.js → chunk-M6VES7V6.js} +4 -4
- package/dist/{chunk-RAXU3RMB.js.map → chunk-M6VES7V6.js.map} +1 -1
- package/dist/{chunk-PWGX5DF5.cjs → chunk-NUIG3BCV.cjs} +100 -85
- package/dist/chunk-NUIG3BCV.cjs.map +1 -0
- package/dist/{chunk-ZAMFOJ5P.cjs → chunk-NXQFATMF.cjs} +269 -177
- package/dist/chunk-NXQFATMF.cjs.map +1 -0
- package/dist/{chunk-KBGQIPRQ.js → chunk-PC2UBAUB.js} +20 -3
- package/dist/chunk-PC2UBAUB.js.map +1 -0
- package/dist/chunk-QARBLBXT.cjs +219 -0
- package/dist/chunk-QARBLBXT.cjs.map +1 -0
- package/dist/{chunk-6FR2MMS6.js → chunk-QERAIDRJ.js} +45 -4
- package/dist/chunk-QERAIDRJ.js.map +1 -0
- package/dist/chunk-QSXTWU4U.cjs +12 -0
- package/dist/{chunk-4BMPGT35.cjs.map → chunk-QSXTWU4U.cjs.map} +1 -1
- package/dist/{chunk-DN5VP4JC.js → chunk-RCVLFTCT.js} +9 -10
- package/dist/chunk-RCVLFTCT.js.map +1 -0
- package/dist/{chunk-ZIGXMKQQ.js → chunk-RRSNR3TP.js} +3 -3
- package/dist/{chunk-ZIGXMKQQ.js.map → chunk-RRSNR3TP.js.map} +1 -1
- package/dist/{chunk-4CAXEB2F.cjs → chunk-TGOMW4MB.cjs} +91 -92
- package/dist/chunk-TGOMW4MB.cjs.map +1 -0
- package/dist/{chunk-PZKNKG5M.js → chunk-TKT2XHED.js} +8 -8
- package/dist/{chunk-PZKNKG5M.js.map → chunk-TKT2XHED.js.map} +1 -1
- package/dist/{chunk-S5F7ZLP2.js → chunk-TPF25IG6.js} +3 -3
- package/dist/{chunk-S5F7ZLP2.js.map → chunk-TPF25IG6.js.map} +1 -1
- package/dist/{chunk-5SEGFTZX.js → chunk-UGZUAYAR.js} +3 -3
- package/dist/{chunk-5SEGFTZX.js.map → chunk-UGZUAYAR.js.map} +1 -1
- package/dist/{chunk-BJVEU3ZL.js → chunk-UV3WP5WZ.js} +265 -121
- package/dist/chunk-UV3WP5WZ.js.map +1 -0
- package/dist/{chunk-VHMPG6UL.js → chunk-UXLSNRYL.js} +11 -105
- package/dist/chunk-UXLSNRYL.js.map +1 -0
- package/dist/{chunk-FRV5Q5IO.js → chunk-UYQMBBWJ.js} +3 -3
- package/dist/{chunk-FRV5Q5IO.js.map → chunk-UYQMBBWJ.js.map} +1 -1
- package/dist/{chunk-UUT7UN2N.cjs → chunk-VGDDG3XJ.cjs} +7 -7
- package/dist/{chunk-UUT7UN2N.cjs.map → chunk-VGDDG3XJ.cjs.map} +1 -1
- package/dist/{chunk-5VTR2F2K.js → chunk-VKGKDOKR.js} +12 -10
- package/dist/chunk-VKGKDOKR.js.map +1 -0
- package/dist/{chunk-5W4L6DLF.cjs → chunk-VL2V6PEN.cjs} +11 -11
- package/dist/{chunk-5W4L6DLF.cjs.map → chunk-VL2V6PEN.cjs.map} +1 -1
- package/dist/{chunk-ZUNQ5BEP.cjs → chunk-WOJMKB3N.cjs} +82 -80
- package/dist/chunk-WOJMKB3N.cjs.map +1 -0
- package/dist/{chunk-UMDVATGY.cjs → chunk-WWFHO375.cjs} +6 -6
- package/dist/{chunk-UMDVATGY.cjs.map → chunk-WWFHO375.cjs.map} +1 -1
- package/dist/{chunk-JFUPDJXD.js → chunk-XGPUQ56G.js} +3 -3
- package/dist/{chunk-JFUPDJXD.js.map → chunk-XGPUQ56G.js.map} +1 -1
- package/dist/{chunk-D7ZEOS56.cjs → chunk-XGU7DZDA.cjs} +74 -14
- package/dist/chunk-XGU7DZDA.cjs.map +1 -0
- package/dist/{chunk-S55OV6PW.cjs → chunk-XPCZADMT.cjs} +54 -11
- package/dist/chunk-XPCZADMT.cjs.map +1 -0
- package/dist/{chunk-T2WUSPDA.js → chunk-XWV4JT34.js} +3 -3
- package/dist/{chunk-T2WUSPDA.js.map → chunk-XWV4JT34.js.map} +1 -1
- package/dist/chunk-YTSN73ND.js +212 -0
- package/dist/chunk-YTSN73ND.js.map +1 -0
- package/dist/{ddl-CZz7a0E8.d.cts → ddl-BD-ZfKeX.d.cts} +3 -3
- package/dist/{ddl-C2rZ-Aen.d.ts → ddl-CS0KUVwB.d.ts} +3 -3
- package/dist/{extension-types-ixRpJVUp.d.ts → extension-types-BM2ACfYO.d.cts} +6 -1
- package/dist/{extension-types-ixRpJVUp.d.cts → extension-types-BM2ACfYO.d.ts} +6 -1
- package/dist/{fulltext-strategy-CDkSSYhq.d.cts → fulltext-strategy-C27vXaeB.d.cts} +127 -8
- package/dist/{fulltext-strategy-B57yvC5Q.d.ts → fulltext-strategy-DebsMrqg.d.ts} +127 -8
- package/dist/graph-extension/index.cjs +19 -19
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +4 -4
- package/dist/graph-merge/index.cjs +88 -88
- package/dist/graph-merge/index.d.cts +6 -6
- package/dist/graph-merge/index.d.ts +6 -6
- package/dist/graph-merge/index.js +19 -19
- package/dist/{index-BLtQWKRj.d.cts → index-BPM59vsg.d.cts} +52 -7
- package/dist/{index-BFvdmBPV.d.ts → index-BeacbPoe.d.ts} +52 -7
- package/dist/index.cjs +224 -187
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +53 -40
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +30 -21
- package/dist/indexes/index.d.cts +5 -5
- package/dist/indexes/index.d.ts +5 -5
- package/dist/indexes/index.js +8 -7
- package/dist/interchange/index.cjs +207 -30
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +25 -8
- package/dist/interchange/index.d.ts +25 -8
- package/dist/interchange/index.js +190 -11
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-DwQi8eV0.d.cts → manager-D00_NXvT.d.ts} +11 -2
- package/dist/{manager-ejUCB52T.d.ts → manager-nU1vTJLy.d.cts} +11 -2
- package/dist/{materialize-indexes-B4e9360H.d.cts → materialize-indexes-CuR3gAZb.d.cts} +8 -2
- package/dist/{materialize-indexes-te9TPMMJ.d.ts → materialize-indexes-zK2J_flP.d.ts} +8 -2
- package/dist/{postgres-CfEqsRMp.d.cts → postgres-IaBA4RgE.d.ts} +1 -1
- package/dist/{postgres-DQ5R6rzV.d.ts → postgres-YrYmPlaU.d.cts} +1 -1
- package/dist/profiler/index.cjs +3 -3
- package/dist/profiler/index.d.cts +7 -7
- package/dist/profiler/index.d.ts +7 -7
- package/dist/profiler/index.js +2 -2
- package/dist/provenance/index.cjs +32 -33
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +5 -5
- package/dist/provenance/index.d.ts +5 -5
- package/dist/provenance/index.js +5 -6
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +35 -35
- package/dist/schema/index.d.cts +7 -7
- package/dist/schema/index.d.ts +7 -7
- package/dist/schema/index.js +11 -11
- package/dist/{sqlite-DvQndLky.d.ts → sqlite-BUOHPx7p.d.ts} +1 -1
- package/dist/{sqlite-D7zBinNR.d.cts → sqlite-Pp8O19WE.d.cts} +1 -1
- package/dist/{store-view-DplHC3Nt.d.ts → store-view-ANL6mTph.d.ts} +213 -27
- package/dist/{store-view-9KDOpZzF.d.cts → store-view-X96Rd00T.d.cts} +213 -27
- package/dist/{types-Bv9DcS_E.d.cts → types-r-Zyq2Hz.d.cts} +2 -2
- package/dist/{types-CoxuV7EJ.d.ts → types-wsvuBgPK.d.ts} +2 -2
- package/dist/where-CJOpJj3a.d.ts +36 -0
- package/dist/where-K3uBP33l.d.cts +36 -0
- package/package.json +1 -1
- package/dist/chunk-2THZ3TQI.cjs.map +0 -1
- package/dist/chunk-456Z2U7Y.cjs.map +0 -1
- package/dist/chunk-4BMPGT35.cjs +0 -12
- package/dist/chunk-4CAXEB2F.cjs.map +0 -1
- package/dist/chunk-4GX2JJXS.js.map +0 -1
- package/dist/chunk-5DIPR3L3.js.map +0 -1
- package/dist/chunk-5VTR2F2K.js.map +0 -1
- package/dist/chunk-6FR2MMS6.js.map +0 -1
- package/dist/chunk-7BQLPXK6.cjs.map +0 -1
- package/dist/chunk-BJVEU3ZL.js.map +0 -1
- package/dist/chunk-D7ZEOS56.cjs.map +0 -1
- package/dist/chunk-DIK74MXX.cjs.map +0 -1
- package/dist/chunk-DN5VP4JC.js.map +0 -1
- package/dist/chunk-EOLERH7Y.cjs +0 -40
- package/dist/chunk-EOLERH7Y.cjs.map +0 -1
- package/dist/chunk-FN35DLCN.cjs.map +0 -1
- package/dist/chunk-FPIZFYHE.js.map +0 -1
- package/dist/chunk-H7YNSMA7.cjs.map +0 -1
- package/dist/chunk-IU46OHVW.js.map +0 -1
- package/dist/chunk-JFMEONLG.cjs.map +0 -1
- package/dist/chunk-KBGQIPRQ.js.map +0 -1
- package/dist/chunk-M75SUBFG.js.map +0 -1
- package/dist/chunk-PWGX5DF5.cjs.map +0 -1
- package/dist/chunk-S55OV6PW.cjs.map +0 -1
- package/dist/chunk-SKCOUWAX.js.map +0 -1
- package/dist/chunk-UT3S4SEN.js +0 -31
- package/dist/chunk-UT3S4SEN.js.map +0 -1
- package/dist/chunk-VHMPG6UL.js.map +0 -1
- package/dist/chunk-VQEXF5D4.js.map +0 -1
- package/dist/chunk-WI7ISNQF.js.map +0 -1
- package/dist/chunk-X4JBT642.cjs.map +0 -1
- package/dist/chunk-ZAMFOJ5P.cjs.map +0 -1
- package/dist/chunk-ZUNQ5BEP.cjs.map +0 -1
- package/dist/where-7RKFOsXt.d.ts +0 -11
- package/dist/where-DdMIXOtH.d.cts +0 -11
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3GH67G4Z_cjs = require('./chunk-3GH67G4Z.cjs');
|
|
4
4
|
var chunk7YSP4V4R_cjs = require('./chunk-7YSP4V4R.cjs');
|
|
5
5
|
var chunkSJDMVITW_cjs = require('./chunk-SJDMVITW.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkBVRDGYXQ_cjs = require('./chunk-BVRDGYXQ.cjs');
|
|
7
7
|
var chunkTDXIBCGY_cjs = require('./chunk-TDXIBCGY.cjs');
|
|
8
8
|
var drizzleOrm = require('drizzle-orm');
|
|
9
9
|
|
|
10
10
|
// src/backend/types.ts
|
|
11
|
+
function normalizeGraphAnalyticsCapabilities(capabilities) {
|
|
12
|
+
if (capabilities.graphAnalytics?.supported !== true || capabilities.transactions && capabilities.windowFunctions && capabilities.returning !== false) {
|
|
13
|
+
return capabilities;
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
...capabilities,
|
|
17
|
+
graphAnalytics: { ...capabilities.graphAnalytics, supported: false }
|
|
18
|
+
};
|
|
19
|
+
}
|
|
11
20
|
function rowPropsToObject(props) {
|
|
12
21
|
return typeof props === "string" ? JSON.parse(props) : props;
|
|
13
22
|
}
|
|
@@ -20,6 +29,9 @@ function isLiveNodeRow(row) {
|
|
|
20
29
|
function isTombstonedNodeRow(row) {
|
|
21
30
|
return row.deleted_at !== void 0;
|
|
22
31
|
}
|
|
32
|
+
var INTERNAL_TEMPORARY_WRITES = /* @__PURE__ */ Symbol(
|
|
33
|
+
"typegraph.internalTemporaryWrites"
|
|
34
|
+
);
|
|
23
35
|
function createBackendOverlay(target, overlay) {
|
|
24
36
|
const boundTargetMethods = /* @__PURE__ */ new Map();
|
|
25
37
|
function hasOverlayProperty(property) {
|
|
@@ -101,6 +113,7 @@ async function runOptionallyInTransaction(backend, fn, fallback) {
|
|
|
101
113
|
var SQLITE_MAX_BIND_PARAMETERS = 999;
|
|
102
114
|
var MODERN_SQLITE_MAX_BIND_PARAMETERS = 32766;
|
|
103
115
|
var D1_MAX_BIND_PARAMETERS = 100;
|
|
116
|
+
var DURABLE_OBJECT_MAX_BIND_PARAMETERS = 100;
|
|
104
117
|
var POSTGRES_MAX_BIND_PARAMETERS = 65535;
|
|
105
118
|
var SQLITE_CAPABILITIES = {
|
|
106
119
|
transactions: true,
|
|
@@ -109,7 +122,10 @@ var SQLITE_CAPABILITIES = {
|
|
|
109
122
|
// SQLite has supported window functions since 3.25.0
|
|
110
123
|
returning: true,
|
|
111
124
|
// SQLite has supported RETURNING since 3.35.0
|
|
112
|
-
maxBindParameters: SQLITE_MAX_BIND_PARAMETERS
|
|
125
|
+
maxBindParameters: SQLITE_MAX_BIND_PARAMETERS,
|
|
126
|
+
// Generic SQLite builds do not guarantee ENABLE_MATH_FUNCTIONS. The local
|
|
127
|
+
// better-sqlite3 factory overrides this flag for its bundled build contract.
|
|
128
|
+
graphAnalytics: { supported: true, mathFunctions: false }
|
|
113
129
|
};
|
|
114
130
|
var POSTGRES_CAPABILITIES = {
|
|
115
131
|
transactions: true,
|
|
@@ -118,12 +134,44 @@ var POSTGRES_CAPABILITIES = {
|
|
|
118
134
|
// PostgreSQL supports ROW_NUMBER() and related windows
|
|
119
135
|
returning: true,
|
|
120
136
|
// PostgreSQL has supported RETURNING since 8.2
|
|
121
|
-
maxBindParameters: POSTGRES_MAX_BIND_PARAMETERS
|
|
137
|
+
maxBindParameters: POSTGRES_MAX_BIND_PARAMETERS,
|
|
138
|
+
graphAnalytics: { supported: true, mathFunctions: true }
|
|
122
139
|
};
|
|
140
|
+
|
|
141
|
+
// src/query/sql-intent.ts
|
|
142
|
+
function asCompiledRowsSql(query) {
|
|
143
|
+
return query;
|
|
144
|
+
}
|
|
145
|
+
function asCompiledSelectSql(query) {
|
|
146
|
+
return asCompiledRowsSql(query);
|
|
147
|
+
}
|
|
148
|
+
function asCompiledStatementSql(query) {
|
|
149
|
+
return query;
|
|
150
|
+
}
|
|
151
|
+
function asCompiledTemporaryStatementSql(query) {
|
|
152
|
+
return query;
|
|
153
|
+
}
|
|
154
|
+
var forceCustomPlanQueries = /* @__PURE__ */ new WeakSet();
|
|
155
|
+
function markForceCustomPlan(query) {
|
|
156
|
+
forceCustomPlanQueries.add(query);
|
|
157
|
+
}
|
|
158
|
+
function shouldForceCustomPlan(query) {
|
|
159
|
+
return forceCustomPlanQueries.has(query);
|
|
160
|
+
}
|
|
161
|
+
var annIndexScanQueries = /* @__PURE__ */ new WeakMap();
|
|
162
|
+
function markAnnIndexScan(query, indexTypes) {
|
|
163
|
+
annIndexScanQueries.set(query, indexTypes);
|
|
164
|
+
}
|
|
165
|
+
function annIndexScanTypes(query) {
|
|
166
|
+
return annIndexScanQueries.get(query);
|
|
167
|
+
}
|
|
168
|
+
function isRawExecutable(query) {
|
|
169
|
+
return !shouldForceCustomPlan(query) && annIndexScanTypes(query) === void 0;
|
|
170
|
+
}
|
|
123
171
|
var pinnedReadInstant;
|
|
124
172
|
function withPinnedReadInstant(emit) {
|
|
125
173
|
if (pinnedReadInstant !== void 0) return emit();
|
|
126
|
-
pinnedReadInstant =
|
|
174
|
+
pinnedReadInstant = chunk3GH67G4Z_cjs.nowIso();
|
|
127
175
|
try {
|
|
128
176
|
return emit();
|
|
129
177
|
} finally {
|
|
@@ -131,7 +179,7 @@ function withPinnedReadInstant(emit) {
|
|
|
131
179
|
}
|
|
132
180
|
}
|
|
133
181
|
function currentReadInstant() {
|
|
134
|
-
return drizzleOrm.sql`${pinnedReadInstant ??
|
|
182
|
+
return drizzleOrm.sql`${pinnedReadInstant ?? chunk3GH67G4Z_cjs.nowIso()}`;
|
|
135
183
|
}
|
|
136
184
|
var CURRENT_READ_INSTANT_PLACEHOLDER = "__typegraph_current_read_instant__";
|
|
137
185
|
function currentReadInstantPlaceholder() {
|
|
@@ -260,7 +308,7 @@ function predicate(expr) {
|
|
|
260
308
|
}
|
|
261
309
|
function param(name) {
|
|
262
310
|
if (name === CURRENT_READ_INSTANT_PLACEHOLDER) {
|
|
263
|
-
throw new
|
|
311
|
+
throw new chunkBVRDGYXQ_cjs.ConfigurationError(
|
|
264
312
|
`Parameter name "${name}" is reserved for internal use`,
|
|
265
313
|
{ parameterName: name }
|
|
266
314
|
);
|
|
@@ -407,7 +455,7 @@ function createFulltextAccessor(alias, hasSearchableField) {
|
|
|
407
455
|
return {
|
|
408
456
|
matches: (query, k, options) => {
|
|
409
457
|
if (!hasSearchableField()) {
|
|
410
|
-
throw new
|
|
458
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
411
459
|
`Cannot call .$fulltext.matches() on alias "${alias}" \u2014 its node kind has no fields declared with searchable(). Add at least one: \`title: searchable({ language: "english" })\`.`
|
|
412
460
|
);
|
|
413
461
|
}
|
|
@@ -422,7 +470,7 @@ function createFulltextAccessor(alias, hasSearchableField) {
|
|
|
422
470
|
}
|
|
423
471
|
function fulltextMatch(field, query, limit, options) {
|
|
424
472
|
if (!Number.isFinite(limit) || limit <= 0) {
|
|
425
|
-
throw new
|
|
473
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
426
474
|
`matches() limit must be a positive finite number, got ${String(limit)}`
|
|
427
475
|
);
|
|
428
476
|
}
|
|
@@ -695,7 +743,7 @@ function notInSubquery(field, subquery) {
|
|
|
695
743
|
function assertSingleColumnSubquery(subquery) {
|
|
696
744
|
const columnCount = getSubqueryColumnCount(subquery);
|
|
697
745
|
if (columnCount === 1) return;
|
|
698
|
-
throw new
|
|
746
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
699
747
|
`IN/NOT IN subquery must project exactly 1 column, but got ${columnCount}`,
|
|
700
748
|
{ subqueryColumnCount: columnCount },
|
|
701
749
|
{
|
|
@@ -708,7 +756,7 @@ function assertCompatibleSubqueryValueTypes(field, subquery) {
|
|
|
708
756
|
const subqueryValueType = getSingleSubqueryColumnValueType(subquery);
|
|
709
757
|
const resolvedValueType = fieldValueType ?? subqueryValueType;
|
|
710
758
|
if (isUnsupportedInSubqueryValueType(resolvedValueType)) {
|
|
711
|
-
throw new
|
|
759
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
712
760
|
`IN/NOT IN subquery does not support ${String(resolvedValueType)} values`,
|
|
713
761
|
{ valueType: resolvedValueType },
|
|
714
762
|
{
|
|
@@ -719,7 +767,7 @@ function assertCompatibleSubqueryValueTypes(field, subquery) {
|
|
|
719
767
|
if (isInSubqueryTypeCompatible(fieldValueType, subqueryValueType)) {
|
|
720
768
|
return;
|
|
721
769
|
}
|
|
722
|
-
throw new
|
|
770
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
723
771
|
`IN/NOT IN type mismatch: field type "${String(fieldValueType)}" does not match subquery column type "${String(subqueryValueType)}"`,
|
|
724
772
|
{
|
|
725
773
|
fieldValueType,
|
|
@@ -843,7 +891,7 @@ function resolveLiteralValueTypes(literals) {
|
|
|
843
891
|
}
|
|
844
892
|
}
|
|
845
893
|
if (resolved.size > 1) {
|
|
846
|
-
throw new
|
|
894
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
847
895
|
"Mixed literal value types are not supported in predicates",
|
|
848
896
|
{ valueTypes: [...resolved] }
|
|
849
897
|
);
|
|
@@ -973,7 +1021,7 @@ function compilePredicateExpression(expr, ctx) {
|
|
|
973
1021
|
if (!upperIsParam) boundsForType.push(expr.upper);
|
|
974
1022
|
const valueType = boundsForType.length > 0 ? resolveComparisonValueType(expr.field, boundsForType) : normalizeValueType2(expr.field.valueType);
|
|
975
1023
|
if (valueType === "array" || valueType === "object") {
|
|
976
|
-
throw new
|
|
1024
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
977
1025
|
"Between comparisons are not supported for JSON arrays or objects"
|
|
978
1026
|
);
|
|
979
1027
|
}
|
|
@@ -1040,7 +1088,7 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1040
1088
|
);
|
|
1041
1089
|
const opSql2 = COMPARISON_OP_SQL[expr.op];
|
|
1042
1090
|
if (!opSql2) {
|
|
1043
|
-
throw new
|
|
1091
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
1044
1092
|
`Comparison operation "${expr.op}" is not supported for parameterized predicates`
|
|
1045
1093
|
);
|
|
1046
1094
|
}
|
|
@@ -1048,7 +1096,7 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1048
1096
|
}
|
|
1049
1097
|
const valueType = resolveComparisonValueType(expr.left, expr.right);
|
|
1050
1098
|
if (valueType === "array" || valueType === "object") {
|
|
1051
|
-
throw new
|
|
1099
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
1052
1100
|
`Comparison operation "${expr.op}" is not supported for ${valueType} values`
|
|
1053
1101
|
);
|
|
1054
1102
|
}
|
|
@@ -1065,18 +1113,17 @@ function compileComparisonPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1065
1113
|
if (values.length === 0) {
|
|
1066
1114
|
return expr.op === "in" ? drizzleOrm.sql.raw("1=0") : drizzleOrm.sql.raw("1=1");
|
|
1067
1115
|
}
|
|
1068
|
-
const
|
|
1069
|
-
(
|
|
1116
|
+
const convertedValues = values.map(
|
|
1117
|
+
(value) => convertValueForSql(value.value, dialect)
|
|
1070
1118
|
);
|
|
1071
|
-
|
|
1072
|
-
return drizzleOrm.sql`${left} ${op} (${drizzleOrm.sql.join(placeholders, drizzleOrm.sql`, `)})`;
|
|
1119
|
+
return dialect.inList(left, convertedValues, expr.op === "notIn");
|
|
1073
1120
|
}
|
|
1074
1121
|
const right = expr.right;
|
|
1075
1122
|
const rightValue = Array.isArray(right) ? right[0] : right;
|
|
1076
1123
|
const convertedRight = convertValueForSql(rightValue.value, dialect);
|
|
1077
1124
|
const opSql = COMPARISON_OP_SQL[expr.op];
|
|
1078
1125
|
if (!opSql) {
|
|
1079
|
-
throw new
|
|
1126
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
1080
1127
|
`Comparison operation "${expr.op}" is not supported`
|
|
1081
1128
|
);
|
|
1082
1129
|
}
|
|
@@ -1139,13 +1186,13 @@ function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1139
1186
|
}
|
|
1140
1187
|
case "pathEquals": {
|
|
1141
1188
|
if (!expr.value) {
|
|
1142
|
-
throw new
|
|
1189
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
1143
1190
|
"pathEquals requires a comparison value"
|
|
1144
1191
|
);
|
|
1145
1192
|
}
|
|
1146
1193
|
const valueType = resolvePredicateValueType(expr.valueType, expr.value);
|
|
1147
1194
|
if (valueType === "array" || valueType === "object") {
|
|
1148
|
-
throw new
|
|
1195
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
1149
1196
|
"pathEquals is not supported for JSON arrays or objects"
|
|
1150
1197
|
);
|
|
1151
1198
|
}
|
|
@@ -1161,7 +1208,7 @@ function compileObjectPredicate(expr, dialect, cteColumnPrefix) {
|
|
|
1161
1208
|
}
|
|
1162
1209
|
case "pathContains": {
|
|
1163
1210
|
if (!expr.value) {
|
|
1164
|
-
throw new
|
|
1211
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
1165
1212
|
"pathContains requires a comparison value"
|
|
1166
1213
|
);
|
|
1167
1214
|
}
|
|
@@ -1189,7 +1236,7 @@ function compileAggregatePredicate(expr, dialect) {
|
|
|
1189
1236
|
const aggregate = compileAggregateExpr(expr.aggregate, dialect);
|
|
1190
1237
|
const op = COMPARISON_OP_SQL[expr.op];
|
|
1191
1238
|
if (!op) {
|
|
1192
|
-
throw new
|
|
1239
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
1193
1240
|
`Comparison operation "${expr.op}" is not supported for aggregate predicates`
|
|
1194
1241
|
);
|
|
1195
1242
|
}
|
|
@@ -1224,7 +1271,7 @@ function compileAggregateExpr(expr, dialect) {
|
|
|
1224
1271
|
return drizzleOrm.sql`MAX(${field})`;
|
|
1225
1272
|
}
|
|
1226
1273
|
default: {
|
|
1227
|
-
throw new
|
|
1274
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
1228
1275
|
`Unknown aggregate function: ${expr.function}`
|
|
1229
1276
|
);
|
|
1230
1277
|
}
|
|
@@ -1232,7 +1279,7 @@ function compileAggregateExpr(expr, dialect) {
|
|
|
1232
1279
|
}
|
|
1233
1280
|
function compileExistsSubquery(expr, ctx) {
|
|
1234
1281
|
if (expr.subquery.graphId === void 0) {
|
|
1235
|
-
throw new
|
|
1282
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError("EXISTS subquery must have a graphId");
|
|
1236
1283
|
}
|
|
1237
1284
|
const subSql = ctx.compileQuery(expr.subquery, expr.subquery.graphId);
|
|
1238
1285
|
return expr.negated ? drizzleOrm.sql`NOT EXISTS (${subSql})` : drizzleOrm.sql`EXISTS (${subSql})`;
|
|
@@ -1240,7 +1287,7 @@ function compileExistsSubquery(expr, ctx) {
|
|
|
1240
1287
|
function compileInSubquery(expr, ctx) {
|
|
1241
1288
|
const subqueryColumnCount = getSubqueryColumnCount(expr.subquery);
|
|
1242
1289
|
if (subqueryColumnCount !== 1) {
|
|
1243
|
-
throw new
|
|
1290
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
1244
1291
|
`IN/NOT IN subquery must project exactly 1 column, but got ${subqueryColumnCount}`,
|
|
1245
1292
|
{ subqueryColumnCount }
|
|
1246
1293
|
);
|
|
@@ -1249,13 +1296,13 @@ function compileInSubquery(expr, ctx) {
|
|
|
1249
1296
|
const subqueryValueType = getSingleSubqueryColumnValueType(expr.subquery);
|
|
1250
1297
|
const resolvedValueType = fieldValueType ?? subqueryValueType;
|
|
1251
1298
|
if (isUnsupportedInSubqueryValueType(resolvedValueType)) {
|
|
1252
|
-
throw new
|
|
1299
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
1253
1300
|
`IN/NOT IN subquery does not support ${String(resolvedValueType)} values`,
|
|
1254
1301
|
{ valueType: resolvedValueType }
|
|
1255
1302
|
);
|
|
1256
1303
|
}
|
|
1257
1304
|
if (!isInSubqueryTypeCompatible(fieldValueType, subqueryValueType)) {
|
|
1258
|
-
throw new
|
|
1305
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
1259
1306
|
`IN/NOT IN type mismatch: field type "${String(fieldValueType)}" does not match subquery column type "${String(subqueryValueType)}"`,
|
|
1260
1307
|
{
|
|
1261
1308
|
fieldValueType,
|
|
@@ -1265,7 +1312,7 @@ function compileInSubquery(expr, ctx) {
|
|
|
1265
1312
|
}
|
|
1266
1313
|
const valueType = fieldValueType ?? subqueryValueType;
|
|
1267
1314
|
if (expr.subquery.graphId === void 0) {
|
|
1268
|
-
throw new
|
|
1315
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(
|
|
1269
1316
|
"IN/NOT IN subquery must have a graphId"
|
|
1270
1317
|
);
|
|
1271
1318
|
}
|
|
@@ -1285,7 +1332,7 @@ function extractStructuralPredicates(predicates, isMatch, rejectionMessage) {
|
|
|
1285
1332
|
function visit(expr, inDisallowedBranch) {
|
|
1286
1333
|
if (isMatch(expr)) {
|
|
1287
1334
|
if (inDisallowedBranch) {
|
|
1288
|
-
throw new
|
|
1335
|
+
throw new chunkBVRDGYXQ_cjs.UnsupportedPredicateError(rejectionMessage);
|
|
1289
1336
|
}
|
|
1290
1337
|
results.push(expr);
|
|
1291
1338
|
return;
|
|
@@ -1392,7 +1439,7 @@ function getNodeKindsForAlias(ast, alias) {
|
|
|
1392
1439
|
return traversal.nodeKinds;
|
|
1393
1440
|
}
|
|
1394
1441
|
}
|
|
1395
|
-
throw new
|
|
1442
|
+
throw new chunkBVRDGYXQ_cjs.CompilerInvariantError(`Unknown traversal source alias: ${alias}`);
|
|
1396
1443
|
}
|
|
1397
1444
|
function getHybridTargetAlias(vectorPredicate, fulltextPredicate) {
|
|
1398
1445
|
if (!vectorPredicate || !fulltextPredicate) return void 0;
|
|
@@ -1430,12 +1477,19 @@ function isPresent(value) {
|
|
|
1430
1477
|
|
|
1431
1478
|
exports.CURRENT_READ_INSTANT_PLACEHOLDER = CURRENT_READ_INSTANT_PLACEHOLDER;
|
|
1432
1479
|
exports.D1_MAX_BIND_PARAMETERS = D1_MAX_BIND_PARAMETERS;
|
|
1480
|
+
exports.DURABLE_OBJECT_MAX_BIND_PARAMETERS = DURABLE_OBJECT_MAX_BIND_PARAMETERS;
|
|
1481
|
+
exports.INTERNAL_TEMPORARY_WRITES = INTERNAL_TEMPORARY_WRITES;
|
|
1433
1482
|
exports.MODERN_SQLITE_MAX_BIND_PARAMETERS = MODERN_SQLITE_MAX_BIND_PARAMETERS;
|
|
1434
1483
|
exports.POSTGRES_CAPABILITIES = POSTGRES_CAPABILITIES;
|
|
1435
1484
|
exports.POSTGRES_MAX_BIND_PARAMETERS = POSTGRES_MAX_BIND_PARAMETERS;
|
|
1436
1485
|
exports.SQLITE_CAPABILITIES = SQLITE_CAPABILITIES;
|
|
1437
1486
|
exports.SQLITE_MAX_BIND_PARAMETERS = SQLITE_MAX_BIND_PARAMETERS;
|
|
1487
|
+
exports.annIndexScanTypes = annIndexScanTypes;
|
|
1438
1488
|
exports.arrayField = arrayField;
|
|
1489
|
+
exports.asCompiledRowsSql = asCompiledRowsSql;
|
|
1490
|
+
exports.asCompiledSelectSql = asCompiledSelectSql;
|
|
1491
|
+
exports.asCompiledStatementSql = asCompiledStatementSql;
|
|
1492
|
+
exports.asCompiledTemporaryStatementSql = asCompiledTemporaryStatementSql;
|
|
1439
1493
|
exports.baseField = baseField;
|
|
1440
1494
|
exports.buildFieldBuilderForTypeInfo = buildFieldBuilderForTypeInfo;
|
|
1441
1495
|
exports.buildPredicateIndex = buildPredicateIndex;
|
|
@@ -1464,7 +1518,11 @@ exports.inSubquery = inSubquery;
|
|
|
1464
1518
|
exports.isLiveNodeRow = isLiveNodeRow;
|
|
1465
1519
|
exports.isParameterRef = isParameterRef;
|
|
1466
1520
|
exports.isPresent = isPresent;
|
|
1521
|
+
exports.isRawExecutable = isRawExecutable;
|
|
1467
1522
|
exports.isTombstonedNodeRow = isTombstonedNodeRow;
|
|
1523
|
+
exports.markAnnIndexScan = markAnnIndexScan;
|
|
1524
|
+
exports.markForceCustomPlan = markForceCustomPlan;
|
|
1525
|
+
exports.normalizeGraphAnalyticsCapabilities = normalizeGraphAnalyticsCapabilities;
|
|
1468
1526
|
exports.notExists = notExists;
|
|
1469
1527
|
exports.notInSubquery = notInSubquery;
|
|
1470
1528
|
exports.numberField = numberField;
|
|
@@ -1473,9 +1531,10 @@ exports.param = param;
|
|
|
1473
1531
|
exports.rowPropsToJsonText = rowPropsToJsonText;
|
|
1474
1532
|
exports.rowPropsToObject = rowPropsToObject;
|
|
1475
1533
|
exports.runOptionallyInTransaction = runOptionallyInTransaction;
|
|
1534
|
+
exports.shouldForceCustomPlan = shouldForceCustomPlan;
|
|
1476
1535
|
exports.sqlValueList = sqlValueList;
|
|
1477
1536
|
exports.stringField = stringField;
|
|
1478
1537
|
exports.withPinnedReadInstant = withPinnedReadInstant;
|
|
1479
1538
|
exports.wrapWithManagedClose = wrapWithManagedClose;
|
|
1480
|
-
//# sourceMappingURL=chunk-
|
|
1481
|
-
//# sourceMappingURL=chunk-
|
|
1539
|
+
//# sourceMappingURL=chunk-IPSVVTWT.cjs.map
|
|
1540
|
+
//# sourceMappingURL=chunk-IPSVVTWT.cjs.map
|