@geodedb/client 1.1.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -491,6 +491,13 @@ function applyQueryParams(params, cfg) {
491
491
  }
492
492
  break;
493
493
  }
494
+ case "inline_timeout": {
495
+ const n = parseInt(value, 10);
496
+ if (!isNaN(n) && n > 0) {
497
+ cfg.inlineTimeout = n;
498
+ }
499
+ break;
500
+ }
494
501
  case "graph":
495
502
  cfg.graph = value;
496
503
  break;
@@ -2049,7 +2056,7 @@ function createBaseParam() {
2049
2056
  return { name: "", value: void 0 };
2050
2057
  }
2051
2058
  function createBasePullRequest() {
2052
- return { requestId: 0, pageSize: 0, sessionId: "" };
2059
+ return { requestId: 0n, pageSize: 0, sessionId: "" };
2053
2060
  }
2054
2061
  function createBasePullResponse() {
2055
2062
  return { response: void 0 };
@@ -2102,7 +2109,7 @@ function createBaseNullValue() {
2102
2109
  return {};
2103
2110
  }
2104
2111
  function createBaseIntValue() {
2105
- return { value: 0, kind: 0 };
2112
+ return { value: 0n, kind: 0 };
2106
2113
  }
2107
2114
  function createBaseDoubleValue() {
2108
2115
  return { value: 0, kind: 0 };
@@ -2126,10 +2133,10 @@ function createBaseMapValue() {
2126
2133
  return { entries: [] };
2127
2134
  }
2128
2135
  function createBaseNodeValue() {
2129
- return { id: 0, labels: [], properties: [] };
2136
+ return { id: 0n, labels: [], properties: [] };
2130
2137
  }
2131
2138
  function createBaseEdgeValue() {
2132
- return { id: 0, fromId: 0, toId: 0, label: "", properties: [] };
2139
+ return { id: 0n, fromId: 0n, toId: 0n, label: "", properties: [] };
2133
2140
  }
2134
2141
  function createBasePathValue() {
2135
2142
  return { nodes: [], edges: [] };
@@ -2148,16 +2155,16 @@ function createBaseError() {
2148
2155
  return { code: "", message: "", type: "", anchor: "" };
2149
2156
  }
2150
2157
  function createBaseExecutionMetrics() {
2151
- return { parseDurationNs: 0, planDurationNs: 0, executeDurationNs: 0, totalDurationNs: 0 };
2158
+ return { parseDurationNs: 0n, planDurationNs: 0n, executeDurationNs: 0n, totalDurationNs: 0n };
2152
2159
  }
2153
2160
  function createBaseExplainOp() {
2154
- return { idx: 0, kind: "", estRows: 0, cost: 0 };
2161
+ return { idx: 0, kind: "", estRows: 0n, cost: 0n };
2155
2162
  }
2156
2163
  function createBaseExplainTotals() {
2157
- return { estRows: 0, cost: 0 };
2164
+ return { estRows: 0n, cost: 0n };
2158
2165
  }
2159
2166
  function createBaseExplainProperties() {
2160
- return { ordered: false, limit: 0, offset: 0, distinct: false, unionMode: "", unionPartCount: 0 };
2167
+ return { ordered: false, limit: 0n, offset: 0n, distinct: false, unionMode: "", unionPartCount: 0 };
2161
2168
  }
2162
2169
  function createBaseExplainCalibrationEntry() {
2163
2170
  return { idx: 0, estRows: 0, actualRows: 0 };
@@ -2174,48 +2181,48 @@ function createBaseProfileOp() {
2174
2181
  phase: "",
2175
2182
  id: 0,
2176
2183
  opIndex: 0,
2177
- inputRows: 0,
2178
- rows: 0,
2179
- timeNs: 0,
2180
- cpuTimeNs: 0,
2181
- bytesOut: 0,
2182
- bytesAlloc: 0,
2183
- estimateBytes: 0,
2184
- estimateVsActual: 0,
2185
- percentPeak: 0,
2186
- percentNet: 0,
2187
- cumulativeTimeNs: 0,
2188
- freedBytes: 0,
2189
- netAfterOp: 0,
2190
- errorBytes: 0,
2191
- errorAbsPct: 0,
2184
+ inputRows: 0n,
2185
+ rows: 0n,
2186
+ timeNs: 0n,
2187
+ cpuTimeNs: 0n,
2188
+ bytesOut: 0n,
2189
+ bytesAlloc: 0n,
2190
+ estimateBytes: 0n,
2191
+ estimateVsActual: 0n,
2192
+ percentPeak: 0n,
2193
+ percentNet: 0n,
2194
+ cumulativeTimeNs: 0n,
2195
+ freedBytes: 0n,
2196
+ netAfterOp: 0n,
2197
+ errorBytes: 0n,
2198
+ errorAbsPct: 0n,
2192
2199
  indexName: "",
2193
2200
  selectivityEst: 0
2194
2201
  };
2195
2202
  }
2196
2203
  function createBaseProfilePeakContributor() {
2197
- return { op: "", bytesAlloc: 0 };
2204
+ return { op: "", bytesAlloc: 0n };
2198
2205
  }
2199
2206
  function createBaseProfileTotals() {
2200
- return { timeNs: 0, peakBytes: 0 };
2207
+ return { timeNs: 0n, peakBytes: 0n };
2201
2208
  }
2202
2209
  function createBaseProfileSpills() {
2203
2210
  return {
2204
- sortSpills: 0,
2205
- distinctSpills: 0,
2206
- unionSpills: 0,
2211
+ sortSpills: 0n,
2212
+ distinctSpills: 0n,
2213
+ unionSpills: 0n,
2207
2214
  spillReason: "",
2208
- peakBytesAtSpill: 0,
2215
+ peakBytesAtSpill: 0n,
2209
2216
  firstSpillOpIndex: 0
2210
2217
  };
2211
2218
  }
2212
2219
  function createBaseProfileMemory() {
2213
- return { netBytes: 0, peakBytes: 0, totalAllocBytes: 0 };
2220
+ return { netBytes: 0n, peakBytes: 0n, totalAllocBytes: 0n };
2214
2221
  }
2215
2222
  function createBaseProfilePlannerEstimates() {
2216
2223
  return {
2217
- sumEstimateBytes: 0,
2218
- sumActualBytes: 0,
2224
+ sumEstimateBytes: 0n,
2225
+ sumActualBytes: 0n,
2219
2226
  countEstimatedOps: 0,
2220
2227
  minErrorAbsPct: 0,
2221
2228
  maxErrorAbsPct: 0,
@@ -2226,10 +2233,10 @@ function createBaseProfilePlannerEstimates() {
2226
2233
  };
2227
2234
  }
2228
2235
  function createBaseProfileMemCurvePoint() {
2229
- return { opIndex: 0, netAfterOp: 0 };
2236
+ return { opIndex: 0, netAfterOp: 0n };
2230
2237
  }
2231
2238
  function createBaseProfileSetOp() {
2232
- return { type: "", mode: "", inputRows: 0, outputRows: 0, hashDedupSize: 0, distinctFillPct: 0 };
2239
+ return { type: "", mode: "", inputRows: 0n, outputRows: 0n, hashDedupSize: 0n, distinctFillPct: 0n };
2233
2240
  }
2234
2241
  function createBaseProfilePayload() {
2235
2242
  return {
@@ -2237,17 +2244,17 @@ function createBaseProfilePayload() {
2237
2244
  ops: [],
2238
2245
  peakContributors: [],
2239
2246
  totals: void 0,
2240
- totalTimeNs: 0,
2247
+ totalTimeNs: 0n,
2241
2248
  spills: void 0,
2242
2249
  memory: void 0,
2243
2250
  plannerEstimates: void 0,
2244
2251
  memCurve: [],
2245
2252
  setop: void 0,
2246
- hashaggSpills: 0,
2253
+ hashaggSpills: 0n,
2247
2254
  hashaggSpillReason: "",
2248
- committedTxns: 0,
2249
- graphStoreNodes: 0,
2250
- graphStoreEdges: 0,
2255
+ committedTxns: 0n,
2256
+ graphStoreNodes: 0n,
2257
+ graphStoreEdges: 0n,
2251
2258
  graphStoreDirty: false,
2252
2259
  flaggerFindings: [],
2253
2260
  compact: false
@@ -2293,76 +2300,76 @@ function createBaseRollbackToResponse() {
2293
2300
  return { success: false };
2294
2301
  }
2295
2302
  function createBaseCdcDiagnosticsRequest() {
2296
- return {};
2303
+ return { sessionId: "" };
2297
2304
  }
2298
2305
  function createBaseCdcDiagnosticsConfig() {
2299
2306
  return {
2300
2307
  enabled: false,
2301
- malformedSnapshotInterval: 0,
2308
+ malformedSnapshotInterval: 0n,
2302
2309
  malformedHashRetain: 0,
2303
2310
  malformedWarnPct: 0,
2304
2311
  malformedAbortPct: 0,
2305
2312
  flushIntervalMs: 0,
2306
2313
  batchSize: 0,
2307
- pendingBackpressureWatermark: 0
2314
+ pendingBackpressureWatermark: 0n
2308
2315
  };
2309
2316
  }
2310
2317
  function createBaseCdcDiagnosticsEngine() {
2311
2318
  return {
2312
2319
  isRunning: false,
2313
- lastFlushMs: 0,
2314
- peakBuffer: 0,
2315
- currentBuffer: 0,
2320
+ lastFlushMs: 0n,
2321
+ peakBuffer: 0n,
2322
+ currentBuffer: 0n,
2316
2323
  dynamicBatchSize: 0,
2317
2324
  batchAdjustments: 0
2318
2325
  };
2319
2326
  }
2320
2327
  function createBaseCdcMalformedSnapshot() {
2321
- return { count: 0, tsMs: 0 };
2328
+ return { count: 0n, tsMs: 0n };
2322
2329
  }
2323
2330
  function createBaseCdcMalformedHash() {
2324
- return { count: 0, hash: 0, tsMs: 0, prefixHex: "" };
2331
+ return { count: 0n, hash: 0n, tsMs: 0n, prefixHex: "" };
2325
2332
  }
2326
2333
  function createBaseCdcDiagnosticsResponse() {
2327
2334
  return {
2328
- malformedChangeRecords: 0,
2329
- totalChangeAttempts: 0,
2335
+ malformedChangeRecords: 0n,
2336
+ totalChangeAttempts: 0n,
2330
2337
  malformedRatio: 0,
2331
2338
  guardrailWarnTriggered: false,
2332
2339
  guardrailAbortTriggered: false,
2333
- firstWarnTsMs: 0,
2334
- firstAbortTsMs: 0,
2335
- guardrailEpoch: 0,
2336
- uptimeMs: 0,
2340
+ firstWarnTsMs: 0n,
2341
+ firstAbortTsMs: 0n,
2342
+ guardrailEpoch: 0n,
2343
+ uptimeMs: 0n,
2337
2344
  backpressure: false,
2338
2345
  config: void 0,
2339
2346
  engine: void 0,
2340
2347
  malformedSnapshots: [],
2341
2348
  malformedHashes: [],
2342
2349
  version: "",
2343
- timestampMs: 0
2350
+ timestampMs: 0n
2344
2351
  };
2345
2352
  }
2346
2353
  function createBaseCdcControlRequest() {
2347
- return { action: "" };
2354
+ return { action: "", sessionId: "" };
2348
2355
  }
2349
2356
  function createBaseCdcControlResponse() {
2350
- return { success: false, status: "", guardrailEpoch: 0 };
2357
+ return { success: false, status: "", guardrailEpoch: 0n };
2351
2358
  }
2352
2359
  function createBaseBackupRequest() {
2353
2360
  return { backupType: "", sessionId: "", compress: false };
2354
2361
  }
2355
2362
  function createBaseBackupResponse() {
2356
- return { success: false, message: "", backupId: "", backupType: "", sizeBytes: 0, compression: "", checksum: "" };
2363
+ return { success: false, message: "", backupId: "", backupType: "", sizeBytes: 0n, compression: "", checksum: "" };
2357
2364
  }
2358
2365
  function createBaseRestoreRequest() {
2359
2366
  return { targetTime: "", confirm: false, sessionId: "" };
2360
2367
  }
2361
2368
  function createBaseRestoreResponse() {
2362
- return { success: false, message: "", restoreDir: "", targetTime: "", restoreTimestamp: 0 };
2369
+ return { success: false, message: "", restoreDir: "", targetTime: "", restoreTimestamp: 0n };
2363
2370
  }
2364
2371
  function createBaseUploadBackupRequest() {
2365
- return { sizeBytes: 0, checksum: "", sessionId: "", payload: new Uint8Array(0) };
2372
+ return { sizeBytes: 0n, checksum: "", sessionId: "", payload: new Uint8Array(0) };
2366
2373
  }
2367
2374
  function createBaseUploadBackupResponse() {
2368
2375
  return { success: false, message: "", uploadPath: "" };
@@ -2390,16 +2397,6 @@ function base64FromBytes(arr) {
2390
2397
  return globalThis.btoa(bin.join(""));
2391
2398
  }
2392
2399
  }
2393
- function longToNumber(int64) {
2394
- const num = globalThis.Number(int64.toString());
2395
- if (num > globalThis.Number.MAX_SAFE_INTEGER) {
2396
- throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
2397
- }
2398
- if (num < globalThis.Number.MIN_SAFE_INTEGER) {
2399
- throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
2400
- }
2401
- return num;
2402
- }
2403
2400
  function isSet(value) {
2404
2401
  return value !== null && value !== void 0;
2405
2402
  }
@@ -3323,7 +3320,10 @@ var init_geode = __esm({
3323
3320
  };
3324
3321
  PullRequest = {
3325
3322
  encode(message, writer = new BinaryWriter()) {
3326
- if (message.requestId !== 0) {
3323
+ if (message.requestId !== 0n) {
3324
+ if (BigInt.asUintN(64, message.requestId) !== message.requestId) {
3325
+ throw new globalThis.Error("value provided for field message.requestId of type uint64 too large");
3326
+ }
3327
3327
  writer.uint32(8).uint64(message.requestId);
3328
3328
  }
3329
3329
  if (message.pageSize !== 0) {
@@ -3345,7 +3345,7 @@ var init_geode = __esm({
3345
3345
  if (tag !== 8) {
3346
3346
  break;
3347
3347
  }
3348
- message.requestId = longToNumber(reader.uint64());
3348
+ message.requestId = reader.uint64();
3349
3349
  continue;
3350
3350
  }
3351
3351
  case 2: {
@@ -3372,15 +3372,15 @@ var init_geode = __esm({
3372
3372
  },
3373
3373
  fromJSON(object) {
3374
3374
  return {
3375
- requestId: isSet(object.requestId) ? globalThis.Number(object.requestId) : isSet(object.request_id) ? globalThis.Number(object.request_id) : 0,
3375
+ requestId: isSet(object.requestId) ? BigInt(object.requestId) : isSet(object.request_id) ? BigInt(object.request_id) : 0n,
3376
3376
  pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : isSet(object.page_size) ? globalThis.Number(object.page_size) : 0,
3377
3377
  sessionId: isSet(object.sessionId) ? globalThis.String(object.sessionId) : isSet(object.session_id) ? globalThis.String(object.session_id) : ""
3378
3378
  };
3379
3379
  },
3380
3380
  toJSON(message) {
3381
3381
  const obj = {};
3382
- if (message.requestId !== 0) {
3383
- obj.requestId = Math.round(message.requestId);
3382
+ if (message.requestId !== 0n) {
3383
+ obj.requestId = message.requestId.toString();
3384
3384
  }
3385
3385
  if (message.pageSize !== 0) {
3386
3386
  obj.pageSize = Math.round(message.pageSize);
@@ -3395,7 +3395,7 @@ var init_geode = __esm({
3395
3395
  },
3396
3396
  fromPartial(object) {
3397
3397
  const message = createBasePullRequest();
3398
- message.requestId = object.requestId ?? 0;
3398
+ message.requestId = object.requestId ?? 0n;
3399
3399
  message.pageSize = object.pageSize ?? 0;
3400
3400
  message.sessionId = object.sessionId ?? "";
3401
3401
  return message;
@@ -4221,7 +4221,10 @@ var init_geode = __esm({
4221
4221
  };
4222
4222
  IntValue = {
4223
4223
  encode(message, writer = new BinaryWriter()) {
4224
- if (message.value !== 0) {
4224
+ if (message.value !== 0n) {
4225
+ if (BigInt.asIntN(64, message.value) !== message.value) {
4226
+ throw new globalThis.Error("value provided for field message.value of type int64 too large");
4227
+ }
4225
4228
  writer.uint32(8).int64(message.value);
4226
4229
  }
4227
4230
  if (message.kind !== 0) {
@@ -4240,7 +4243,7 @@ var init_geode = __esm({
4240
4243
  if (tag !== 8) {
4241
4244
  break;
4242
4245
  }
4243
- message.value = longToNumber(reader.int64());
4246
+ message.value = reader.int64();
4244
4247
  continue;
4245
4248
  }
4246
4249
  case 2: {
@@ -4260,14 +4263,14 @@ var init_geode = __esm({
4260
4263
  },
4261
4264
  fromJSON(object) {
4262
4265
  return {
4263
- value: isSet(object.value) ? globalThis.Number(object.value) : 0,
4266
+ value: isSet(object.value) ? BigInt(object.value) : 0n,
4264
4267
  kind: isSet(object.kind) ? intKindFromJSON(object.kind) : 0
4265
4268
  };
4266
4269
  },
4267
4270
  toJSON(message) {
4268
4271
  const obj = {};
4269
- if (message.value !== 0) {
4270
- obj.value = Math.round(message.value);
4272
+ if (message.value !== 0n) {
4273
+ obj.value = message.value.toString();
4271
4274
  }
4272
4275
  if (message.kind !== 0) {
4273
4276
  obj.kind = intKindToJSON(message.kind);
@@ -4279,7 +4282,7 @@ var init_geode = __esm({
4279
4282
  },
4280
4283
  fromPartial(object) {
4281
4284
  const message = createBaseIntValue();
4282
- message.value = object.value ?? 0;
4285
+ message.value = object.value ?? 0n;
4283
4286
  message.kind = object.kind ?? 0;
4284
4287
  return message;
4285
4288
  }
@@ -4739,7 +4742,10 @@ var init_geode = __esm({
4739
4742
  };
4740
4743
  NodeValue = {
4741
4744
  encode(message, writer = new BinaryWriter()) {
4742
- if (message.id !== 0) {
4745
+ if (message.id !== 0n) {
4746
+ if (BigInt.asUintN(64, message.id) !== message.id) {
4747
+ throw new globalThis.Error("value provided for field message.id of type uint64 too large");
4748
+ }
4743
4749
  writer.uint32(8).uint64(message.id);
4744
4750
  }
4745
4751
  for (const v of message.labels) {
@@ -4761,7 +4767,7 @@ var init_geode = __esm({
4761
4767
  if (tag !== 8) {
4762
4768
  break;
4763
4769
  }
4764
- message.id = longToNumber(reader.uint64());
4770
+ message.id = reader.uint64();
4765
4771
  continue;
4766
4772
  }
4767
4773
  case 2: {
@@ -4788,15 +4794,15 @@ var init_geode = __esm({
4788
4794
  },
4789
4795
  fromJSON(object) {
4790
4796
  return {
4791
- id: isSet(object.id) ? globalThis.Number(object.id) : 0,
4797
+ id: isSet(object.id) ? BigInt(object.id) : 0n,
4792
4798
  labels: globalThis.Array.isArray(object?.labels) ? object.labels.map((e) => globalThis.String(e)) : [],
4793
4799
  properties: globalThis.Array.isArray(object?.properties) ? object.properties.map((e) => MapEntry.fromJSON(e)) : []
4794
4800
  };
4795
4801
  },
4796
4802
  toJSON(message) {
4797
4803
  const obj = {};
4798
- if (message.id !== 0) {
4799
- obj.id = Math.round(message.id);
4804
+ if (message.id !== 0n) {
4805
+ obj.id = message.id.toString();
4800
4806
  }
4801
4807
  if (message.labels?.length) {
4802
4808
  obj.labels = message.labels;
@@ -4811,7 +4817,7 @@ var init_geode = __esm({
4811
4817
  },
4812
4818
  fromPartial(object) {
4813
4819
  const message = createBaseNodeValue();
4814
- message.id = object.id ?? 0;
4820
+ message.id = object.id ?? 0n;
4815
4821
  message.labels = object.labels?.map((e) => e) || [];
4816
4822
  message.properties = object.properties?.map((e) => MapEntry.fromPartial(e)) || [];
4817
4823
  return message;
@@ -4819,13 +4825,22 @@ var init_geode = __esm({
4819
4825
  };
4820
4826
  EdgeValue = {
4821
4827
  encode(message, writer = new BinaryWriter()) {
4822
- if (message.id !== 0) {
4828
+ if (message.id !== 0n) {
4829
+ if (BigInt.asUintN(64, message.id) !== message.id) {
4830
+ throw new globalThis.Error("value provided for field message.id of type uint64 too large");
4831
+ }
4823
4832
  writer.uint32(8).uint64(message.id);
4824
4833
  }
4825
- if (message.fromId !== 0) {
4834
+ if (message.fromId !== 0n) {
4835
+ if (BigInt.asUintN(64, message.fromId) !== message.fromId) {
4836
+ throw new globalThis.Error("value provided for field message.fromId of type uint64 too large");
4837
+ }
4826
4838
  writer.uint32(16).uint64(message.fromId);
4827
4839
  }
4828
- if (message.toId !== 0) {
4840
+ if (message.toId !== 0n) {
4841
+ if (BigInt.asUintN(64, message.toId) !== message.toId) {
4842
+ throw new globalThis.Error("value provided for field message.toId of type uint64 too large");
4843
+ }
4829
4844
  writer.uint32(24).uint64(message.toId);
4830
4845
  }
4831
4846
  if (message.label !== "") {
@@ -4847,21 +4862,21 @@ var init_geode = __esm({
4847
4862
  if (tag !== 8) {
4848
4863
  break;
4849
4864
  }
4850
- message.id = longToNumber(reader.uint64());
4865
+ message.id = reader.uint64();
4851
4866
  continue;
4852
4867
  }
4853
4868
  case 2: {
4854
4869
  if (tag !== 16) {
4855
4870
  break;
4856
4871
  }
4857
- message.fromId = longToNumber(reader.uint64());
4872
+ message.fromId = reader.uint64();
4858
4873
  continue;
4859
4874
  }
4860
4875
  case 3: {
4861
4876
  if (tag !== 24) {
4862
4877
  break;
4863
4878
  }
4864
- message.toId = longToNumber(reader.uint64());
4879
+ message.toId = reader.uint64();
4865
4880
  continue;
4866
4881
  }
4867
4882
  case 4: {
@@ -4888,23 +4903,23 @@ var init_geode = __esm({
4888
4903
  },
4889
4904
  fromJSON(object) {
4890
4905
  return {
4891
- id: isSet(object.id) ? globalThis.Number(object.id) : 0,
4892
- fromId: isSet(object.fromId) ? globalThis.Number(object.fromId) : isSet(object.from_id) ? globalThis.Number(object.from_id) : 0,
4893
- toId: isSet(object.toId) ? globalThis.Number(object.toId) : isSet(object.to_id) ? globalThis.Number(object.to_id) : 0,
4906
+ id: isSet(object.id) ? BigInt(object.id) : 0n,
4907
+ fromId: isSet(object.fromId) ? BigInt(object.fromId) : isSet(object.from_id) ? BigInt(object.from_id) : 0n,
4908
+ toId: isSet(object.toId) ? BigInt(object.toId) : isSet(object.to_id) ? BigInt(object.to_id) : 0n,
4894
4909
  label: isSet(object.label) ? globalThis.String(object.label) : "",
4895
4910
  properties: globalThis.Array.isArray(object?.properties) ? object.properties.map((e) => MapEntry.fromJSON(e)) : []
4896
4911
  };
4897
4912
  },
4898
4913
  toJSON(message) {
4899
4914
  const obj = {};
4900
- if (message.id !== 0) {
4901
- obj.id = Math.round(message.id);
4915
+ if (message.id !== 0n) {
4916
+ obj.id = message.id.toString();
4902
4917
  }
4903
- if (message.fromId !== 0) {
4904
- obj.fromId = Math.round(message.fromId);
4918
+ if (message.fromId !== 0n) {
4919
+ obj.fromId = message.fromId.toString();
4905
4920
  }
4906
- if (message.toId !== 0) {
4907
- obj.toId = Math.round(message.toId);
4921
+ if (message.toId !== 0n) {
4922
+ obj.toId = message.toId.toString();
4908
4923
  }
4909
4924
  if (message.label !== "") {
4910
4925
  obj.label = message.label;
@@ -4919,9 +4934,9 @@ var init_geode = __esm({
4919
4934
  },
4920
4935
  fromPartial(object) {
4921
4936
  const message = createBaseEdgeValue();
4922
- message.id = object.id ?? 0;
4923
- message.fromId = object.fromId ?? 0;
4924
- message.toId = object.toId ?? 0;
4937
+ message.id = object.id ?? 0n;
4938
+ message.fromId = object.fromId ?? 0n;
4939
+ message.toId = object.toId ?? 0n;
4925
4940
  message.label = object.label ?? "";
4926
4941
  message.properties = object.properties?.map((e) => MapEntry.fromPartial(e)) || [];
4927
4942
  return message;
@@ -5004,6 +5019,9 @@ var init_geode = __esm({
5004
5019
  writer.uint32(26).bytes(message.bytes);
5005
5020
  }
5006
5021
  if (message.intVal !== void 0) {
5022
+ if (BigInt.asIntN(64, message.intVal) !== message.intVal) {
5023
+ throw new globalThis.Error("value provided for field message.intVal of type int64 too large");
5024
+ }
5007
5025
  writer.uint32(32).int64(message.intVal);
5008
5026
  }
5009
5027
  if (message.doubleVal !== void 0) {
@@ -5046,7 +5064,7 @@ var init_geode = __esm({
5046
5064
  if (tag !== 32) {
5047
5065
  break;
5048
5066
  }
5049
- message.intVal = longToNumber(reader.int64());
5067
+ message.intVal = reader.int64();
5050
5068
  continue;
5051
5069
  }
5052
5070
  case 5: {
@@ -5076,7 +5094,7 @@ var init_geode = __esm({
5076
5094
  typeName: isSet(object.typeName) ? globalThis.String(object.typeName) : isSet(object.type_name) ? globalThis.String(object.type_name) : "",
5077
5095
  text: isSet(object.text) ? globalThis.String(object.text) : void 0,
5078
5096
  bytes: isSet(object.bytes) ? bytesFromBase64(object.bytes) : void 0,
5079
- intVal: isSet(object.intVal) ? globalThis.Number(object.intVal) : isSet(object.int_val) ? globalThis.Number(object.int_val) : void 0,
5097
+ intVal: isSet(object.intVal) ? BigInt(object.intVal) : isSet(object.int_val) ? BigInt(object.int_val) : void 0,
5080
5098
  doubleVal: isSet(object.doubleVal) ? globalThis.Number(object.doubleVal) : isSet(object.double_val) ? globalThis.Number(object.double_val) : void 0,
5081
5099
  boolVal: isSet(object.boolVal) ? globalThis.Boolean(object.boolVal) : isSet(object.bool_val) ? globalThis.Boolean(object.bool_val) : void 0
5082
5100
  };
@@ -5093,7 +5111,7 @@ var init_geode = __esm({
5093
5111
  obj.bytes = base64FromBytes(message.bytes);
5094
5112
  }
5095
5113
  if (message.intVal !== void 0) {
5096
- obj.intVal = Math.round(message.intVal);
5114
+ obj.intVal = message.intVal.toString();
5097
5115
  }
5098
5116
  if (message.doubleVal !== void 0) {
5099
5117
  obj.doubleVal = message.doubleVal;
@@ -5214,16 +5232,28 @@ var init_geode = __esm({
5214
5232
  };
5215
5233
  ExecutionMetrics = {
5216
5234
  encode(message, writer = new BinaryWriter()) {
5217
- if (message.parseDurationNs !== 0) {
5235
+ if (message.parseDurationNs !== 0n) {
5236
+ if (BigInt.asIntN(64, message.parseDurationNs) !== message.parseDurationNs) {
5237
+ throw new globalThis.Error("value provided for field message.parseDurationNs of type int64 too large");
5238
+ }
5218
5239
  writer.uint32(8).int64(message.parseDurationNs);
5219
5240
  }
5220
- if (message.planDurationNs !== 0) {
5241
+ if (message.planDurationNs !== 0n) {
5242
+ if (BigInt.asIntN(64, message.planDurationNs) !== message.planDurationNs) {
5243
+ throw new globalThis.Error("value provided for field message.planDurationNs of type int64 too large");
5244
+ }
5221
5245
  writer.uint32(16).int64(message.planDurationNs);
5222
5246
  }
5223
- if (message.executeDurationNs !== 0) {
5247
+ if (message.executeDurationNs !== 0n) {
5248
+ if (BigInt.asIntN(64, message.executeDurationNs) !== message.executeDurationNs) {
5249
+ throw new globalThis.Error("value provided for field message.executeDurationNs of type int64 too large");
5250
+ }
5224
5251
  writer.uint32(24).int64(message.executeDurationNs);
5225
5252
  }
5226
- if (message.totalDurationNs !== 0) {
5253
+ if (message.totalDurationNs !== 0n) {
5254
+ if (BigInt.asIntN(64, message.totalDurationNs) !== message.totalDurationNs) {
5255
+ throw new globalThis.Error("value provided for field message.totalDurationNs of type int64 too large");
5256
+ }
5227
5257
  writer.uint32(32).int64(message.totalDurationNs);
5228
5258
  }
5229
5259
  return writer;
@@ -5239,28 +5269,28 @@ var init_geode = __esm({
5239
5269
  if (tag !== 8) {
5240
5270
  break;
5241
5271
  }
5242
- message.parseDurationNs = longToNumber(reader.int64());
5272
+ message.parseDurationNs = reader.int64();
5243
5273
  continue;
5244
5274
  }
5245
5275
  case 2: {
5246
5276
  if (tag !== 16) {
5247
5277
  break;
5248
5278
  }
5249
- message.planDurationNs = longToNumber(reader.int64());
5279
+ message.planDurationNs = reader.int64();
5250
5280
  continue;
5251
5281
  }
5252
5282
  case 3: {
5253
5283
  if (tag !== 24) {
5254
5284
  break;
5255
5285
  }
5256
- message.executeDurationNs = longToNumber(reader.int64());
5286
+ message.executeDurationNs = reader.int64();
5257
5287
  continue;
5258
5288
  }
5259
5289
  case 4: {
5260
5290
  if (tag !== 32) {
5261
5291
  break;
5262
5292
  }
5263
- message.totalDurationNs = longToNumber(reader.int64());
5293
+ message.totalDurationNs = reader.int64();
5264
5294
  continue;
5265
5295
  }
5266
5296
  }
@@ -5273,25 +5303,25 @@ var init_geode = __esm({
5273
5303
  },
5274
5304
  fromJSON(object) {
5275
5305
  return {
5276
- parseDurationNs: isSet(object.parseDurationNs) ? globalThis.Number(object.parseDurationNs) : isSet(object.parse_duration_ns) ? globalThis.Number(object.parse_duration_ns) : 0,
5277
- planDurationNs: isSet(object.planDurationNs) ? globalThis.Number(object.planDurationNs) : isSet(object.plan_duration_ns) ? globalThis.Number(object.plan_duration_ns) : 0,
5278
- executeDurationNs: isSet(object.executeDurationNs) ? globalThis.Number(object.executeDurationNs) : isSet(object.execute_duration_ns) ? globalThis.Number(object.execute_duration_ns) : 0,
5279
- totalDurationNs: isSet(object.totalDurationNs) ? globalThis.Number(object.totalDurationNs) : isSet(object.total_duration_ns) ? globalThis.Number(object.total_duration_ns) : 0
5306
+ parseDurationNs: isSet(object.parseDurationNs) ? BigInt(object.parseDurationNs) : isSet(object.parse_duration_ns) ? BigInt(object.parse_duration_ns) : 0n,
5307
+ planDurationNs: isSet(object.planDurationNs) ? BigInt(object.planDurationNs) : isSet(object.plan_duration_ns) ? BigInt(object.plan_duration_ns) : 0n,
5308
+ executeDurationNs: isSet(object.executeDurationNs) ? BigInt(object.executeDurationNs) : isSet(object.execute_duration_ns) ? BigInt(object.execute_duration_ns) : 0n,
5309
+ totalDurationNs: isSet(object.totalDurationNs) ? BigInt(object.totalDurationNs) : isSet(object.total_duration_ns) ? BigInt(object.total_duration_ns) : 0n
5280
5310
  };
5281
5311
  },
5282
5312
  toJSON(message) {
5283
5313
  const obj = {};
5284
- if (message.parseDurationNs !== 0) {
5285
- obj.parseDurationNs = Math.round(message.parseDurationNs);
5314
+ if (message.parseDurationNs !== 0n) {
5315
+ obj.parseDurationNs = message.parseDurationNs.toString();
5286
5316
  }
5287
- if (message.planDurationNs !== 0) {
5288
- obj.planDurationNs = Math.round(message.planDurationNs);
5317
+ if (message.planDurationNs !== 0n) {
5318
+ obj.planDurationNs = message.planDurationNs.toString();
5289
5319
  }
5290
- if (message.executeDurationNs !== 0) {
5291
- obj.executeDurationNs = Math.round(message.executeDurationNs);
5320
+ if (message.executeDurationNs !== 0n) {
5321
+ obj.executeDurationNs = message.executeDurationNs.toString();
5292
5322
  }
5293
- if (message.totalDurationNs !== 0) {
5294
- obj.totalDurationNs = Math.round(message.totalDurationNs);
5323
+ if (message.totalDurationNs !== 0n) {
5324
+ obj.totalDurationNs = message.totalDurationNs.toString();
5295
5325
  }
5296
5326
  return obj;
5297
5327
  },
@@ -5300,10 +5330,10 @@ var init_geode = __esm({
5300
5330
  },
5301
5331
  fromPartial(object) {
5302
5332
  const message = createBaseExecutionMetrics();
5303
- message.parseDurationNs = object.parseDurationNs ?? 0;
5304
- message.planDurationNs = object.planDurationNs ?? 0;
5305
- message.executeDurationNs = object.executeDurationNs ?? 0;
5306
- message.totalDurationNs = object.totalDurationNs ?? 0;
5333
+ message.parseDurationNs = object.parseDurationNs ?? 0n;
5334
+ message.planDurationNs = object.planDurationNs ?? 0n;
5335
+ message.executeDurationNs = object.executeDurationNs ?? 0n;
5336
+ message.totalDurationNs = object.totalDurationNs ?? 0n;
5307
5337
  return message;
5308
5338
  }
5309
5339
  };
@@ -5315,10 +5345,16 @@ var init_geode = __esm({
5315
5345
  if (message.kind !== "") {
5316
5346
  writer.uint32(18).string(message.kind);
5317
5347
  }
5318
- if (message.estRows !== 0) {
5348
+ if (message.estRows !== 0n) {
5349
+ if (BigInt.asIntN(64, message.estRows) !== message.estRows) {
5350
+ throw new globalThis.Error("value provided for field message.estRows of type int64 too large");
5351
+ }
5319
5352
  writer.uint32(24).int64(message.estRows);
5320
5353
  }
5321
- if (message.cost !== 0) {
5354
+ if (message.cost !== 0n) {
5355
+ if (BigInt.asIntN(64, message.cost) !== message.cost) {
5356
+ throw new globalThis.Error("value provided for field message.cost of type int64 too large");
5357
+ }
5322
5358
  writer.uint32(32).int64(message.cost);
5323
5359
  }
5324
5360
  return writer;
@@ -5348,14 +5384,14 @@ var init_geode = __esm({
5348
5384
  if (tag !== 24) {
5349
5385
  break;
5350
5386
  }
5351
- message.estRows = longToNumber(reader.int64());
5387
+ message.estRows = reader.int64();
5352
5388
  continue;
5353
5389
  }
5354
5390
  case 4: {
5355
5391
  if (tag !== 32) {
5356
5392
  break;
5357
5393
  }
5358
- message.cost = longToNumber(reader.int64());
5394
+ message.cost = reader.int64();
5359
5395
  continue;
5360
5396
  }
5361
5397
  }
@@ -5370,8 +5406,8 @@ var init_geode = __esm({
5370
5406
  return {
5371
5407
  idx: isSet(object.idx) ? globalThis.Number(object.idx) : 0,
5372
5408
  kind: isSet(object.kind) ? globalThis.String(object.kind) : "",
5373
- estRows: isSet(object.estRows) ? globalThis.Number(object.estRows) : isSet(object.est_rows) ? globalThis.Number(object.est_rows) : 0,
5374
- cost: isSet(object.cost) ? globalThis.Number(object.cost) : 0
5409
+ estRows: isSet(object.estRows) ? BigInt(object.estRows) : isSet(object.est_rows) ? BigInt(object.est_rows) : 0n,
5410
+ cost: isSet(object.cost) ? BigInt(object.cost) : 0n
5375
5411
  };
5376
5412
  },
5377
5413
  toJSON(message) {
@@ -5382,11 +5418,11 @@ var init_geode = __esm({
5382
5418
  if (message.kind !== "") {
5383
5419
  obj.kind = message.kind;
5384
5420
  }
5385
- if (message.estRows !== 0) {
5386
- obj.estRows = Math.round(message.estRows);
5421
+ if (message.estRows !== 0n) {
5422
+ obj.estRows = message.estRows.toString();
5387
5423
  }
5388
- if (message.cost !== 0) {
5389
- obj.cost = Math.round(message.cost);
5424
+ if (message.cost !== 0n) {
5425
+ obj.cost = message.cost.toString();
5390
5426
  }
5391
5427
  return obj;
5392
5428
  },
@@ -5397,17 +5433,23 @@ var init_geode = __esm({
5397
5433
  const message = createBaseExplainOp();
5398
5434
  message.idx = object.idx ?? 0;
5399
5435
  message.kind = object.kind ?? "";
5400
- message.estRows = object.estRows ?? 0;
5401
- message.cost = object.cost ?? 0;
5436
+ message.estRows = object.estRows ?? 0n;
5437
+ message.cost = object.cost ?? 0n;
5402
5438
  return message;
5403
5439
  }
5404
5440
  };
5405
5441
  ExplainTotals = {
5406
5442
  encode(message, writer = new BinaryWriter()) {
5407
- if (message.estRows !== 0) {
5443
+ if (message.estRows !== 0n) {
5444
+ if (BigInt.asIntN(64, message.estRows) !== message.estRows) {
5445
+ throw new globalThis.Error("value provided for field message.estRows of type int64 too large");
5446
+ }
5408
5447
  writer.uint32(8).int64(message.estRows);
5409
5448
  }
5410
- if (message.cost !== 0) {
5449
+ if (message.cost !== 0n) {
5450
+ if (BigInt.asIntN(64, message.cost) !== message.cost) {
5451
+ throw new globalThis.Error("value provided for field message.cost of type int64 too large");
5452
+ }
5411
5453
  writer.uint32(16).int64(message.cost);
5412
5454
  }
5413
5455
  return writer;
@@ -5423,14 +5465,14 @@ var init_geode = __esm({
5423
5465
  if (tag !== 8) {
5424
5466
  break;
5425
5467
  }
5426
- message.estRows = longToNumber(reader.int64());
5468
+ message.estRows = reader.int64();
5427
5469
  continue;
5428
5470
  }
5429
5471
  case 2: {
5430
5472
  if (tag !== 16) {
5431
5473
  break;
5432
5474
  }
5433
- message.cost = longToNumber(reader.int64());
5475
+ message.cost = reader.int64();
5434
5476
  continue;
5435
5477
  }
5436
5478
  }
@@ -5443,17 +5485,17 @@ var init_geode = __esm({
5443
5485
  },
5444
5486
  fromJSON(object) {
5445
5487
  return {
5446
- estRows: isSet(object.estRows) ? globalThis.Number(object.estRows) : isSet(object.est_rows) ? globalThis.Number(object.est_rows) : 0,
5447
- cost: isSet(object.cost) ? globalThis.Number(object.cost) : 0
5488
+ estRows: isSet(object.estRows) ? BigInt(object.estRows) : isSet(object.est_rows) ? BigInt(object.est_rows) : 0n,
5489
+ cost: isSet(object.cost) ? BigInt(object.cost) : 0n
5448
5490
  };
5449
5491
  },
5450
5492
  toJSON(message) {
5451
5493
  const obj = {};
5452
- if (message.estRows !== 0) {
5453
- obj.estRows = Math.round(message.estRows);
5494
+ if (message.estRows !== 0n) {
5495
+ obj.estRows = message.estRows.toString();
5454
5496
  }
5455
- if (message.cost !== 0) {
5456
- obj.cost = Math.round(message.cost);
5497
+ if (message.cost !== 0n) {
5498
+ obj.cost = message.cost.toString();
5457
5499
  }
5458
5500
  return obj;
5459
5501
  },
@@ -5462,8 +5504,8 @@ var init_geode = __esm({
5462
5504
  },
5463
5505
  fromPartial(object) {
5464
5506
  const message = createBaseExplainTotals();
5465
- message.estRows = object.estRows ?? 0;
5466
- message.cost = object.cost ?? 0;
5507
+ message.estRows = object.estRows ?? 0n;
5508
+ message.cost = object.cost ?? 0n;
5467
5509
  return message;
5468
5510
  }
5469
5511
  };
@@ -5472,10 +5514,16 @@ var init_geode = __esm({
5472
5514
  if (message.ordered !== false) {
5473
5515
  writer.uint32(8).bool(message.ordered);
5474
5516
  }
5475
- if (message.limit !== 0) {
5517
+ if (message.limit !== 0n) {
5518
+ if (BigInt.asUintN(64, message.limit) !== message.limit) {
5519
+ throw new globalThis.Error("value provided for field message.limit of type uint64 too large");
5520
+ }
5476
5521
  writer.uint32(16).uint64(message.limit);
5477
5522
  }
5478
- if (message.offset !== 0) {
5523
+ if (message.offset !== 0n) {
5524
+ if (BigInt.asUintN(64, message.offset) !== message.offset) {
5525
+ throw new globalThis.Error("value provided for field message.offset of type uint64 too large");
5526
+ }
5479
5527
  writer.uint32(24).uint64(message.offset);
5480
5528
  }
5481
5529
  if (message.distinct !== false) {
@@ -5507,14 +5555,14 @@ var init_geode = __esm({
5507
5555
  if (tag !== 16) {
5508
5556
  break;
5509
5557
  }
5510
- message.limit = longToNumber(reader.uint64());
5558
+ message.limit = reader.uint64();
5511
5559
  continue;
5512
5560
  }
5513
5561
  case 3: {
5514
5562
  if (tag !== 24) {
5515
5563
  break;
5516
5564
  }
5517
- message.offset = longToNumber(reader.uint64());
5565
+ message.offset = reader.uint64();
5518
5566
  continue;
5519
5567
  }
5520
5568
  case 4: {
@@ -5549,8 +5597,8 @@ var init_geode = __esm({
5549
5597
  fromJSON(object) {
5550
5598
  return {
5551
5599
  ordered: isSet(object.ordered) ? globalThis.Boolean(object.ordered) : false,
5552
- limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
5553
- offset: isSet(object.offset) ? globalThis.Number(object.offset) : 0,
5600
+ limit: isSet(object.limit) ? BigInt(object.limit) : 0n,
5601
+ offset: isSet(object.offset) ? BigInt(object.offset) : 0n,
5554
5602
  distinct: isSet(object.distinct) ? globalThis.Boolean(object.distinct) : false,
5555
5603
  unionMode: isSet(object.unionMode) ? globalThis.String(object.unionMode) : isSet(object.union_mode) ? globalThis.String(object.union_mode) : "",
5556
5604
  unionPartCount: isSet(object.unionPartCount) ? globalThis.Number(object.unionPartCount) : isSet(object.union_part_count) ? globalThis.Number(object.union_part_count) : 0
@@ -5561,11 +5609,11 @@ var init_geode = __esm({
5561
5609
  if (message.ordered !== false) {
5562
5610
  obj.ordered = message.ordered;
5563
5611
  }
5564
- if (message.limit !== 0) {
5565
- obj.limit = Math.round(message.limit);
5612
+ if (message.limit !== 0n) {
5613
+ obj.limit = message.limit.toString();
5566
5614
  }
5567
- if (message.offset !== 0) {
5568
- obj.offset = Math.round(message.offset);
5615
+ if (message.offset !== 0n) {
5616
+ obj.offset = message.offset.toString();
5569
5617
  }
5570
5618
  if (message.distinct !== false) {
5571
5619
  obj.distinct = message.distinct;
@@ -5584,8 +5632,8 @@ var init_geode = __esm({
5584
5632
  fromPartial(object) {
5585
5633
  const message = createBaseExplainProperties();
5586
5634
  message.ordered = object.ordered ?? false;
5587
- message.limit = object.limit ?? 0;
5588
- message.offset = object.offset ?? 0;
5635
+ message.limit = object.limit ?? 0n;
5636
+ message.offset = object.offset ?? 0n;
5589
5637
  message.distinct = object.distinct ?? false;
5590
5638
  message.unionMode = object.unionMode ?? "";
5591
5639
  message.unionPartCount = object.unionPartCount ?? 0;
@@ -5876,49 +5924,94 @@ var init_geode = __esm({
5876
5924
  if (message.opIndex !== 0) {
5877
5925
  writer.uint32(32).uint32(message.opIndex);
5878
5926
  }
5879
- if (message.inputRows !== 0) {
5927
+ if (message.inputRows !== 0n) {
5928
+ if (BigInt.asUintN(64, message.inputRows) !== message.inputRows) {
5929
+ throw new globalThis.Error("value provided for field message.inputRows of type uint64 too large");
5930
+ }
5880
5931
  writer.uint32(40).uint64(message.inputRows);
5881
5932
  }
5882
- if (message.rows !== 0) {
5933
+ if (message.rows !== 0n) {
5934
+ if (BigInt.asUintN(64, message.rows) !== message.rows) {
5935
+ throw new globalThis.Error("value provided for field message.rows of type uint64 too large");
5936
+ }
5883
5937
  writer.uint32(48).uint64(message.rows);
5884
5938
  }
5885
- if (message.timeNs !== 0) {
5939
+ if (message.timeNs !== 0n) {
5940
+ if (BigInt.asUintN(64, message.timeNs) !== message.timeNs) {
5941
+ throw new globalThis.Error("value provided for field message.timeNs of type uint64 too large");
5942
+ }
5886
5943
  writer.uint32(56).uint64(message.timeNs);
5887
5944
  }
5888
- if (message.cpuTimeNs !== 0) {
5945
+ if (message.cpuTimeNs !== 0n) {
5946
+ if (BigInt.asUintN(64, message.cpuTimeNs) !== message.cpuTimeNs) {
5947
+ throw new globalThis.Error("value provided for field message.cpuTimeNs of type uint64 too large");
5948
+ }
5889
5949
  writer.uint32(64).uint64(message.cpuTimeNs);
5890
5950
  }
5891
- if (message.bytesOut !== 0) {
5951
+ if (message.bytesOut !== 0n) {
5952
+ if (BigInt.asUintN(64, message.bytesOut) !== message.bytesOut) {
5953
+ throw new globalThis.Error("value provided for field message.bytesOut of type uint64 too large");
5954
+ }
5892
5955
  writer.uint32(72).uint64(message.bytesOut);
5893
5956
  }
5894
- if (message.bytesAlloc !== 0) {
5957
+ if (message.bytesAlloc !== 0n) {
5958
+ if (BigInt.asUintN(64, message.bytesAlloc) !== message.bytesAlloc) {
5959
+ throw new globalThis.Error("value provided for field message.bytesAlloc of type uint64 too large");
5960
+ }
5895
5961
  writer.uint32(80).uint64(message.bytesAlloc);
5896
5962
  }
5897
- if (message.estimateBytes !== 0) {
5963
+ if (message.estimateBytes !== 0n) {
5964
+ if (BigInt.asUintN(64, message.estimateBytes) !== message.estimateBytes) {
5965
+ throw new globalThis.Error("value provided for field message.estimateBytes of type uint64 too large");
5966
+ }
5898
5967
  writer.uint32(88).uint64(message.estimateBytes);
5899
5968
  }
5900
- if (message.estimateVsActual !== 0) {
5969
+ if (message.estimateVsActual !== 0n) {
5970
+ if (BigInt.asUintN(64, message.estimateVsActual) !== message.estimateVsActual) {
5971
+ throw new globalThis.Error("value provided for field message.estimateVsActual of type uint64 too large");
5972
+ }
5901
5973
  writer.uint32(96).uint64(message.estimateVsActual);
5902
5974
  }
5903
- if (message.percentPeak !== 0) {
5975
+ if (message.percentPeak !== 0n) {
5976
+ if (BigInt.asUintN(64, message.percentPeak) !== message.percentPeak) {
5977
+ throw new globalThis.Error("value provided for field message.percentPeak of type uint64 too large");
5978
+ }
5904
5979
  writer.uint32(104).uint64(message.percentPeak);
5905
5980
  }
5906
- if (message.percentNet !== 0) {
5981
+ if (message.percentNet !== 0n) {
5982
+ if (BigInt.asUintN(64, message.percentNet) !== message.percentNet) {
5983
+ throw new globalThis.Error("value provided for field message.percentNet of type uint64 too large");
5984
+ }
5907
5985
  writer.uint32(112).uint64(message.percentNet);
5908
5986
  }
5909
- if (message.cumulativeTimeNs !== 0) {
5987
+ if (message.cumulativeTimeNs !== 0n) {
5988
+ if (BigInt.asUintN(64, message.cumulativeTimeNs) !== message.cumulativeTimeNs) {
5989
+ throw new globalThis.Error("value provided for field message.cumulativeTimeNs of type uint64 too large");
5990
+ }
5910
5991
  writer.uint32(120).uint64(message.cumulativeTimeNs);
5911
5992
  }
5912
- if (message.freedBytes !== 0) {
5993
+ if (message.freedBytes !== 0n) {
5994
+ if (BigInt.asUintN(64, message.freedBytes) !== message.freedBytes) {
5995
+ throw new globalThis.Error("value provided for field message.freedBytes of type uint64 too large");
5996
+ }
5913
5997
  writer.uint32(128).uint64(message.freedBytes);
5914
5998
  }
5915
- if (message.netAfterOp !== 0) {
5999
+ if (message.netAfterOp !== 0n) {
6000
+ if (BigInt.asUintN(64, message.netAfterOp) !== message.netAfterOp) {
6001
+ throw new globalThis.Error("value provided for field message.netAfterOp of type uint64 too large");
6002
+ }
5916
6003
  writer.uint32(136).uint64(message.netAfterOp);
5917
6004
  }
5918
- if (message.errorBytes !== 0) {
6005
+ if (message.errorBytes !== 0n) {
6006
+ if (BigInt.asUintN(64, message.errorBytes) !== message.errorBytes) {
6007
+ throw new globalThis.Error("value provided for field message.errorBytes of type uint64 too large");
6008
+ }
5919
6009
  writer.uint32(144).uint64(message.errorBytes);
5920
6010
  }
5921
- if (message.errorAbsPct !== 0) {
6011
+ if (message.errorAbsPct !== 0n) {
6012
+ if (BigInt.asUintN(64, message.errorAbsPct) !== message.errorAbsPct) {
6013
+ throw new globalThis.Error("value provided for field message.errorAbsPct of type uint64 too large");
6014
+ }
5922
6015
  writer.uint32(152).uint64(message.errorAbsPct);
5923
6016
  }
5924
6017
  if (message.indexName !== "") {
@@ -5968,105 +6061,105 @@ var init_geode = __esm({
5968
6061
  if (tag !== 40) {
5969
6062
  break;
5970
6063
  }
5971
- message.inputRows = longToNumber(reader.uint64());
6064
+ message.inputRows = reader.uint64();
5972
6065
  continue;
5973
6066
  }
5974
6067
  case 6: {
5975
6068
  if (tag !== 48) {
5976
6069
  break;
5977
6070
  }
5978
- message.rows = longToNumber(reader.uint64());
6071
+ message.rows = reader.uint64();
5979
6072
  continue;
5980
6073
  }
5981
6074
  case 7: {
5982
6075
  if (tag !== 56) {
5983
6076
  break;
5984
6077
  }
5985
- message.timeNs = longToNumber(reader.uint64());
6078
+ message.timeNs = reader.uint64();
5986
6079
  continue;
5987
6080
  }
5988
6081
  case 8: {
5989
6082
  if (tag !== 64) {
5990
6083
  break;
5991
6084
  }
5992
- message.cpuTimeNs = longToNumber(reader.uint64());
6085
+ message.cpuTimeNs = reader.uint64();
5993
6086
  continue;
5994
6087
  }
5995
6088
  case 9: {
5996
6089
  if (tag !== 72) {
5997
6090
  break;
5998
6091
  }
5999
- message.bytesOut = longToNumber(reader.uint64());
6092
+ message.bytesOut = reader.uint64();
6000
6093
  continue;
6001
6094
  }
6002
6095
  case 10: {
6003
6096
  if (tag !== 80) {
6004
6097
  break;
6005
6098
  }
6006
- message.bytesAlloc = longToNumber(reader.uint64());
6099
+ message.bytesAlloc = reader.uint64();
6007
6100
  continue;
6008
6101
  }
6009
6102
  case 11: {
6010
6103
  if (tag !== 88) {
6011
6104
  break;
6012
6105
  }
6013
- message.estimateBytes = longToNumber(reader.uint64());
6106
+ message.estimateBytes = reader.uint64();
6014
6107
  continue;
6015
6108
  }
6016
6109
  case 12: {
6017
6110
  if (tag !== 96) {
6018
6111
  break;
6019
6112
  }
6020
- message.estimateVsActual = longToNumber(reader.uint64());
6113
+ message.estimateVsActual = reader.uint64();
6021
6114
  continue;
6022
6115
  }
6023
6116
  case 13: {
6024
6117
  if (tag !== 104) {
6025
6118
  break;
6026
6119
  }
6027
- message.percentPeak = longToNumber(reader.uint64());
6120
+ message.percentPeak = reader.uint64();
6028
6121
  continue;
6029
6122
  }
6030
6123
  case 14: {
6031
6124
  if (tag !== 112) {
6032
6125
  break;
6033
6126
  }
6034
- message.percentNet = longToNumber(reader.uint64());
6127
+ message.percentNet = reader.uint64();
6035
6128
  continue;
6036
6129
  }
6037
6130
  case 15: {
6038
6131
  if (tag !== 120) {
6039
6132
  break;
6040
6133
  }
6041
- message.cumulativeTimeNs = longToNumber(reader.uint64());
6134
+ message.cumulativeTimeNs = reader.uint64();
6042
6135
  continue;
6043
6136
  }
6044
6137
  case 16: {
6045
6138
  if (tag !== 128) {
6046
6139
  break;
6047
6140
  }
6048
- message.freedBytes = longToNumber(reader.uint64());
6141
+ message.freedBytes = reader.uint64();
6049
6142
  continue;
6050
6143
  }
6051
6144
  case 17: {
6052
6145
  if (tag !== 136) {
6053
6146
  break;
6054
6147
  }
6055
- message.netAfterOp = longToNumber(reader.uint64());
6148
+ message.netAfterOp = reader.uint64();
6056
6149
  continue;
6057
6150
  }
6058
6151
  case 18: {
6059
6152
  if (tag !== 144) {
6060
6153
  break;
6061
6154
  }
6062
- message.errorBytes = longToNumber(reader.uint64());
6155
+ message.errorBytes = reader.uint64();
6063
6156
  continue;
6064
6157
  }
6065
6158
  case 19: {
6066
6159
  if (tag !== 152) {
6067
6160
  break;
6068
6161
  }
6069
- message.errorAbsPct = longToNumber(reader.uint64());
6162
+ message.errorAbsPct = reader.uint64();
6070
6163
  continue;
6071
6164
  }
6072
6165
  case 20: {
@@ -6097,21 +6190,21 @@ var init_geode = __esm({
6097
6190
  phase: isSet(object.phase) ? globalThis.String(object.phase) : "",
6098
6191
  id: isSet(object.id) ? globalThis.Number(object.id) : 0,
6099
6192
  opIndex: isSet(object.opIndex) ? globalThis.Number(object.opIndex) : isSet(object.op_index) ? globalThis.Number(object.op_index) : 0,
6100
- inputRows: isSet(object.inputRows) ? globalThis.Number(object.inputRows) : isSet(object.input_rows) ? globalThis.Number(object.input_rows) : 0,
6101
- rows: isSet(object.rows) ? globalThis.Number(object.rows) : 0,
6102
- timeNs: isSet(object.timeNs) ? globalThis.Number(object.timeNs) : isSet(object.time_ns) ? globalThis.Number(object.time_ns) : 0,
6103
- cpuTimeNs: isSet(object.cpuTimeNs) ? globalThis.Number(object.cpuTimeNs) : isSet(object.cpu_time_ns) ? globalThis.Number(object.cpu_time_ns) : 0,
6104
- bytesOut: isSet(object.bytesOut) ? globalThis.Number(object.bytesOut) : isSet(object.bytes_out) ? globalThis.Number(object.bytes_out) : 0,
6105
- bytesAlloc: isSet(object.bytesAlloc) ? globalThis.Number(object.bytesAlloc) : isSet(object.bytes_alloc) ? globalThis.Number(object.bytes_alloc) : 0,
6106
- estimateBytes: isSet(object.estimateBytes) ? globalThis.Number(object.estimateBytes) : isSet(object.estimate_bytes) ? globalThis.Number(object.estimate_bytes) : 0,
6107
- estimateVsActual: isSet(object.estimateVsActual) ? globalThis.Number(object.estimateVsActual) : isSet(object.estimate_vs_actual) ? globalThis.Number(object.estimate_vs_actual) : 0,
6108
- percentPeak: isSet(object.percentPeak) ? globalThis.Number(object.percentPeak) : isSet(object.percent_peak) ? globalThis.Number(object.percent_peak) : 0,
6109
- percentNet: isSet(object.percentNet) ? globalThis.Number(object.percentNet) : isSet(object.percent_net) ? globalThis.Number(object.percent_net) : 0,
6110
- cumulativeTimeNs: isSet(object.cumulativeTimeNs) ? globalThis.Number(object.cumulativeTimeNs) : isSet(object.cumulative_time_ns) ? globalThis.Number(object.cumulative_time_ns) : 0,
6111
- freedBytes: isSet(object.freedBytes) ? globalThis.Number(object.freedBytes) : isSet(object.freed_bytes) ? globalThis.Number(object.freed_bytes) : 0,
6112
- netAfterOp: isSet(object.netAfterOp) ? globalThis.Number(object.netAfterOp) : isSet(object.net_after_op) ? globalThis.Number(object.net_after_op) : 0,
6113
- errorBytes: isSet(object.errorBytes) ? globalThis.Number(object.errorBytes) : isSet(object.error_bytes) ? globalThis.Number(object.error_bytes) : 0,
6114
- errorAbsPct: isSet(object.errorAbsPct) ? globalThis.Number(object.errorAbsPct) : isSet(object.error_abs_pct) ? globalThis.Number(object.error_abs_pct) : 0,
6193
+ inputRows: isSet(object.inputRows) ? BigInt(object.inputRows) : isSet(object.input_rows) ? BigInt(object.input_rows) : 0n,
6194
+ rows: isSet(object.rows) ? BigInt(object.rows) : 0n,
6195
+ timeNs: isSet(object.timeNs) ? BigInt(object.timeNs) : isSet(object.time_ns) ? BigInt(object.time_ns) : 0n,
6196
+ cpuTimeNs: isSet(object.cpuTimeNs) ? BigInt(object.cpuTimeNs) : isSet(object.cpu_time_ns) ? BigInt(object.cpu_time_ns) : 0n,
6197
+ bytesOut: isSet(object.bytesOut) ? BigInt(object.bytesOut) : isSet(object.bytes_out) ? BigInt(object.bytes_out) : 0n,
6198
+ bytesAlloc: isSet(object.bytesAlloc) ? BigInt(object.bytesAlloc) : isSet(object.bytes_alloc) ? BigInt(object.bytes_alloc) : 0n,
6199
+ estimateBytes: isSet(object.estimateBytes) ? BigInt(object.estimateBytes) : isSet(object.estimate_bytes) ? BigInt(object.estimate_bytes) : 0n,
6200
+ estimateVsActual: isSet(object.estimateVsActual) ? BigInt(object.estimateVsActual) : isSet(object.estimate_vs_actual) ? BigInt(object.estimate_vs_actual) : 0n,
6201
+ percentPeak: isSet(object.percentPeak) ? BigInt(object.percentPeak) : isSet(object.percent_peak) ? BigInt(object.percent_peak) : 0n,
6202
+ percentNet: isSet(object.percentNet) ? BigInt(object.percentNet) : isSet(object.percent_net) ? BigInt(object.percent_net) : 0n,
6203
+ cumulativeTimeNs: isSet(object.cumulativeTimeNs) ? BigInt(object.cumulativeTimeNs) : isSet(object.cumulative_time_ns) ? BigInt(object.cumulative_time_ns) : 0n,
6204
+ freedBytes: isSet(object.freedBytes) ? BigInt(object.freedBytes) : isSet(object.freed_bytes) ? BigInt(object.freed_bytes) : 0n,
6205
+ netAfterOp: isSet(object.netAfterOp) ? BigInt(object.netAfterOp) : isSet(object.net_after_op) ? BigInt(object.net_after_op) : 0n,
6206
+ errorBytes: isSet(object.errorBytes) ? BigInt(object.errorBytes) : isSet(object.error_bytes) ? BigInt(object.error_bytes) : 0n,
6207
+ errorAbsPct: isSet(object.errorAbsPct) ? BigInt(object.errorAbsPct) : isSet(object.error_abs_pct) ? BigInt(object.error_abs_pct) : 0n,
6115
6208
  indexName: isSet(object.indexName) ? globalThis.String(object.indexName) : isSet(object.index_name) ? globalThis.String(object.index_name) : "",
6116
6209
  selectivityEst: isSet(object.selectivityEst) ? globalThis.Number(object.selectivityEst) : isSet(object.selectivity_est) ? globalThis.Number(object.selectivity_est) : 0
6117
6210
  };
@@ -6130,50 +6223,50 @@ var init_geode = __esm({
6130
6223
  if (message.opIndex !== 0) {
6131
6224
  obj.opIndex = Math.round(message.opIndex);
6132
6225
  }
6133
- if (message.inputRows !== 0) {
6134
- obj.inputRows = Math.round(message.inputRows);
6226
+ if (message.inputRows !== 0n) {
6227
+ obj.inputRows = message.inputRows.toString();
6135
6228
  }
6136
- if (message.rows !== 0) {
6137
- obj.rows = Math.round(message.rows);
6229
+ if (message.rows !== 0n) {
6230
+ obj.rows = message.rows.toString();
6138
6231
  }
6139
- if (message.timeNs !== 0) {
6140
- obj.timeNs = Math.round(message.timeNs);
6232
+ if (message.timeNs !== 0n) {
6233
+ obj.timeNs = message.timeNs.toString();
6141
6234
  }
6142
- if (message.cpuTimeNs !== 0) {
6143
- obj.cpuTimeNs = Math.round(message.cpuTimeNs);
6235
+ if (message.cpuTimeNs !== 0n) {
6236
+ obj.cpuTimeNs = message.cpuTimeNs.toString();
6144
6237
  }
6145
- if (message.bytesOut !== 0) {
6146
- obj.bytesOut = Math.round(message.bytesOut);
6238
+ if (message.bytesOut !== 0n) {
6239
+ obj.bytesOut = message.bytesOut.toString();
6147
6240
  }
6148
- if (message.bytesAlloc !== 0) {
6149
- obj.bytesAlloc = Math.round(message.bytesAlloc);
6241
+ if (message.bytesAlloc !== 0n) {
6242
+ obj.bytesAlloc = message.bytesAlloc.toString();
6150
6243
  }
6151
- if (message.estimateBytes !== 0) {
6152
- obj.estimateBytes = Math.round(message.estimateBytes);
6244
+ if (message.estimateBytes !== 0n) {
6245
+ obj.estimateBytes = message.estimateBytes.toString();
6153
6246
  }
6154
- if (message.estimateVsActual !== 0) {
6155
- obj.estimateVsActual = Math.round(message.estimateVsActual);
6247
+ if (message.estimateVsActual !== 0n) {
6248
+ obj.estimateVsActual = message.estimateVsActual.toString();
6156
6249
  }
6157
- if (message.percentPeak !== 0) {
6158
- obj.percentPeak = Math.round(message.percentPeak);
6250
+ if (message.percentPeak !== 0n) {
6251
+ obj.percentPeak = message.percentPeak.toString();
6159
6252
  }
6160
- if (message.percentNet !== 0) {
6161
- obj.percentNet = Math.round(message.percentNet);
6253
+ if (message.percentNet !== 0n) {
6254
+ obj.percentNet = message.percentNet.toString();
6162
6255
  }
6163
- if (message.cumulativeTimeNs !== 0) {
6164
- obj.cumulativeTimeNs = Math.round(message.cumulativeTimeNs);
6256
+ if (message.cumulativeTimeNs !== 0n) {
6257
+ obj.cumulativeTimeNs = message.cumulativeTimeNs.toString();
6165
6258
  }
6166
- if (message.freedBytes !== 0) {
6167
- obj.freedBytes = Math.round(message.freedBytes);
6259
+ if (message.freedBytes !== 0n) {
6260
+ obj.freedBytes = message.freedBytes.toString();
6168
6261
  }
6169
- if (message.netAfterOp !== 0) {
6170
- obj.netAfterOp = Math.round(message.netAfterOp);
6262
+ if (message.netAfterOp !== 0n) {
6263
+ obj.netAfterOp = message.netAfterOp.toString();
6171
6264
  }
6172
- if (message.errorBytes !== 0) {
6173
- obj.errorBytes = Math.round(message.errorBytes);
6265
+ if (message.errorBytes !== 0n) {
6266
+ obj.errorBytes = message.errorBytes.toString();
6174
6267
  }
6175
- if (message.errorAbsPct !== 0) {
6176
- obj.errorAbsPct = Math.round(message.errorAbsPct);
6268
+ if (message.errorAbsPct !== 0n) {
6269
+ obj.errorAbsPct = message.errorAbsPct.toString();
6177
6270
  }
6178
6271
  if (message.indexName !== "") {
6179
6272
  obj.indexName = message.indexName;
@@ -6192,21 +6285,21 @@ var init_geode = __esm({
6192
6285
  message.phase = object.phase ?? "";
6193
6286
  message.id = object.id ?? 0;
6194
6287
  message.opIndex = object.opIndex ?? 0;
6195
- message.inputRows = object.inputRows ?? 0;
6196
- message.rows = object.rows ?? 0;
6197
- message.timeNs = object.timeNs ?? 0;
6198
- message.cpuTimeNs = object.cpuTimeNs ?? 0;
6199
- message.bytesOut = object.bytesOut ?? 0;
6200
- message.bytesAlloc = object.bytesAlloc ?? 0;
6201
- message.estimateBytes = object.estimateBytes ?? 0;
6202
- message.estimateVsActual = object.estimateVsActual ?? 0;
6203
- message.percentPeak = object.percentPeak ?? 0;
6204
- message.percentNet = object.percentNet ?? 0;
6205
- message.cumulativeTimeNs = object.cumulativeTimeNs ?? 0;
6206
- message.freedBytes = object.freedBytes ?? 0;
6207
- message.netAfterOp = object.netAfterOp ?? 0;
6208
- message.errorBytes = object.errorBytes ?? 0;
6209
- message.errorAbsPct = object.errorAbsPct ?? 0;
6288
+ message.inputRows = object.inputRows ?? 0n;
6289
+ message.rows = object.rows ?? 0n;
6290
+ message.timeNs = object.timeNs ?? 0n;
6291
+ message.cpuTimeNs = object.cpuTimeNs ?? 0n;
6292
+ message.bytesOut = object.bytesOut ?? 0n;
6293
+ message.bytesAlloc = object.bytesAlloc ?? 0n;
6294
+ message.estimateBytes = object.estimateBytes ?? 0n;
6295
+ message.estimateVsActual = object.estimateVsActual ?? 0n;
6296
+ message.percentPeak = object.percentPeak ?? 0n;
6297
+ message.percentNet = object.percentNet ?? 0n;
6298
+ message.cumulativeTimeNs = object.cumulativeTimeNs ?? 0n;
6299
+ message.freedBytes = object.freedBytes ?? 0n;
6300
+ message.netAfterOp = object.netAfterOp ?? 0n;
6301
+ message.errorBytes = object.errorBytes ?? 0n;
6302
+ message.errorAbsPct = object.errorAbsPct ?? 0n;
6210
6303
  message.indexName = object.indexName ?? "";
6211
6304
  message.selectivityEst = object.selectivityEst ?? 0;
6212
6305
  return message;
@@ -6217,7 +6310,10 @@ var init_geode = __esm({
6217
6310
  if (message.op !== "") {
6218
6311
  writer.uint32(10).string(message.op);
6219
6312
  }
6220
- if (message.bytesAlloc !== 0) {
6313
+ if (message.bytesAlloc !== 0n) {
6314
+ if (BigInt.asUintN(64, message.bytesAlloc) !== message.bytesAlloc) {
6315
+ throw new globalThis.Error("value provided for field message.bytesAlloc of type uint64 too large");
6316
+ }
6221
6317
  writer.uint32(16).uint64(message.bytesAlloc);
6222
6318
  }
6223
6319
  return writer;
@@ -6240,7 +6336,7 @@ var init_geode = __esm({
6240
6336
  if (tag !== 16) {
6241
6337
  break;
6242
6338
  }
6243
- message.bytesAlloc = longToNumber(reader.uint64());
6339
+ message.bytesAlloc = reader.uint64();
6244
6340
  continue;
6245
6341
  }
6246
6342
  }
@@ -6254,7 +6350,7 @@ var init_geode = __esm({
6254
6350
  fromJSON(object) {
6255
6351
  return {
6256
6352
  op: isSet(object.op) ? globalThis.String(object.op) : "",
6257
- bytesAlloc: isSet(object.bytesAlloc) ? globalThis.Number(object.bytesAlloc) : isSet(object.bytes_alloc) ? globalThis.Number(object.bytes_alloc) : 0
6353
+ bytesAlloc: isSet(object.bytesAlloc) ? BigInt(object.bytesAlloc) : isSet(object.bytes_alloc) ? BigInt(object.bytes_alloc) : 0n
6258
6354
  };
6259
6355
  },
6260
6356
  toJSON(message) {
@@ -6262,8 +6358,8 @@ var init_geode = __esm({
6262
6358
  if (message.op !== "") {
6263
6359
  obj.op = message.op;
6264
6360
  }
6265
- if (message.bytesAlloc !== 0) {
6266
- obj.bytesAlloc = Math.round(message.bytesAlloc);
6361
+ if (message.bytesAlloc !== 0n) {
6362
+ obj.bytesAlloc = message.bytesAlloc.toString();
6267
6363
  }
6268
6364
  return obj;
6269
6365
  },
@@ -6273,16 +6369,22 @@ var init_geode = __esm({
6273
6369
  fromPartial(object) {
6274
6370
  const message = createBaseProfilePeakContributor();
6275
6371
  message.op = object.op ?? "";
6276
- message.bytesAlloc = object.bytesAlloc ?? 0;
6372
+ message.bytesAlloc = object.bytesAlloc ?? 0n;
6277
6373
  return message;
6278
6374
  }
6279
6375
  };
6280
6376
  ProfileTotals = {
6281
6377
  encode(message, writer = new BinaryWriter()) {
6282
- if (message.timeNs !== 0) {
6378
+ if (message.timeNs !== 0n) {
6379
+ if (BigInt.asUintN(64, message.timeNs) !== message.timeNs) {
6380
+ throw new globalThis.Error("value provided for field message.timeNs of type uint64 too large");
6381
+ }
6283
6382
  writer.uint32(8).uint64(message.timeNs);
6284
6383
  }
6285
- if (message.peakBytes !== 0) {
6384
+ if (message.peakBytes !== 0n) {
6385
+ if (BigInt.asUintN(64, message.peakBytes) !== message.peakBytes) {
6386
+ throw new globalThis.Error("value provided for field message.peakBytes of type uint64 too large");
6387
+ }
6286
6388
  writer.uint32(16).uint64(message.peakBytes);
6287
6389
  }
6288
6390
  return writer;
@@ -6298,14 +6400,14 @@ var init_geode = __esm({
6298
6400
  if (tag !== 8) {
6299
6401
  break;
6300
6402
  }
6301
- message.timeNs = longToNumber(reader.uint64());
6403
+ message.timeNs = reader.uint64();
6302
6404
  continue;
6303
6405
  }
6304
6406
  case 2: {
6305
6407
  if (tag !== 16) {
6306
6408
  break;
6307
6409
  }
6308
- message.peakBytes = longToNumber(reader.uint64());
6410
+ message.peakBytes = reader.uint64();
6309
6411
  continue;
6310
6412
  }
6311
6413
  }
@@ -6318,17 +6420,17 @@ var init_geode = __esm({
6318
6420
  },
6319
6421
  fromJSON(object) {
6320
6422
  return {
6321
- timeNs: isSet(object.timeNs) ? globalThis.Number(object.timeNs) : isSet(object.time_ns) ? globalThis.Number(object.time_ns) : 0,
6322
- peakBytes: isSet(object.peakBytes) ? globalThis.Number(object.peakBytes) : isSet(object.peak_bytes) ? globalThis.Number(object.peak_bytes) : 0
6423
+ timeNs: isSet(object.timeNs) ? BigInt(object.timeNs) : isSet(object.time_ns) ? BigInt(object.time_ns) : 0n,
6424
+ peakBytes: isSet(object.peakBytes) ? BigInt(object.peakBytes) : isSet(object.peak_bytes) ? BigInt(object.peak_bytes) : 0n
6323
6425
  };
6324
6426
  },
6325
6427
  toJSON(message) {
6326
6428
  const obj = {};
6327
- if (message.timeNs !== 0) {
6328
- obj.timeNs = Math.round(message.timeNs);
6429
+ if (message.timeNs !== 0n) {
6430
+ obj.timeNs = message.timeNs.toString();
6329
6431
  }
6330
- if (message.peakBytes !== 0) {
6331
- obj.peakBytes = Math.round(message.peakBytes);
6432
+ if (message.peakBytes !== 0n) {
6433
+ obj.peakBytes = message.peakBytes.toString();
6332
6434
  }
6333
6435
  return obj;
6334
6436
  },
@@ -6337,26 +6439,38 @@ var init_geode = __esm({
6337
6439
  },
6338
6440
  fromPartial(object) {
6339
6441
  const message = createBaseProfileTotals();
6340
- message.timeNs = object.timeNs ?? 0;
6341
- message.peakBytes = object.peakBytes ?? 0;
6442
+ message.timeNs = object.timeNs ?? 0n;
6443
+ message.peakBytes = object.peakBytes ?? 0n;
6342
6444
  return message;
6343
6445
  }
6344
6446
  };
6345
6447
  ProfileSpills = {
6346
6448
  encode(message, writer = new BinaryWriter()) {
6347
- if (message.sortSpills !== 0) {
6449
+ if (message.sortSpills !== 0n) {
6450
+ if (BigInt.asUintN(64, message.sortSpills) !== message.sortSpills) {
6451
+ throw new globalThis.Error("value provided for field message.sortSpills of type uint64 too large");
6452
+ }
6348
6453
  writer.uint32(8).uint64(message.sortSpills);
6349
6454
  }
6350
- if (message.distinctSpills !== 0) {
6455
+ if (message.distinctSpills !== 0n) {
6456
+ if (BigInt.asUintN(64, message.distinctSpills) !== message.distinctSpills) {
6457
+ throw new globalThis.Error("value provided for field message.distinctSpills of type uint64 too large");
6458
+ }
6351
6459
  writer.uint32(16).uint64(message.distinctSpills);
6352
6460
  }
6353
- if (message.unionSpills !== 0) {
6461
+ if (message.unionSpills !== 0n) {
6462
+ if (BigInt.asUintN(64, message.unionSpills) !== message.unionSpills) {
6463
+ throw new globalThis.Error("value provided for field message.unionSpills of type uint64 too large");
6464
+ }
6354
6465
  writer.uint32(24).uint64(message.unionSpills);
6355
6466
  }
6356
6467
  if (message.spillReason !== "") {
6357
6468
  writer.uint32(34).string(message.spillReason);
6358
6469
  }
6359
- if (message.peakBytesAtSpill !== 0) {
6470
+ if (message.peakBytesAtSpill !== 0n) {
6471
+ if (BigInt.asUintN(64, message.peakBytesAtSpill) !== message.peakBytesAtSpill) {
6472
+ throw new globalThis.Error("value provided for field message.peakBytesAtSpill of type uint64 too large");
6473
+ }
6360
6474
  writer.uint32(40).uint64(message.peakBytesAtSpill);
6361
6475
  }
6362
6476
  if (message.firstSpillOpIndex !== 0) {
@@ -6375,21 +6489,21 @@ var init_geode = __esm({
6375
6489
  if (tag !== 8) {
6376
6490
  break;
6377
6491
  }
6378
- message.sortSpills = longToNumber(reader.uint64());
6492
+ message.sortSpills = reader.uint64();
6379
6493
  continue;
6380
6494
  }
6381
6495
  case 2: {
6382
6496
  if (tag !== 16) {
6383
6497
  break;
6384
6498
  }
6385
- message.distinctSpills = longToNumber(reader.uint64());
6499
+ message.distinctSpills = reader.uint64();
6386
6500
  continue;
6387
6501
  }
6388
6502
  case 3: {
6389
6503
  if (tag !== 24) {
6390
6504
  break;
6391
6505
  }
6392
- message.unionSpills = longToNumber(reader.uint64());
6506
+ message.unionSpills = reader.uint64();
6393
6507
  continue;
6394
6508
  }
6395
6509
  case 4: {
@@ -6403,7 +6517,7 @@ var init_geode = __esm({
6403
6517
  if (tag !== 40) {
6404
6518
  break;
6405
6519
  }
6406
- message.peakBytesAtSpill = longToNumber(reader.uint64());
6520
+ message.peakBytesAtSpill = reader.uint64();
6407
6521
  continue;
6408
6522
  }
6409
6523
  case 6: {
@@ -6423,30 +6537,30 @@ var init_geode = __esm({
6423
6537
  },
6424
6538
  fromJSON(object) {
6425
6539
  return {
6426
- sortSpills: isSet(object.sortSpills) ? globalThis.Number(object.sortSpills) : isSet(object.sort_spills) ? globalThis.Number(object.sort_spills) : 0,
6427
- distinctSpills: isSet(object.distinctSpills) ? globalThis.Number(object.distinctSpills) : isSet(object.distinct_spills) ? globalThis.Number(object.distinct_spills) : 0,
6428
- unionSpills: isSet(object.unionSpills) ? globalThis.Number(object.unionSpills) : isSet(object.union_spills) ? globalThis.Number(object.union_spills) : 0,
6540
+ sortSpills: isSet(object.sortSpills) ? BigInt(object.sortSpills) : isSet(object.sort_spills) ? BigInt(object.sort_spills) : 0n,
6541
+ distinctSpills: isSet(object.distinctSpills) ? BigInt(object.distinctSpills) : isSet(object.distinct_spills) ? BigInt(object.distinct_spills) : 0n,
6542
+ unionSpills: isSet(object.unionSpills) ? BigInt(object.unionSpills) : isSet(object.union_spills) ? BigInt(object.union_spills) : 0n,
6429
6543
  spillReason: isSet(object.spillReason) ? globalThis.String(object.spillReason) : isSet(object.spill_reason) ? globalThis.String(object.spill_reason) : "",
6430
- peakBytesAtSpill: isSet(object.peakBytesAtSpill) ? globalThis.Number(object.peakBytesAtSpill) : isSet(object.peak_bytes_at_spill) ? globalThis.Number(object.peak_bytes_at_spill) : 0,
6544
+ peakBytesAtSpill: isSet(object.peakBytesAtSpill) ? BigInt(object.peakBytesAtSpill) : isSet(object.peak_bytes_at_spill) ? BigInt(object.peak_bytes_at_spill) : 0n,
6431
6545
  firstSpillOpIndex: isSet(object.firstSpillOpIndex) ? globalThis.Number(object.firstSpillOpIndex) : isSet(object.first_spill_op_index) ? globalThis.Number(object.first_spill_op_index) : 0
6432
6546
  };
6433
6547
  },
6434
6548
  toJSON(message) {
6435
6549
  const obj = {};
6436
- if (message.sortSpills !== 0) {
6437
- obj.sortSpills = Math.round(message.sortSpills);
6550
+ if (message.sortSpills !== 0n) {
6551
+ obj.sortSpills = message.sortSpills.toString();
6438
6552
  }
6439
- if (message.distinctSpills !== 0) {
6440
- obj.distinctSpills = Math.round(message.distinctSpills);
6553
+ if (message.distinctSpills !== 0n) {
6554
+ obj.distinctSpills = message.distinctSpills.toString();
6441
6555
  }
6442
- if (message.unionSpills !== 0) {
6443
- obj.unionSpills = Math.round(message.unionSpills);
6556
+ if (message.unionSpills !== 0n) {
6557
+ obj.unionSpills = message.unionSpills.toString();
6444
6558
  }
6445
6559
  if (message.spillReason !== "") {
6446
6560
  obj.spillReason = message.spillReason;
6447
6561
  }
6448
- if (message.peakBytesAtSpill !== 0) {
6449
- obj.peakBytesAtSpill = Math.round(message.peakBytesAtSpill);
6562
+ if (message.peakBytesAtSpill !== 0n) {
6563
+ obj.peakBytesAtSpill = message.peakBytesAtSpill.toString();
6450
6564
  }
6451
6565
  if (message.firstSpillOpIndex !== 0) {
6452
6566
  obj.firstSpillOpIndex = Math.round(message.firstSpillOpIndex);
@@ -6458,24 +6572,33 @@ var init_geode = __esm({
6458
6572
  },
6459
6573
  fromPartial(object) {
6460
6574
  const message = createBaseProfileSpills();
6461
- message.sortSpills = object.sortSpills ?? 0;
6462
- message.distinctSpills = object.distinctSpills ?? 0;
6463
- message.unionSpills = object.unionSpills ?? 0;
6575
+ message.sortSpills = object.sortSpills ?? 0n;
6576
+ message.distinctSpills = object.distinctSpills ?? 0n;
6577
+ message.unionSpills = object.unionSpills ?? 0n;
6464
6578
  message.spillReason = object.spillReason ?? "";
6465
- message.peakBytesAtSpill = object.peakBytesAtSpill ?? 0;
6579
+ message.peakBytesAtSpill = object.peakBytesAtSpill ?? 0n;
6466
6580
  message.firstSpillOpIndex = object.firstSpillOpIndex ?? 0;
6467
6581
  return message;
6468
6582
  }
6469
6583
  };
6470
6584
  ProfileMemory = {
6471
6585
  encode(message, writer = new BinaryWriter()) {
6472
- if (message.netBytes !== 0) {
6586
+ if (message.netBytes !== 0n) {
6587
+ if (BigInt.asUintN(64, message.netBytes) !== message.netBytes) {
6588
+ throw new globalThis.Error("value provided for field message.netBytes of type uint64 too large");
6589
+ }
6473
6590
  writer.uint32(8).uint64(message.netBytes);
6474
6591
  }
6475
- if (message.peakBytes !== 0) {
6592
+ if (message.peakBytes !== 0n) {
6593
+ if (BigInt.asUintN(64, message.peakBytes) !== message.peakBytes) {
6594
+ throw new globalThis.Error("value provided for field message.peakBytes of type uint64 too large");
6595
+ }
6476
6596
  writer.uint32(16).uint64(message.peakBytes);
6477
6597
  }
6478
- if (message.totalAllocBytes !== 0) {
6598
+ if (message.totalAllocBytes !== 0n) {
6599
+ if (BigInt.asUintN(64, message.totalAllocBytes) !== message.totalAllocBytes) {
6600
+ throw new globalThis.Error("value provided for field message.totalAllocBytes of type uint64 too large");
6601
+ }
6479
6602
  writer.uint32(24).uint64(message.totalAllocBytes);
6480
6603
  }
6481
6604
  return writer;
@@ -6491,21 +6614,21 @@ var init_geode = __esm({
6491
6614
  if (tag !== 8) {
6492
6615
  break;
6493
6616
  }
6494
- message.netBytes = longToNumber(reader.uint64());
6617
+ message.netBytes = reader.uint64();
6495
6618
  continue;
6496
6619
  }
6497
6620
  case 2: {
6498
6621
  if (tag !== 16) {
6499
6622
  break;
6500
6623
  }
6501
- message.peakBytes = longToNumber(reader.uint64());
6624
+ message.peakBytes = reader.uint64();
6502
6625
  continue;
6503
6626
  }
6504
6627
  case 3: {
6505
6628
  if (tag !== 24) {
6506
6629
  break;
6507
6630
  }
6508
- message.totalAllocBytes = longToNumber(reader.uint64());
6631
+ message.totalAllocBytes = reader.uint64();
6509
6632
  continue;
6510
6633
  }
6511
6634
  }
@@ -6518,21 +6641,21 @@ var init_geode = __esm({
6518
6641
  },
6519
6642
  fromJSON(object) {
6520
6643
  return {
6521
- netBytes: isSet(object.netBytes) ? globalThis.Number(object.netBytes) : isSet(object.net_bytes) ? globalThis.Number(object.net_bytes) : 0,
6522
- peakBytes: isSet(object.peakBytes) ? globalThis.Number(object.peakBytes) : isSet(object.peak_bytes) ? globalThis.Number(object.peak_bytes) : 0,
6523
- totalAllocBytes: isSet(object.totalAllocBytes) ? globalThis.Number(object.totalAllocBytes) : isSet(object.total_alloc_bytes) ? globalThis.Number(object.total_alloc_bytes) : 0
6644
+ netBytes: isSet(object.netBytes) ? BigInt(object.netBytes) : isSet(object.net_bytes) ? BigInt(object.net_bytes) : 0n,
6645
+ peakBytes: isSet(object.peakBytes) ? BigInt(object.peakBytes) : isSet(object.peak_bytes) ? BigInt(object.peak_bytes) : 0n,
6646
+ totalAllocBytes: isSet(object.totalAllocBytes) ? BigInt(object.totalAllocBytes) : isSet(object.total_alloc_bytes) ? BigInt(object.total_alloc_bytes) : 0n
6524
6647
  };
6525
6648
  },
6526
6649
  toJSON(message) {
6527
6650
  const obj = {};
6528
- if (message.netBytes !== 0) {
6529
- obj.netBytes = Math.round(message.netBytes);
6651
+ if (message.netBytes !== 0n) {
6652
+ obj.netBytes = message.netBytes.toString();
6530
6653
  }
6531
- if (message.peakBytes !== 0) {
6532
- obj.peakBytes = Math.round(message.peakBytes);
6654
+ if (message.peakBytes !== 0n) {
6655
+ obj.peakBytes = message.peakBytes.toString();
6533
6656
  }
6534
- if (message.totalAllocBytes !== 0) {
6535
- obj.totalAllocBytes = Math.round(message.totalAllocBytes);
6657
+ if (message.totalAllocBytes !== 0n) {
6658
+ obj.totalAllocBytes = message.totalAllocBytes.toString();
6536
6659
  }
6537
6660
  return obj;
6538
6661
  },
@@ -6541,18 +6664,24 @@ var init_geode = __esm({
6541
6664
  },
6542
6665
  fromPartial(object) {
6543
6666
  const message = createBaseProfileMemory();
6544
- message.netBytes = object.netBytes ?? 0;
6545
- message.peakBytes = object.peakBytes ?? 0;
6546
- message.totalAllocBytes = object.totalAllocBytes ?? 0;
6667
+ message.netBytes = object.netBytes ?? 0n;
6668
+ message.peakBytes = object.peakBytes ?? 0n;
6669
+ message.totalAllocBytes = object.totalAllocBytes ?? 0n;
6547
6670
  return message;
6548
6671
  }
6549
6672
  };
6550
6673
  ProfilePlannerEstimates = {
6551
6674
  encode(message, writer = new BinaryWriter()) {
6552
- if (message.sumEstimateBytes !== 0) {
6675
+ if (message.sumEstimateBytes !== 0n) {
6676
+ if (BigInt.asUintN(64, message.sumEstimateBytes) !== message.sumEstimateBytes) {
6677
+ throw new globalThis.Error("value provided for field message.sumEstimateBytes of type uint64 too large");
6678
+ }
6553
6679
  writer.uint32(8).uint64(message.sumEstimateBytes);
6554
6680
  }
6555
- if (message.sumActualBytes !== 0) {
6681
+ if (message.sumActualBytes !== 0n) {
6682
+ if (BigInt.asUintN(64, message.sumActualBytes) !== message.sumActualBytes) {
6683
+ throw new globalThis.Error("value provided for field message.sumActualBytes of type uint64 too large");
6684
+ }
6556
6685
  writer.uint32(16).uint64(message.sumActualBytes);
6557
6686
  }
6558
6687
  if (message.countEstimatedOps !== 0) {
@@ -6589,14 +6718,14 @@ var init_geode = __esm({
6589
6718
  if (tag !== 8) {
6590
6719
  break;
6591
6720
  }
6592
- message.sumEstimateBytes = longToNumber(reader.uint64());
6721
+ message.sumEstimateBytes = reader.uint64();
6593
6722
  continue;
6594
6723
  }
6595
6724
  case 2: {
6596
6725
  if (tag !== 16) {
6597
6726
  break;
6598
6727
  }
6599
- message.sumActualBytes = longToNumber(reader.uint64());
6728
+ message.sumActualBytes = reader.uint64();
6600
6729
  continue;
6601
6730
  }
6602
6731
  case 3: {
@@ -6658,8 +6787,8 @@ var init_geode = __esm({
6658
6787
  },
6659
6788
  fromJSON(object) {
6660
6789
  return {
6661
- sumEstimateBytes: isSet(object.sumEstimateBytes) ? globalThis.Number(object.sumEstimateBytes) : isSet(object.sum_estimate_bytes) ? globalThis.Number(object.sum_estimate_bytes) : 0,
6662
- sumActualBytes: isSet(object.sumActualBytes) ? globalThis.Number(object.sumActualBytes) : isSet(object.sum_actual_bytes) ? globalThis.Number(object.sum_actual_bytes) : 0,
6790
+ sumEstimateBytes: isSet(object.sumEstimateBytes) ? BigInt(object.sumEstimateBytes) : isSet(object.sum_estimate_bytes) ? BigInt(object.sum_estimate_bytes) : 0n,
6791
+ sumActualBytes: isSet(object.sumActualBytes) ? BigInt(object.sumActualBytes) : isSet(object.sum_actual_bytes) ? BigInt(object.sum_actual_bytes) : 0n,
6663
6792
  countEstimatedOps: isSet(object.countEstimatedOps) ? globalThis.Number(object.countEstimatedOps) : isSet(object.count_estimated_ops) ? globalThis.Number(object.count_estimated_ops) : 0,
6664
6793
  minErrorAbsPct: isSet(object.minErrorAbsPct) ? globalThis.Number(object.minErrorAbsPct) : isSet(object.min_error_abs_pct) ? globalThis.Number(object.min_error_abs_pct) : 0,
6665
6794
  maxErrorAbsPct: isSet(object.maxErrorAbsPct) ? globalThis.Number(object.maxErrorAbsPct) : isSet(object.max_error_abs_pct) ? globalThis.Number(object.max_error_abs_pct) : 0,
@@ -6671,11 +6800,11 @@ var init_geode = __esm({
6671
6800
  },
6672
6801
  toJSON(message) {
6673
6802
  const obj = {};
6674
- if (message.sumEstimateBytes !== 0) {
6675
- obj.sumEstimateBytes = Math.round(message.sumEstimateBytes);
6803
+ if (message.sumEstimateBytes !== 0n) {
6804
+ obj.sumEstimateBytes = message.sumEstimateBytes.toString();
6676
6805
  }
6677
- if (message.sumActualBytes !== 0) {
6678
- obj.sumActualBytes = Math.round(message.sumActualBytes);
6806
+ if (message.sumActualBytes !== 0n) {
6807
+ obj.sumActualBytes = message.sumActualBytes.toString();
6679
6808
  }
6680
6809
  if (message.countEstimatedOps !== 0) {
6681
6810
  obj.countEstimatedOps = Math.round(message.countEstimatedOps);
@@ -6705,8 +6834,8 @@ var init_geode = __esm({
6705
6834
  },
6706
6835
  fromPartial(object) {
6707
6836
  const message = createBaseProfilePlannerEstimates();
6708
- message.sumEstimateBytes = object.sumEstimateBytes ?? 0;
6709
- message.sumActualBytes = object.sumActualBytes ?? 0;
6837
+ message.sumEstimateBytes = object.sumEstimateBytes ?? 0n;
6838
+ message.sumActualBytes = object.sumActualBytes ?? 0n;
6710
6839
  message.countEstimatedOps = object.countEstimatedOps ?? 0;
6711
6840
  message.minErrorAbsPct = object.minErrorAbsPct ?? 0;
6712
6841
  message.maxErrorAbsPct = object.maxErrorAbsPct ?? 0;
@@ -6722,7 +6851,10 @@ var init_geode = __esm({
6722
6851
  if (message.opIndex !== 0) {
6723
6852
  writer.uint32(8).uint32(message.opIndex);
6724
6853
  }
6725
- if (message.netAfterOp !== 0) {
6854
+ if (message.netAfterOp !== 0n) {
6855
+ if (BigInt.asUintN(64, message.netAfterOp) !== message.netAfterOp) {
6856
+ throw new globalThis.Error("value provided for field message.netAfterOp of type uint64 too large");
6857
+ }
6726
6858
  writer.uint32(16).uint64(message.netAfterOp);
6727
6859
  }
6728
6860
  return writer;
@@ -6745,7 +6877,7 @@ var init_geode = __esm({
6745
6877
  if (tag !== 16) {
6746
6878
  break;
6747
6879
  }
6748
- message.netAfterOp = longToNumber(reader.uint64());
6880
+ message.netAfterOp = reader.uint64();
6749
6881
  continue;
6750
6882
  }
6751
6883
  }
@@ -6759,7 +6891,7 @@ var init_geode = __esm({
6759
6891
  fromJSON(object) {
6760
6892
  return {
6761
6893
  opIndex: isSet(object.opIndex) ? globalThis.Number(object.opIndex) : isSet(object.op_index) ? globalThis.Number(object.op_index) : 0,
6762
- netAfterOp: isSet(object.netAfterOp) ? globalThis.Number(object.netAfterOp) : isSet(object.net_after_op) ? globalThis.Number(object.net_after_op) : 0
6894
+ netAfterOp: isSet(object.netAfterOp) ? BigInt(object.netAfterOp) : isSet(object.net_after_op) ? BigInt(object.net_after_op) : 0n
6763
6895
  };
6764
6896
  },
6765
6897
  toJSON(message) {
@@ -6767,8 +6899,8 @@ var init_geode = __esm({
6767
6899
  if (message.opIndex !== 0) {
6768
6900
  obj.opIndex = Math.round(message.opIndex);
6769
6901
  }
6770
- if (message.netAfterOp !== 0) {
6771
- obj.netAfterOp = Math.round(message.netAfterOp);
6902
+ if (message.netAfterOp !== 0n) {
6903
+ obj.netAfterOp = message.netAfterOp.toString();
6772
6904
  }
6773
6905
  return obj;
6774
6906
  },
@@ -6778,7 +6910,7 @@ var init_geode = __esm({
6778
6910
  fromPartial(object) {
6779
6911
  const message = createBaseProfileMemCurvePoint();
6780
6912
  message.opIndex = object.opIndex ?? 0;
6781
- message.netAfterOp = object.netAfterOp ?? 0;
6913
+ message.netAfterOp = object.netAfterOp ?? 0n;
6782
6914
  return message;
6783
6915
  }
6784
6916
  };
@@ -6790,16 +6922,28 @@ var init_geode = __esm({
6790
6922
  if (message.mode !== "") {
6791
6923
  writer.uint32(18).string(message.mode);
6792
6924
  }
6793
- if (message.inputRows !== 0) {
6925
+ if (message.inputRows !== 0n) {
6926
+ if (BigInt.asUintN(64, message.inputRows) !== message.inputRows) {
6927
+ throw new globalThis.Error("value provided for field message.inputRows of type uint64 too large");
6928
+ }
6794
6929
  writer.uint32(24).uint64(message.inputRows);
6795
6930
  }
6796
- if (message.outputRows !== 0) {
6931
+ if (message.outputRows !== 0n) {
6932
+ if (BigInt.asUintN(64, message.outputRows) !== message.outputRows) {
6933
+ throw new globalThis.Error("value provided for field message.outputRows of type uint64 too large");
6934
+ }
6797
6935
  writer.uint32(32).uint64(message.outputRows);
6798
6936
  }
6799
- if (message.hashDedupSize !== 0) {
6937
+ if (message.hashDedupSize !== 0n) {
6938
+ if (BigInt.asUintN(64, message.hashDedupSize) !== message.hashDedupSize) {
6939
+ throw new globalThis.Error("value provided for field message.hashDedupSize of type uint64 too large");
6940
+ }
6800
6941
  writer.uint32(40).uint64(message.hashDedupSize);
6801
6942
  }
6802
- if (message.distinctFillPct !== 0) {
6943
+ if (message.distinctFillPct !== 0n) {
6944
+ if (BigInt.asUintN(64, message.distinctFillPct) !== message.distinctFillPct) {
6945
+ throw new globalThis.Error("value provided for field message.distinctFillPct of type uint64 too large");
6946
+ }
6803
6947
  writer.uint32(48).uint64(message.distinctFillPct);
6804
6948
  }
6805
6949
  return writer;
@@ -6829,28 +6973,28 @@ var init_geode = __esm({
6829
6973
  if (tag !== 24) {
6830
6974
  break;
6831
6975
  }
6832
- message.inputRows = longToNumber(reader.uint64());
6976
+ message.inputRows = reader.uint64();
6833
6977
  continue;
6834
6978
  }
6835
6979
  case 4: {
6836
6980
  if (tag !== 32) {
6837
6981
  break;
6838
6982
  }
6839
- message.outputRows = longToNumber(reader.uint64());
6983
+ message.outputRows = reader.uint64();
6840
6984
  continue;
6841
6985
  }
6842
6986
  case 5: {
6843
6987
  if (tag !== 40) {
6844
6988
  break;
6845
6989
  }
6846
- message.hashDedupSize = longToNumber(reader.uint64());
6990
+ message.hashDedupSize = reader.uint64();
6847
6991
  continue;
6848
6992
  }
6849
6993
  case 6: {
6850
6994
  if (tag !== 48) {
6851
6995
  break;
6852
6996
  }
6853
- message.distinctFillPct = longToNumber(reader.uint64());
6997
+ message.distinctFillPct = reader.uint64();
6854
6998
  continue;
6855
6999
  }
6856
7000
  }
@@ -6865,10 +7009,10 @@ var init_geode = __esm({
6865
7009
  return {
6866
7010
  type: isSet(object.type) ? globalThis.String(object.type) : "",
6867
7011
  mode: isSet(object.mode) ? globalThis.String(object.mode) : "",
6868
- inputRows: isSet(object.inputRows) ? globalThis.Number(object.inputRows) : isSet(object.input_rows) ? globalThis.Number(object.input_rows) : 0,
6869
- outputRows: isSet(object.outputRows) ? globalThis.Number(object.outputRows) : isSet(object.output_rows) ? globalThis.Number(object.output_rows) : 0,
6870
- hashDedupSize: isSet(object.hashDedupSize) ? globalThis.Number(object.hashDedupSize) : isSet(object.hash_dedup_size) ? globalThis.Number(object.hash_dedup_size) : 0,
6871
- distinctFillPct: isSet(object.distinctFillPct) ? globalThis.Number(object.distinctFillPct) : isSet(object.distinct_fill_pct) ? globalThis.Number(object.distinct_fill_pct) : 0
7012
+ inputRows: isSet(object.inputRows) ? BigInt(object.inputRows) : isSet(object.input_rows) ? BigInt(object.input_rows) : 0n,
7013
+ outputRows: isSet(object.outputRows) ? BigInt(object.outputRows) : isSet(object.output_rows) ? BigInt(object.output_rows) : 0n,
7014
+ hashDedupSize: isSet(object.hashDedupSize) ? BigInt(object.hashDedupSize) : isSet(object.hash_dedup_size) ? BigInt(object.hash_dedup_size) : 0n,
7015
+ distinctFillPct: isSet(object.distinctFillPct) ? BigInt(object.distinctFillPct) : isSet(object.distinct_fill_pct) ? BigInt(object.distinct_fill_pct) : 0n
6872
7016
  };
6873
7017
  },
6874
7018
  toJSON(message) {
@@ -6879,17 +7023,17 @@ var init_geode = __esm({
6879
7023
  if (message.mode !== "") {
6880
7024
  obj.mode = message.mode;
6881
7025
  }
6882
- if (message.inputRows !== 0) {
6883
- obj.inputRows = Math.round(message.inputRows);
7026
+ if (message.inputRows !== 0n) {
7027
+ obj.inputRows = message.inputRows.toString();
6884
7028
  }
6885
- if (message.outputRows !== 0) {
6886
- obj.outputRows = Math.round(message.outputRows);
7029
+ if (message.outputRows !== 0n) {
7030
+ obj.outputRows = message.outputRows.toString();
6887
7031
  }
6888
- if (message.hashDedupSize !== 0) {
6889
- obj.hashDedupSize = Math.round(message.hashDedupSize);
7032
+ if (message.hashDedupSize !== 0n) {
7033
+ obj.hashDedupSize = message.hashDedupSize.toString();
6890
7034
  }
6891
- if (message.distinctFillPct !== 0) {
6892
- obj.distinctFillPct = Math.round(message.distinctFillPct);
7035
+ if (message.distinctFillPct !== 0n) {
7036
+ obj.distinctFillPct = message.distinctFillPct.toString();
6893
7037
  }
6894
7038
  return obj;
6895
7039
  },
@@ -6900,10 +7044,10 @@ var init_geode = __esm({
6900
7044
  const message = createBaseProfileSetOp();
6901
7045
  message.type = object.type ?? "";
6902
7046
  message.mode = object.mode ?? "";
6903
- message.inputRows = object.inputRows ?? 0;
6904
- message.outputRows = object.outputRows ?? 0;
6905
- message.hashDedupSize = object.hashDedupSize ?? 0;
6906
- message.distinctFillPct = object.distinctFillPct ?? 0;
7047
+ message.inputRows = object.inputRows ?? 0n;
7048
+ message.outputRows = object.outputRows ?? 0n;
7049
+ message.hashDedupSize = object.hashDedupSize ?? 0n;
7050
+ message.distinctFillPct = object.distinctFillPct ?? 0n;
6907
7051
  return message;
6908
7052
  }
6909
7053
  };
@@ -6921,7 +7065,10 @@ var init_geode = __esm({
6921
7065
  if (message.totals !== void 0) {
6922
7066
  ProfileTotals.encode(message.totals, writer.uint32(34).fork()).join();
6923
7067
  }
6924
- if (message.totalTimeNs !== 0) {
7068
+ if (message.totalTimeNs !== 0n) {
7069
+ if (BigInt.asUintN(64, message.totalTimeNs) !== message.totalTimeNs) {
7070
+ throw new globalThis.Error("value provided for field message.totalTimeNs of type uint64 too large");
7071
+ }
6925
7072
  writer.uint32(40).uint64(message.totalTimeNs);
6926
7073
  }
6927
7074
  if (message.spills !== void 0) {
@@ -6939,19 +7086,31 @@ var init_geode = __esm({
6939
7086
  if (message.setop !== void 0) {
6940
7087
  ProfileSetOp.encode(message.setop, writer.uint32(82).fork()).join();
6941
7088
  }
6942
- if (message.hashaggSpills !== 0) {
7089
+ if (message.hashaggSpills !== 0n) {
7090
+ if (BigInt.asUintN(64, message.hashaggSpills) !== message.hashaggSpills) {
7091
+ throw new globalThis.Error("value provided for field message.hashaggSpills of type uint64 too large");
7092
+ }
6943
7093
  writer.uint32(88).uint64(message.hashaggSpills);
6944
7094
  }
6945
7095
  if (message.hashaggSpillReason !== "") {
6946
7096
  writer.uint32(98).string(message.hashaggSpillReason);
6947
7097
  }
6948
- if (message.committedTxns !== 0) {
7098
+ if (message.committedTxns !== 0n) {
7099
+ if (BigInt.asUintN(64, message.committedTxns) !== message.committedTxns) {
7100
+ throw new globalThis.Error("value provided for field message.committedTxns of type uint64 too large");
7101
+ }
6949
7102
  writer.uint32(104).uint64(message.committedTxns);
6950
7103
  }
6951
- if (message.graphStoreNodes !== 0) {
7104
+ if (message.graphStoreNodes !== 0n) {
7105
+ if (BigInt.asUintN(64, message.graphStoreNodes) !== message.graphStoreNodes) {
7106
+ throw new globalThis.Error("value provided for field message.graphStoreNodes of type uint64 too large");
7107
+ }
6952
7108
  writer.uint32(112).uint64(message.graphStoreNodes);
6953
7109
  }
6954
- if (message.graphStoreEdges !== 0) {
7110
+ if (message.graphStoreEdges !== 0n) {
7111
+ if (BigInt.asUintN(64, message.graphStoreEdges) !== message.graphStoreEdges) {
7112
+ throw new globalThis.Error("value provided for field message.graphStoreEdges of type uint64 too large");
7113
+ }
6955
7114
  writer.uint32(120).uint64(message.graphStoreEdges);
6956
7115
  }
6957
7116
  if (message.graphStoreDirty !== false) {
@@ -7004,7 +7163,7 @@ var init_geode = __esm({
7004
7163
  if (tag !== 40) {
7005
7164
  break;
7006
7165
  }
7007
- message.totalTimeNs = longToNumber(reader.uint64());
7166
+ message.totalTimeNs = reader.uint64();
7008
7167
  continue;
7009
7168
  }
7010
7169
  case 6: {
@@ -7046,7 +7205,7 @@ var init_geode = __esm({
7046
7205
  if (tag !== 88) {
7047
7206
  break;
7048
7207
  }
7049
- message.hashaggSpills = longToNumber(reader.uint64());
7208
+ message.hashaggSpills = reader.uint64();
7050
7209
  continue;
7051
7210
  }
7052
7211
  case 12: {
@@ -7060,21 +7219,21 @@ var init_geode = __esm({
7060
7219
  if (tag !== 104) {
7061
7220
  break;
7062
7221
  }
7063
- message.committedTxns = longToNumber(reader.uint64());
7222
+ message.committedTxns = reader.uint64();
7064
7223
  continue;
7065
7224
  }
7066
7225
  case 14: {
7067
7226
  if (tag !== 112) {
7068
7227
  break;
7069
7228
  }
7070
- message.graphStoreNodes = longToNumber(reader.uint64());
7229
+ message.graphStoreNodes = reader.uint64();
7071
7230
  continue;
7072
7231
  }
7073
7232
  case 15: {
7074
7233
  if (tag !== 120) {
7075
7234
  break;
7076
7235
  }
7077
- message.graphStoreEdges = longToNumber(reader.uint64());
7236
+ message.graphStoreEdges = reader.uint64();
7078
7237
  continue;
7079
7238
  }
7080
7239
  case 16: {
@@ -7112,17 +7271,17 @@ var init_geode = __esm({
7112
7271
  ops: globalThis.Array.isArray(object?.ops) ? object.ops.map((e) => ProfileOp.fromJSON(e)) : [],
7113
7272
  peakContributors: globalThis.Array.isArray(object?.peakContributors) ? object.peakContributors.map((e) => ProfilePeakContributor.fromJSON(e)) : globalThis.Array.isArray(object?.peak_contributors) ? object.peak_contributors.map((e) => ProfilePeakContributor.fromJSON(e)) : [],
7114
7273
  totals: isSet(object.totals) ? ProfileTotals.fromJSON(object.totals) : void 0,
7115
- totalTimeNs: isSet(object.totalTimeNs) ? globalThis.Number(object.totalTimeNs) : isSet(object.total_time_ns) ? globalThis.Number(object.total_time_ns) : 0,
7274
+ totalTimeNs: isSet(object.totalTimeNs) ? BigInt(object.totalTimeNs) : isSet(object.total_time_ns) ? BigInt(object.total_time_ns) : 0n,
7116
7275
  spills: isSet(object.spills) ? ProfileSpills.fromJSON(object.spills) : void 0,
7117
7276
  memory: isSet(object.memory) ? ProfileMemory.fromJSON(object.memory) : void 0,
7118
7277
  plannerEstimates: isSet(object.plannerEstimates) ? ProfilePlannerEstimates.fromJSON(object.plannerEstimates) : isSet(object.planner_estimates) ? ProfilePlannerEstimates.fromJSON(object.planner_estimates) : void 0,
7119
7278
  memCurve: globalThis.Array.isArray(object?.memCurve) ? object.memCurve.map((e) => ProfileMemCurvePoint.fromJSON(e)) : globalThis.Array.isArray(object?.mem_curve) ? object.mem_curve.map((e) => ProfileMemCurvePoint.fromJSON(e)) : [],
7120
7279
  setop: isSet(object.setop) ? ProfileSetOp.fromJSON(object.setop) : void 0,
7121
- hashaggSpills: isSet(object.hashaggSpills) ? globalThis.Number(object.hashaggSpills) : isSet(object.hashagg_spills) ? globalThis.Number(object.hashagg_spills) : 0,
7280
+ hashaggSpills: isSet(object.hashaggSpills) ? BigInt(object.hashaggSpills) : isSet(object.hashagg_spills) ? BigInt(object.hashagg_spills) : 0n,
7122
7281
  hashaggSpillReason: isSet(object.hashaggSpillReason) ? globalThis.String(object.hashaggSpillReason) : isSet(object.hashagg_spill_reason) ? globalThis.String(object.hashagg_spill_reason) : "",
7123
- committedTxns: isSet(object.committedTxns) ? globalThis.Number(object.committedTxns) : isSet(object.committed_txns) ? globalThis.Number(object.committed_txns) : 0,
7124
- graphStoreNodes: isSet(object.graphStoreNodes) ? globalThis.Number(object.graphStoreNodes) : isSet(object.graph_store_nodes) ? globalThis.Number(object.graph_store_nodes) : 0,
7125
- graphStoreEdges: isSet(object.graphStoreEdges) ? globalThis.Number(object.graphStoreEdges) : isSet(object.graph_store_edges) ? globalThis.Number(object.graph_store_edges) : 0,
7282
+ committedTxns: isSet(object.committedTxns) ? BigInt(object.committedTxns) : isSet(object.committed_txns) ? BigInt(object.committed_txns) : 0n,
7283
+ graphStoreNodes: isSet(object.graphStoreNodes) ? BigInt(object.graphStoreNodes) : isSet(object.graph_store_nodes) ? BigInt(object.graph_store_nodes) : 0n,
7284
+ graphStoreEdges: isSet(object.graphStoreEdges) ? BigInt(object.graphStoreEdges) : isSet(object.graph_store_edges) ? BigInt(object.graph_store_edges) : 0n,
7126
7285
  graphStoreDirty: isSet(object.graphStoreDirty) ? globalThis.Boolean(object.graphStoreDirty) : isSet(object.graph_store_dirty) ? globalThis.Boolean(object.graph_store_dirty) : false,
7127
7286
  flaggerFindings: globalThis.Array.isArray(object?.flaggerFindings) ? object.flaggerFindings.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.flagger_findings) ? object.flagger_findings.map((e) => globalThis.String(e)) : [],
7128
7287
  compact: isSet(object.compact) ? globalThis.Boolean(object.compact) : false
@@ -7142,8 +7301,8 @@ var init_geode = __esm({
7142
7301
  if (message.totals !== void 0) {
7143
7302
  obj.totals = ProfileTotals.toJSON(message.totals);
7144
7303
  }
7145
- if (message.totalTimeNs !== 0) {
7146
- obj.totalTimeNs = Math.round(message.totalTimeNs);
7304
+ if (message.totalTimeNs !== 0n) {
7305
+ obj.totalTimeNs = message.totalTimeNs.toString();
7147
7306
  }
7148
7307
  if (message.spills !== void 0) {
7149
7308
  obj.spills = ProfileSpills.toJSON(message.spills);
@@ -7160,20 +7319,20 @@ var init_geode = __esm({
7160
7319
  if (message.setop !== void 0) {
7161
7320
  obj.setop = ProfileSetOp.toJSON(message.setop);
7162
7321
  }
7163
- if (message.hashaggSpills !== 0) {
7164
- obj.hashaggSpills = Math.round(message.hashaggSpills);
7322
+ if (message.hashaggSpills !== 0n) {
7323
+ obj.hashaggSpills = message.hashaggSpills.toString();
7165
7324
  }
7166
7325
  if (message.hashaggSpillReason !== "") {
7167
7326
  obj.hashaggSpillReason = message.hashaggSpillReason;
7168
7327
  }
7169
- if (message.committedTxns !== 0) {
7170
- obj.committedTxns = Math.round(message.committedTxns);
7328
+ if (message.committedTxns !== 0n) {
7329
+ obj.committedTxns = message.committedTxns.toString();
7171
7330
  }
7172
- if (message.graphStoreNodes !== 0) {
7173
- obj.graphStoreNodes = Math.round(message.graphStoreNodes);
7331
+ if (message.graphStoreNodes !== 0n) {
7332
+ obj.graphStoreNodes = message.graphStoreNodes.toString();
7174
7333
  }
7175
- if (message.graphStoreEdges !== 0) {
7176
- obj.graphStoreEdges = Math.round(message.graphStoreEdges);
7334
+ if (message.graphStoreEdges !== 0n) {
7335
+ obj.graphStoreEdges = message.graphStoreEdges.toString();
7177
7336
  }
7178
7337
  if (message.graphStoreDirty !== false) {
7179
7338
  obj.graphStoreDirty = message.graphStoreDirty;
@@ -7195,17 +7354,17 @@ var init_geode = __esm({
7195
7354
  message.ops = object.ops?.map((e) => ProfileOp.fromPartial(e)) || [];
7196
7355
  message.peakContributors = object.peakContributors?.map((e) => ProfilePeakContributor.fromPartial(e)) || [];
7197
7356
  message.totals = object.totals !== void 0 && object.totals !== null ? ProfileTotals.fromPartial(object.totals) : void 0;
7198
- message.totalTimeNs = object.totalTimeNs ?? 0;
7357
+ message.totalTimeNs = object.totalTimeNs ?? 0n;
7199
7358
  message.spills = object.spills !== void 0 && object.spills !== null ? ProfileSpills.fromPartial(object.spills) : void 0;
7200
7359
  message.memory = object.memory !== void 0 && object.memory !== null ? ProfileMemory.fromPartial(object.memory) : void 0;
7201
7360
  message.plannerEstimates = object.plannerEstimates !== void 0 && object.plannerEstimates !== null ? ProfilePlannerEstimates.fromPartial(object.plannerEstimates) : void 0;
7202
7361
  message.memCurve = object.memCurve?.map((e) => ProfileMemCurvePoint.fromPartial(e)) || [];
7203
7362
  message.setop = object.setop !== void 0 && object.setop !== null ? ProfileSetOp.fromPartial(object.setop) : void 0;
7204
- message.hashaggSpills = object.hashaggSpills ?? 0;
7363
+ message.hashaggSpills = object.hashaggSpills ?? 0n;
7205
7364
  message.hashaggSpillReason = object.hashaggSpillReason ?? "";
7206
- message.committedTxns = object.committedTxns ?? 0;
7207
- message.graphStoreNodes = object.graphStoreNodes ?? 0;
7208
- message.graphStoreEdges = object.graphStoreEdges ?? 0;
7365
+ message.committedTxns = object.committedTxns ?? 0n;
7366
+ message.graphStoreNodes = object.graphStoreNodes ?? 0n;
7367
+ message.graphStoreEdges = object.graphStoreEdges ?? 0n;
7209
7368
  message.graphStoreDirty = object.graphStoreDirty ?? false;
7210
7369
  message.flaggerFindings = object.flaggerFindings?.map((e) => e) || [];
7211
7370
  message.compact = object.compact ?? false;
@@ -7877,7 +8036,10 @@ var init_geode = __esm({
7877
8036
  }
7878
8037
  };
7879
8038
  CdcDiagnosticsRequest = {
7880
- encode(_, writer = new BinaryWriter()) {
8039
+ encode(message, writer = new BinaryWriter()) {
8040
+ if (message.sessionId !== "") {
8041
+ writer.uint32(10).string(message.sessionId);
8042
+ }
7881
8043
  return writer;
7882
8044
  },
7883
8045
  decode(input, length) {
@@ -7886,6 +8048,15 @@ var init_geode = __esm({
7886
8048
  const message = createBaseCdcDiagnosticsRequest();
7887
8049
  while (reader.pos < end) {
7888
8050
  const tag = reader.uint32();
8051
+ switch (tag >>> 3) {
8052
+ case 1: {
8053
+ if (tag !== 10) {
8054
+ break;
8055
+ }
8056
+ message.sessionId = reader.string();
8057
+ continue;
8058
+ }
8059
+ }
7889
8060
  if ((tag & 7) === 4 || tag === 0) {
7890
8061
  break;
7891
8062
  }
@@ -7893,18 +8064,24 @@ var init_geode = __esm({
7893
8064
  }
7894
8065
  return message;
7895
8066
  },
7896
- fromJSON(_) {
7897
- return {};
8067
+ fromJSON(object) {
8068
+ return {
8069
+ sessionId: isSet(object.sessionId) ? globalThis.String(object.sessionId) : isSet(object.session_id) ? globalThis.String(object.session_id) : ""
8070
+ };
7898
8071
  },
7899
- toJSON(_) {
8072
+ toJSON(message) {
7900
8073
  const obj = {};
8074
+ if (message.sessionId !== "") {
8075
+ obj.sessionId = message.sessionId;
8076
+ }
7901
8077
  return obj;
7902
8078
  },
7903
8079
  create(base) {
7904
8080
  return CdcDiagnosticsRequest.fromPartial(base ?? {});
7905
8081
  },
7906
- fromPartial(_) {
8082
+ fromPartial(object) {
7907
8083
  const message = createBaseCdcDiagnosticsRequest();
8084
+ message.sessionId = object.sessionId ?? "";
7908
8085
  return message;
7909
8086
  }
7910
8087
  };
@@ -7913,7 +8090,12 @@ var init_geode = __esm({
7913
8090
  if (message.enabled !== false) {
7914
8091
  writer.uint32(8).bool(message.enabled);
7915
8092
  }
7916
- if (message.malformedSnapshotInterval !== 0) {
8093
+ if (message.malformedSnapshotInterval !== 0n) {
8094
+ if (BigInt.asUintN(64, message.malformedSnapshotInterval) !== message.malformedSnapshotInterval) {
8095
+ throw new globalThis.Error(
8096
+ "value provided for field message.malformedSnapshotInterval of type uint64 too large"
8097
+ );
8098
+ }
7917
8099
  writer.uint32(16).uint64(message.malformedSnapshotInterval);
7918
8100
  }
7919
8101
  if (message.malformedHashRetain !== 0) {
@@ -7931,7 +8113,12 @@ var init_geode = __esm({
7931
8113
  if (message.batchSize !== 0) {
7932
8114
  writer.uint32(56).uint32(message.batchSize);
7933
8115
  }
7934
- if (message.pendingBackpressureWatermark !== 0) {
8116
+ if (message.pendingBackpressureWatermark !== 0n) {
8117
+ if (BigInt.asUintN(64, message.pendingBackpressureWatermark) !== message.pendingBackpressureWatermark) {
8118
+ throw new globalThis.Error(
8119
+ "value provided for field message.pendingBackpressureWatermark of type uint64 too large"
8120
+ );
8121
+ }
7935
8122
  writer.uint32(64).uint64(message.pendingBackpressureWatermark);
7936
8123
  }
7937
8124
  return writer;
@@ -7954,7 +8141,7 @@ var init_geode = __esm({
7954
8141
  if (tag !== 16) {
7955
8142
  break;
7956
8143
  }
7957
- message.malformedSnapshotInterval = longToNumber(reader.uint64());
8144
+ message.malformedSnapshotInterval = reader.uint64();
7958
8145
  continue;
7959
8146
  }
7960
8147
  case 3: {
@@ -7996,7 +8183,7 @@ var init_geode = __esm({
7996
8183
  if (tag !== 64) {
7997
8184
  break;
7998
8185
  }
7999
- message.pendingBackpressureWatermark = longToNumber(reader.uint64());
8186
+ message.pendingBackpressureWatermark = reader.uint64();
8000
8187
  continue;
8001
8188
  }
8002
8189
  }
@@ -8010,13 +8197,13 @@ var init_geode = __esm({
8010
8197
  fromJSON(object) {
8011
8198
  return {
8012
8199
  enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
8013
- malformedSnapshotInterval: isSet(object.malformedSnapshotInterval) ? globalThis.Number(object.malformedSnapshotInterval) : isSet(object.malformed_snapshot_interval) ? globalThis.Number(object.malformed_snapshot_interval) : 0,
8200
+ malformedSnapshotInterval: isSet(object.malformedSnapshotInterval) ? BigInt(object.malformedSnapshotInterval) : isSet(object.malformed_snapshot_interval) ? BigInt(object.malformed_snapshot_interval) : 0n,
8014
8201
  malformedHashRetain: isSet(object.malformedHashRetain) ? globalThis.Number(object.malformedHashRetain) : isSet(object.malformed_hash_retain) ? globalThis.Number(object.malformed_hash_retain) : 0,
8015
8202
  malformedWarnPct: isSet(object.malformedWarnPct) ? globalThis.Number(object.malformedWarnPct) : isSet(object.malformed_warn_pct) ? globalThis.Number(object.malformed_warn_pct) : 0,
8016
8203
  malformedAbortPct: isSet(object.malformedAbortPct) ? globalThis.Number(object.malformedAbortPct) : isSet(object.malformed_abort_pct) ? globalThis.Number(object.malformed_abort_pct) : 0,
8017
8204
  flushIntervalMs: isSet(object.flushIntervalMs) ? globalThis.Number(object.flushIntervalMs) : isSet(object.flush_interval_ms) ? globalThis.Number(object.flush_interval_ms) : 0,
8018
8205
  batchSize: isSet(object.batchSize) ? globalThis.Number(object.batchSize) : isSet(object.batch_size) ? globalThis.Number(object.batch_size) : 0,
8019
- pendingBackpressureWatermark: isSet(object.pendingBackpressureWatermark) ? globalThis.Number(object.pendingBackpressureWatermark) : isSet(object.pending_backpressure_watermark) ? globalThis.Number(object.pending_backpressure_watermark) : 0
8206
+ pendingBackpressureWatermark: isSet(object.pendingBackpressureWatermark) ? BigInt(object.pendingBackpressureWatermark) : isSet(object.pending_backpressure_watermark) ? BigInt(object.pending_backpressure_watermark) : 0n
8020
8207
  };
8021
8208
  },
8022
8209
  toJSON(message) {
@@ -8024,8 +8211,8 @@ var init_geode = __esm({
8024
8211
  if (message.enabled !== false) {
8025
8212
  obj.enabled = message.enabled;
8026
8213
  }
8027
- if (message.malformedSnapshotInterval !== 0) {
8028
- obj.malformedSnapshotInterval = Math.round(message.malformedSnapshotInterval);
8214
+ if (message.malformedSnapshotInterval !== 0n) {
8215
+ obj.malformedSnapshotInterval = message.malformedSnapshotInterval.toString();
8029
8216
  }
8030
8217
  if (message.malformedHashRetain !== 0) {
8031
8218
  obj.malformedHashRetain = Math.round(message.malformedHashRetain);
@@ -8042,8 +8229,8 @@ var init_geode = __esm({
8042
8229
  if (message.batchSize !== 0) {
8043
8230
  obj.batchSize = Math.round(message.batchSize);
8044
8231
  }
8045
- if (message.pendingBackpressureWatermark !== 0) {
8046
- obj.pendingBackpressureWatermark = Math.round(message.pendingBackpressureWatermark);
8232
+ if (message.pendingBackpressureWatermark !== 0n) {
8233
+ obj.pendingBackpressureWatermark = message.pendingBackpressureWatermark.toString();
8047
8234
  }
8048
8235
  return obj;
8049
8236
  },
@@ -8053,13 +8240,13 @@ var init_geode = __esm({
8053
8240
  fromPartial(object) {
8054
8241
  const message = createBaseCdcDiagnosticsConfig();
8055
8242
  message.enabled = object.enabled ?? false;
8056
- message.malformedSnapshotInterval = object.malformedSnapshotInterval ?? 0;
8243
+ message.malformedSnapshotInterval = object.malformedSnapshotInterval ?? 0n;
8057
8244
  message.malformedHashRetain = object.malformedHashRetain ?? 0;
8058
8245
  message.malformedWarnPct = object.malformedWarnPct ?? 0;
8059
8246
  message.malformedAbortPct = object.malformedAbortPct ?? 0;
8060
8247
  message.flushIntervalMs = object.flushIntervalMs ?? 0;
8061
8248
  message.batchSize = object.batchSize ?? 0;
8062
- message.pendingBackpressureWatermark = object.pendingBackpressureWatermark ?? 0;
8249
+ message.pendingBackpressureWatermark = object.pendingBackpressureWatermark ?? 0n;
8063
8250
  return message;
8064
8251
  }
8065
8252
  };
@@ -8068,13 +8255,22 @@ var init_geode = __esm({
8068
8255
  if (message.isRunning !== false) {
8069
8256
  writer.uint32(8).bool(message.isRunning);
8070
8257
  }
8071
- if (message.lastFlushMs !== 0) {
8258
+ if (message.lastFlushMs !== 0n) {
8259
+ if (BigInt.asIntN(64, message.lastFlushMs) !== message.lastFlushMs) {
8260
+ throw new globalThis.Error("value provided for field message.lastFlushMs of type int64 too large");
8261
+ }
8072
8262
  writer.uint32(16).int64(message.lastFlushMs);
8073
8263
  }
8074
- if (message.peakBuffer !== 0) {
8264
+ if (message.peakBuffer !== 0n) {
8265
+ if (BigInt.asUintN(64, message.peakBuffer) !== message.peakBuffer) {
8266
+ throw new globalThis.Error("value provided for field message.peakBuffer of type uint64 too large");
8267
+ }
8075
8268
  writer.uint32(24).uint64(message.peakBuffer);
8076
8269
  }
8077
- if (message.currentBuffer !== 0) {
8270
+ if (message.currentBuffer !== 0n) {
8271
+ if (BigInt.asUintN(64, message.currentBuffer) !== message.currentBuffer) {
8272
+ throw new globalThis.Error("value provided for field message.currentBuffer of type uint64 too large");
8273
+ }
8078
8274
  writer.uint32(32).uint64(message.currentBuffer);
8079
8275
  }
8080
8276
  if (message.dynamicBatchSize !== 0) {
@@ -8103,21 +8299,21 @@ var init_geode = __esm({
8103
8299
  if (tag !== 16) {
8104
8300
  break;
8105
8301
  }
8106
- message.lastFlushMs = longToNumber(reader.int64());
8302
+ message.lastFlushMs = reader.int64();
8107
8303
  continue;
8108
8304
  }
8109
8305
  case 3: {
8110
8306
  if (tag !== 24) {
8111
8307
  break;
8112
8308
  }
8113
- message.peakBuffer = longToNumber(reader.uint64());
8309
+ message.peakBuffer = reader.uint64();
8114
8310
  continue;
8115
8311
  }
8116
8312
  case 4: {
8117
8313
  if (tag !== 32) {
8118
8314
  break;
8119
8315
  }
8120
- message.currentBuffer = longToNumber(reader.uint64());
8316
+ message.currentBuffer = reader.uint64();
8121
8317
  continue;
8122
8318
  }
8123
8319
  case 5: {
@@ -8145,9 +8341,9 @@ var init_geode = __esm({
8145
8341
  fromJSON(object) {
8146
8342
  return {
8147
8343
  isRunning: isSet(object.isRunning) ? globalThis.Boolean(object.isRunning) : isSet(object.is_running) ? globalThis.Boolean(object.is_running) : false,
8148
- lastFlushMs: isSet(object.lastFlushMs) ? globalThis.Number(object.lastFlushMs) : isSet(object.last_flush_ms) ? globalThis.Number(object.last_flush_ms) : 0,
8149
- peakBuffer: isSet(object.peakBuffer) ? globalThis.Number(object.peakBuffer) : isSet(object.peak_buffer) ? globalThis.Number(object.peak_buffer) : 0,
8150
- currentBuffer: isSet(object.currentBuffer) ? globalThis.Number(object.currentBuffer) : isSet(object.current_buffer) ? globalThis.Number(object.current_buffer) : 0,
8344
+ lastFlushMs: isSet(object.lastFlushMs) ? BigInt(object.lastFlushMs) : isSet(object.last_flush_ms) ? BigInt(object.last_flush_ms) : 0n,
8345
+ peakBuffer: isSet(object.peakBuffer) ? BigInt(object.peakBuffer) : isSet(object.peak_buffer) ? BigInt(object.peak_buffer) : 0n,
8346
+ currentBuffer: isSet(object.currentBuffer) ? BigInt(object.currentBuffer) : isSet(object.current_buffer) ? BigInt(object.current_buffer) : 0n,
8151
8347
  dynamicBatchSize: isSet(object.dynamicBatchSize) ? globalThis.Number(object.dynamicBatchSize) : isSet(object.dynamic_batch_size) ? globalThis.Number(object.dynamic_batch_size) : 0,
8152
8348
  batchAdjustments: isSet(object.batchAdjustments) ? globalThis.Number(object.batchAdjustments) : isSet(object.batch_adjustments) ? globalThis.Number(object.batch_adjustments) : 0
8153
8349
  };
@@ -8157,14 +8353,14 @@ var init_geode = __esm({
8157
8353
  if (message.isRunning !== false) {
8158
8354
  obj.isRunning = message.isRunning;
8159
8355
  }
8160
- if (message.lastFlushMs !== 0) {
8161
- obj.lastFlushMs = Math.round(message.lastFlushMs);
8356
+ if (message.lastFlushMs !== 0n) {
8357
+ obj.lastFlushMs = message.lastFlushMs.toString();
8162
8358
  }
8163
- if (message.peakBuffer !== 0) {
8164
- obj.peakBuffer = Math.round(message.peakBuffer);
8359
+ if (message.peakBuffer !== 0n) {
8360
+ obj.peakBuffer = message.peakBuffer.toString();
8165
8361
  }
8166
- if (message.currentBuffer !== 0) {
8167
- obj.currentBuffer = Math.round(message.currentBuffer);
8362
+ if (message.currentBuffer !== 0n) {
8363
+ obj.currentBuffer = message.currentBuffer.toString();
8168
8364
  }
8169
8365
  if (message.dynamicBatchSize !== 0) {
8170
8366
  obj.dynamicBatchSize = Math.round(message.dynamicBatchSize);
@@ -8180,9 +8376,9 @@ var init_geode = __esm({
8180
8376
  fromPartial(object) {
8181
8377
  const message = createBaseCdcDiagnosticsEngine();
8182
8378
  message.isRunning = object.isRunning ?? false;
8183
- message.lastFlushMs = object.lastFlushMs ?? 0;
8184
- message.peakBuffer = object.peakBuffer ?? 0;
8185
- message.currentBuffer = object.currentBuffer ?? 0;
8379
+ message.lastFlushMs = object.lastFlushMs ?? 0n;
8380
+ message.peakBuffer = object.peakBuffer ?? 0n;
8381
+ message.currentBuffer = object.currentBuffer ?? 0n;
8186
8382
  message.dynamicBatchSize = object.dynamicBatchSize ?? 0;
8187
8383
  message.batchAdjustments = object.batchAdjustments ?? 0;
8188
8384
  return message;
@@ -8190,10 +8386,16 @@ var init_geode = __esm({
8190
8386
  };
8191
8387
  CdcMalformedSnapshot = {
8192
8388
  encode(message, writer = new BinaryWriter()) {
8193
- if (message.count !== 0) {
8389
+ if (message.count !== 0n) {
8390
+ if (BigInt.asUintN(64, message.count) !== message.count) {
8391
+ throw new globalThis.Error("value provided for field message.count of type uint64 too large");
8392
+ }
8194
8393
  writer.uint32(8).uint64(message.count);
8195
8394
  }
8196
- if (message.tsMs !== 0) {
8395
+ if (message.tsMs !== 0n) {
8396
+ if (BigInt.asIntN(64, message.tsMs) !== message.tsMs) {
8397
+ throw new globalThis.Error("value provided for field message.tsMs of type int64 too large");
8398
+ }
8197
8399
  writer.uint32(16).int64(message.tsMs);
8198
8400
  }
8199
8401
  return writer;
@@ -8209,14 +8411,14 @@ var init_geode = __esm({
8209
8411
  if (tag !== 8) {
8210
8412
  break;
8211
8413
  }
8212
- message.count = longToNumber(reader.uint64());
8414
+ message.count = reader.uint64();
8213
8415
  continue;
8214
8416
  }
8215
8417
  case 2: {
8216
8418
  if (tag !== 16) {
8217
8419
  break;
8218
8420
  }
8219
- message.tsMs = longToNumber(reader.int64());
8421
+ message.tsMs = reader.int64();
8220
8422
  continue;
8221
8423
  }
8222
8424
  }
@@ -8229,17 +8431,17 @@ var init_geode = __esm({
8229
8431
  },
8230
8432
  fromJSON(object) {
8231
8433
  return {
8232
- count: isSet(object.count) ? globalThis.Number(object.count) : 0,
8233
- tsMs: isSet(object.tsMs) ? globalThis.Number(object.tsMs) : isSet(object.ts_ms) ? globalThis.Number(object.ts_ms) : 0
8434
+ count: isSet(object.count) ? BigInt(object.count) : 0n,
8435
+ tsMs: isSet(object.tsMs) ? BigInt(object.tsMs) : isSet(object.ts_ms) ? BigInt(object.ts_ms) : 0n
8234
8436
  };
8235
8437
  },
8236
8438
  toJSON(message) {
8237
8439
  const obj = {};
8238
- if (message.count !== 0) {
8239
- obj.count = Math.round(message.count);
8440
+ if (message.count !== 0n) {
8441
+ obj.count = message.count.toString();
8240
8442
  }
8241
- if (message.tsMs !== 0) {
8242
- obj.tsMs = Math.round(message.tsMs);
8443
+ if (message.tsMs !== 0n) {
8444
+ obj.tsMs = message.tsMs.toString();
8243
8445
  }
8244
8446
  return obj;
8245
8447
  },
@@ -8248,20 +8450,29 @@ var init_geode = __esm({
8248
8450
  },
8249
8451
  fromPartial(object) {
8250
8452
  const message = createBaseCdcMalformedSnapshot();
8251
- message.count = object.count ?? 0;
8252
- message.tsMs = object.tsMs ?? 0;
8453
+ message.count = object.count ?? 0n;
8454
+ message.tsMs = object.tsMs ?? 0n;
8253
8455
  return message;
8254
8456
  }
8255
8457
  };
8256
8458
  CdcMalformedHash = {
8257
8459
  encode(message, writer = new BinaryWriter()) {
8258
- if (message.count !== 0) {
8460
+ if (message.count !== 0n) {
8461
+ if (BigInt.asUintN(64, message.count) !== message.count) {
8462
+ throw new globalThis.Error("value provided for field message.count of type uint64 too large");
8463
+ }
8259
8464
  writer.uint32(8).uint64(message.count);
8260
8465
  }
8261
- if (message.hash !== 0) {
8466
+ if (message.hash !== 0n) {
8467
+ if (BigInt.asUintN(64, message.hash) !== message.hash) {
8468
+ throw new globalThis.Error("value provided for field message.hash of type uint64 too large");
8469
+ }
8262
8470
  writer.uint32(16).uint64(message.hash);
8263
8471
  }
8264
- if (message.tsMs !== 0) {
8472
+ if (message.tsMs !== 0n) {
8473
+ if (BigInt.asIntN(64, message.tsMs) !== message.tsMs) {
8474
+ throw new globalThis.Error("value provided for field message.tsMs of type int64 too large");
8475
+ }
8265
8476
  writer.uint32(24).int64(message.tsMs);
8266
8477
  }
8267
8478
  if (message.prefixHex !== "") {
@@ -8280,21 +8491,21 @@ var init_geode = __esm({
8280
8491
  if (tag !== 8) {
8281
8492
  break;
8282
8493
  }
8283
- message.count = longToNumber(reader.uint64());
8494
+ message.count = reader.uint64();
8284
8495
  continue;
8285
8496
  }
8286
8497
  case 2: {
8287
8498
  if (tag !== 16) {
8288
8499
  break;
8289
8500
  }
8290
- message.hash = longToNumber(reader.uint64());
8501
+ message.hash = reader.uint64();
8291
8502
  continue;
8292
8503
  }
8293
8504
  case 3: {
8294
8505
  if (tag !== 24) {
8295
8506
  break;
8296
8507
  }
8297
- message.tsMs = longToNumber(reader.int64());
8508
+ message.tsMs = reader.int64();
8298
8509
  continue;
8299
8510
  }
8300
8511
  case 4: {
@@ -8314,22 +8525,22 @@ var init_geode = __esm({
8314
8525
  },
8315
8526
  fromJSON(object) {
8316
8527
  return {
8317
- count: isSet(object.count) ? globalThis.Number(object.count) : 0,
8318
- hash: isSet(object.hash) ? globalThis.Number(object.hash) : 0,
8319
- tsMs: isSet(object.tsMs) ? globalThis.Number(object.tsMs) : isSet(object.ts_ms) ? globalThis.Number(object.ts_ms) : 0,
8528
+ count: isSet(object.count) ? BigInt(object.count) : 0n,
8529
+ hash: isSet(object.hash) ? BigInt(object.hash) : 0n,
8530
+ tsMs: isSet(object.tsMs) ? BigInt(object.tsMs) : isSet(object.ts_ms) ? BigInt(object.ts_ms) : 0n,
8320
8531
  prefixHex: isSet(object.prefixHex) ? globalThis.String(object.prefixHex) : isSet(object.prefix_hex) ? globalThis.String(object.prefix_hex) : ""
8321
8532
  };
8322
8533
  },
8323
8534
  toJSON(message) {
8324
8535
  const obj = {};
8325
- if (message.count !== 0) {
8326
- obj.count = Math.round(message.count);
8536
+ if (message.count !== 0n) {
8537
+ obj.count = message.count.toString();
8327
8538
  }
8328
- if (message.hash !== 0) {
8329
- obj.hash = Math.round(message.hash);
8539
+ if (message.hash !== 0n) {
8540
+ obj.hash = message.hash.toString();
8330
8541
  }
8331
- if (message.tsMs !== 0) {
8332
- obj.tsMs = Math.round(message.tsMs);
8542
+ if (message.tsMs !== 0n) {
8543
+ obj.tsMs = message.tsMs.toString();
8333
8544
  }
8334
8545
  if (message.prefixHex !== "") {
8335
8546
  obj.prefixHex = message.prefixHex;
@@ -8341,19 +8552,25 @@ var init_geode = __esm({
8341
8552
  },
8342
8553
  fromPartial(object) {
8343
8554
  const message = createBaseCdcMalformedHash();
8344
- message.count = object.count ?? 0;
8345
- message.hash = object.hash ?? 0;
8346
- message.tsMs = object.tsMs ?? 0;
8555
+ message.count = object.count ?? 0n;
8556
+ message.hash = object.hash ?? 0n;
8557
+ message.tsMs = object.tsMs ?? 0n;
8347
8558
  message.prefixHex = object.prefixHex ?? "";
8348
8559
  return message;
8349
8560
  }
8350
8561
  };
8351
8562
  CdcDiagnosticsResponse = {
8352
8563
  encode(message, writer = new BinaryWriter()) {
8353
- if (message.malformedChangeRecords !== 0) {
8564
+ if (message.malformedChangeRecords !== 0n) {
8565
+ if (BigInt.asUintN(64, message.malformedChangeRecords) !== message.malformedChangeRecords) {
8566
+ throw new globalThis.Error("value provided for field message.malformedChangeRecords of type uint64 too large");
8567
+ }
8354
8568
  writer.uint32(8).uint64(message.malformedChangeRecords);
8355
8569
  }
8356
- if (message.totalChangeAttempts !== 0) {
8570
+ if (message.totalChangeAttempts !== 0n) {
8571
+ if (BigInt.asUintN(64, message.totalChangeAttempts) !== message.totalChangeAttempts) {
8572
+ throw new globalThis.Error("value provided for field message.totalChangeAttempts of type uint64 too large");
8573
+ }
8357
8574
  writer.uint32(16).uint64(message.totalChangeAttempts);
8358
8575
  }
8359
8576
  if (message.malformedRatio !== 0) {
@@ -8365,16 +8582,28 @@ var init_geode = __esm({
8365
8582
  if (message.guardrailAbortTriggered !== false) {
8366
8583
  writer.uint32(40).bool(message.guardrailAbortTriggered);
8367
8584
  }
8368
- if (message.firstWarnTsMs !== 0) {
8585
+ if (message.firstWarnTsMs !== 0n) {
8586
+ if (BigInt.asIntN(64, message.firstWarnTsMs) !== message.firstWarnTsMs) {
8587
+ throw new globalThis.Error("value provided for field message.firstWarnTsMs of type int64 too large");
8588
+ }
8369
8589
  writer.uint32(48).int64(message.firstWarnTsMs);
8370
8590
  }
8371
- if (message.firstAbortTsMs !== 0) {
8591
+ if (message.firstAbortTsMs !== 0n) {
8592
+ if (BigInt.asIntN(64, message.firstAbortTsMs) !== message.firstAbortTsMs) {
8593
+ throw new globalThis.Error("value provided for field message.firstAbortTsMs of type int64 too large");
8594
+ }
8372
8595
  writer.uint32(56).int64(message.firstAbortTsMs);
8373
8596
  }
8374
- if (message.guardrailEpoch !== 0) {
8597
+ if (message.guardrailEpoch !== 0n) {
8598
+ if (BigInt.asUintN(64, message.guardrailEpoch) !== message.guardrailEpoch) {
8599
+ throw new globalThis.Error("value provided for field message.guardrailEpoch of type uint64 too large");
8600
+ }
8375
8601
  writer.uint32(64).uint64(message.guardrailEpoch);
8376
8602
  }
8377
- if (message.uptimeMs !== 0) {
8603
+ if (message.uptimeMs !== 0n) {
8604
+ if (BigInt.asIntN(64, message.uptimeMs) !== message.uptimeMs) {
8605
+ throw new globalThis.Error("value provided for field message.uptimeMs of type int64 too large");
8606
+ }
8378
8607
  writer.uint32(72).int64(message.uptimeMs);
8379
8608
  }
8380
8609
  if (message.backpressure !== false) {
@@ -8395,7 +8624,10 @@ var init_geode = __esm({
8395
8624
  if (message.version !== "") {
8396
8625
  writer.uint32(122).string(message.version);
8397
8626
  }
8398
- if (message.timestampMs !== 0) {
8627
+ if (message.timestampMs !== 0n) {
8628
+ if (BigInt.asIntN(64, message.timestampMs) !== message.timestampMs) {
8629
+ throw new globalThis.Error("value provided for field message.timestampMs of type int64 too large");
8630
+ }
8399
8631
  writer.uint32(128).int64(message.timestampMs);
8400
8632
  }
8401
8633
  return writer;
@@ -8411,14 +8643,14 @@ var init_geode = __esm({
8411
8643
  if (tag !== 8) {
8412
8644
  break;
8413
8645
  }
8414
- message.malformedChangeRecords = longToNumber(reader.uint64());
8646
+ message.malformedChangeRecords = reader.uint64();
8415
8647
  continue;
8416
8648
  }
8417
8649
  case 2: {
8418
8650
  if (tag !== 16) {
8419
8651
  break;
8420
8652
  }
8421
- message.totalChangeAttempts = longToNumber(reader.uint64());
8653
+ message.totalChangeAttempts = reader.uint64();
8422
8654
  continue;
8423
8655
  }
8424
8656
  case 3: {
@@ -8446,28 +8678,28 @@ var init_geode = __esm({
8446
8678
  if (tag !== 48) {
8447
8679
  break;
8448
8680
  }
8449
- message.firstWarnTsMs = longToNumber(reader.int64());
8681
+ message.firstWarnTsMs = reader.int64();
8450
8682
  continue;
8451
8683
  }
8452
8684
  case 7: {
8453
8685
  if (tag !== 56) {
8454
8686
  break;
8455
8687
  }
8456
- message.firstAbortTsMs = longToNumber(reader.int64());
8688
+ message.firstAbortTsMs = reader.int64();
8457
8689
  continue;
8458
8690
  }
8459
8691
  case 8: {
8460
8692
  if (tag !== 64) {
8461
8693
  break;
8462
8694
  }
8463
- message.guardrailEpoch = longToNumber(reader.uint64());
8695
+ message.guardrailEpoch = reader.uint64();
8464
8696
  continue;
8465
8697
  }
8466
8698
  case 9: {
8467
8699
  if (tag !== 72) {
8468
8700
  break;
8469
8701
  }
8470
- message.uptimeMs = longToNumber(reader.int64());
8702
+ message.uptimeMs = reader.int64();
8471
8703
  continue;
8472
8704
  }
8473
8705
  case 10: {
@@ -8516,7 +8748,7 @@ var init_geode = __esm({
8516
8748
  if (tag !== 128) {
8517
8749
  break;
8518
8750
  }
8519
- message.timestampMs = longToNumber(reader.int64());
8751
+ message.timestampMs = reader.int64();
8520
8752
  continue;
8521
8753
  }
8522
8754
  }
@@ -8529,31 +8761,31 @@ var init_geode = __esm({
8529
8761
  },
8530
8762
  fromJSON(object) {
8531
8763
  return {
8532
- malformedChangeRecords: isSet(object.malformedChangeRecords) ? globalThis.Number(object.malformedChangeRecords) : isSet(object.malformed_change_records) ? globalThis.Number(object.malformed_change_records) : 0,
8533
- totalChangeAttempts: isSet(object.totalChangeAttempts) ? globalThis.Number(object.totalChangeAttempts) : isSet(object.total_change_attempts) ? globalThis.Number(object.total_change_attempts) : 0,
8764
+ malformedChangeRecords: isSet(object.malformedChangeRecords) ? BigInt(object.malformedChangeRecords) : isSet(object.malformed_change_records) ? BigInt(object.malformed_change_records) : 0n,
8765
+ totalChangeAttempts: isSet(object.totalChangeAttempts) ? BigInt(object.totalChangeAttempts) : isSet(object.total_change_attempts) ? BigInt(object.total_change_attempts) : 0n,
8534
8766
  malformedRatio: isSet(object.malformedRatio) ? globalThis.Number(object.malformedRatio) : isSet(object.malformed_ratio) ? globalThis.Number(object.malformed_ratio) : 0,
8535
8767
  guardrailWarnTriggered: isSet(object.guardrailWarnTriggered) ? globalThis.Boolean(object.guardrailWarnTriggered) : isSet(object.guardrail_warn_triggered) ? globalThis.Boolean(object.guardrail_warn_triggered) : false,
8536
8768
  guardrailAbortTriggered: isSet(object.guardrailAbortTriggered) ? globalThis.Boolean(object.guardrailAbortTriggered) : isSet(object.guardrail_abort_triggered) ? globalThis.Boolean(object.guardrail_abort_triggered) : false,
8537
- firstWarnTsMs: isSet(object.firstWarnTsMs) ? globalThis.Number(object.firstWarnTsMs) : isSet(object.first_warn_ts_ms) ? globalThis.Number(object.first_warn_ts_ms) : 0,
8538
- firstAbortTsMs: isSet(object.firstAbortTsMs) ? globalThis.Number(object.firstAbortTsMs) : isSet(object.first_abort_ts_ms) ? globalThis.Number(object.first_abort_ts_ms) : 0,
8539
- guardrailEpoch: isSet(object.guardrailEpoch) ? globalThis.Number(object.guardrailEpoch) : isSet(object.guardrail_epoch) ? globalThis.Number(object.guardrail_epoch) : 0,
8540
- uptimeMs: isSet(object.uptimeMs) ? globalThis.Number(object.uptimeMs) : isSet(object.uptime_ms) ? globalThis.Number(object.uptime_ms) : 0,
8769
+ firstWarnTsMs: isSet(object.firstWarnTsMs) ? BigInt(object.firstWarnTsMs) : isSet(object.first_warn_ts_ms) ? BigInt(object.first_warn_ts_ms) : 0n,
8770
+ firstAbortTsMs: isSet(object.firstAbortTsMs) ? BigInt(object.firstAbortTsMs) : isSet(object.first_abort_ts_ms) ? BigInt(object.first_abort_ts_ms) : 0n,
8771
+ guardrailEpoch: isSet(object.guardrailEpoch) ? BigInt(object.guardrailEpoch) : isSet(object.guardrail_epoch) ? BigInt(object.guardrail_epoch) : 0n,
8772
+ uptimeMs: isSet(object.uptimeMs) ? BigInt(object.uptimeMs) : isSet(object.uptime_ms) ? BigInt(object.uptime_ms) : 0n,
8541
8773
  backpressure: isSet(object.backpressure) ? globalThis.Boolean(object.backpressure) : false,
8542
8774
  config: isSet(object.config) ? CdcDiagnosticsConfig.fromJSON(object.config) : void 0,
8543
8775
  engine: isSet(object.engine) ? CdcDiagnosticsEngine.fromJSON(object.engine) : void 0,
8544
8776
  malformedSnapshots: globalThis.Array.isArray(object?.malformedSnapshots) ? object.malformedSnapshots.map((e) => CdcMalformedSnapshot.fromJSON(e)) : globalThis.Array.isArray(object?.malformed_snapshots) ? object.malformed_snapshots.map((e) => CdcMalformedSnapshot.fromJSON(e)) : [],
8545
8777
  malformedHashes: globalThis.Array.isArray(object?.malformedHashes) ? object.malformedHashes.map((e) => CdcMalformedHash.fromJSON(e)) : globalThis.Array.isArray(object?.malformed_hashes) ? object.malformed_hashes.map((e) => CdcMalformedHash.fromJSON(e)) : [],
8546
8778
  version: isSet(object.version) ? globalThis.String(object.version) : "",
8547
- timestampMs: isSet(object.timestampMs) ? globalThis.Number(object.timestampMs) : isSet(object.timestamp_ms) ? globalThis.Number(object.timestamp_ms) : 0
8779
+ timestampMs: isSet(object.timestampMs) ? BigInt(object.timestampMs) : isSet(object.timestamp_ms) ? BigInt(object.timestamp_ms) : 0n
8548
8780
  };
8549
8781
  },
8550
8782
  toJSON(message) {
8551
8783
  const obj = {};
8552
- if (message.malformedChangeRecords !== 0) {
8553
- obj.malformedChangeRecords = Math.round(message.malformedChangeRecords);
8784
+ if (message.malformedChangeRecords !== 0n) {
8785
+ obj.malformedChangeRecords = message.malformedChangeRecords.toString();
8554
8786
  }
8555
- if (message.totalChangeAttempts !== 0) {
8556
- obj.totalChangeAttempts = Math.round(message.totalChangeAttempts);
8787
+ if (message.totalChangeAttempts !== 0n) {
8788
+ obj.totalChangeAttempts = message.totalChangeAttempts.toString();
8557
8789
  }
8558
8790
  if (message.malformedRatio !== 0) {
8559
8791
  obj.malformedRatio = message.malformedRatio;
@@ -8564,17 +8796,17 @@ var init_geode = __esm({
8564
8796
  if (message.guardrailAbortTriggered !== false) {
8565
8797
  obj.guardrailAbortTriggered = message.guardrailAbortTriggered;
8566
8798
  }
8567
- if (message.firstWarnTsMs !== 0) {
8568
- obj.firstWarnTsMs = Math.round(message.firstWarnTsMs);
8799
+ if (message.firstWarnTsMs !== 0n) {
8800
+ obj.firstWarnTsMs = message.firstWarnTsMs.toString();
8569
8801
  }
8570
- if (message.firstAbortTsMs !== 0) {
8571
- obj.firstAbortTsMs = Math.round(message.firstAbortTsMs);
8802
+ if (message.firstAbortTsMs !== 0n) {
8803
+ obj.firstAbortTsMs = message.firstAbortTsMs.toString();
8572
8804
  }
8573
- if (message.guardrailEpoch !== 0) {
8574
- obj.guardrailEpoch = Math.round(message.guardrailEpoch);
8805
+ if (message.guardrailEpoch !== 0n) {
8806
+ obj.guardrailEpoch = message.guardrailEpoch.toString();
8575
8807
  }
8576
- if (message.uptimeMs !== 0) {
8577
- obj.uptimeMs = Math.round(message.uptimeMs);
8808
+ if (message.uptimeMs !== 0n) {
8809
+ obj.uptimeMs = message.uptimeMs.toString();
8578
8810
  }
8579
8811
  if (message.backpressure !== false) {
8580
8812
  obj.backpressure = message.backpressure;
@@ -8594,8 +8826,8 @@ var init_geode = __esm({
8594
8826
  if (message.version !== "") {
8595
8827
  obj.version = message.version;
8596
8828
  }
8597
- if (message.timestampMs !== 0) {
8598
- obj.timestampMs = Math.round(message.timestampMs);
8829
+ if (message.timestampMs !== 0n) {
8830
+ obj.timestampMs = message.timestampMs.toString();
8599
8831
  }
8600
8832
  return obj;
8601
8833
  },
@@ -8604,22 +8836,22 @@ var init_geode = __esm({
8604
8836
  },
8605
8837
  fromPartial(object) {
8606
8838
  const message = createBaseCdcDiagnosticsResponse();
8607
- message.malformedChangeRecords = object.malformedChangeRecords ?? 0;
8608
- message.totalChangeAttempts = object.totalChangeAttempts ?? 0;
8839
+ message.malformedChangeRecords = object.malformedChangeRecords ?? 0n;
8840
+ message.totalChangeAttempts = object.totalChangeAttempts ?? 0n;
8609
8841
  message.malformedRatio = object.malformedRatio ?? 0;
8610
8842
  message.guardrailWarnTriggered = object.guardrailWarnTriggered ?? false;
8611
8843
  message.guardrailAbortTriggered = object.guardrailAbortTriggered ?? false;
8612
- message.firstWarnTsMs = object.firstWarnTsMs ?? 0;
8613
- message.firstAbortTsMs = object.firstAbortTsMs ?? 0;
8614
- message.guardrailEpoch = object.guardrailEpoch ?? 0;
8615
- message.uptimeMs = object.uptimeMs ?? 0;
8844
+ message.firstWarnTsMs = object.firstWarnTsMs ?? 0n;
8845
+ message.firstAbortTsMs = object.firstAbortTsMs ?? 0n;
8846
+ message.guardrailEpoch = object.guardrailEpoch ?? 0n;
8847
+ message.uptimeMs = object.uptimeMs ?? 0n;
8616
8848
  message.backpressure = object.backpressure ?? false;
8617
8849
  message.config = object.config !== void 0 && object.config !== null ? CdcDiagnosticsConfig.fromPartial(object.config) : void 0;
8618
8850
  message.engine = object.engine !== void 0 && object.engine !== null ? CdcDiagnosticsEngine.fromPartial(object.engine) : void 0;
8619
8851
  message.malformedSnapshots = object.malformedSnapshots?.map((e) => CdcMalformedSnapshot.fromPartial(e)) || [];
8620
8852
  message.malformedHashes = object.malformedHashes?.map((e) => CdcMalformedHash.fromPartial(e)) || [];
8621
8853
  message.version = object.version ?? "";
8622
- message.timestampMs = object.timestampMs ?? 0;
8854
+ message.timestampMs = object.timestampMs ?? 0n;
8623
8855
  return message;
8624
8856
  }
8625
8857
  };
@@ -8628,6 +8860,9 @@ var init_geode = __esm({
8628
8860
  if (message.action !== "") {
8629
8861
  writer.uint32(10).string(message.action);
8630
8862
  }
8863
+ if (message.sessionId !== "") {
8864
+ writer.uint32(18).string(message.sessionId);
8865
+ }
8631
8866
  return writer;
8632
8867
  },
8633
8868
  decode(input, length) {
@@ -8644,6 +8879,13 @@ var init_geode = __esm({
8644
8879
  message.action = reader.string();
8645
8880
  continue;
8646
8881
  }
8882
+ case 2: {
8883
+ if (tag !== 18) {
8884
+ break;
8885
+ }
8886
+ message.sessionId = reader.string();
8887
+ continue;
8888
+ }
8647
8889
  }
8648
8890
  if ((tag & 7) === 4 || tag === 0) {
8649
8891
  break;
@@ -8653,13 +8895,19 @@ var init_geode = __esm({
8653
8895
  return message;
8654
8896
  },
8655
8897
  fromJSON(object) {
8656
- return { action: isSet(object.action) ? globalThis.String(object.action) : "" };
8898
+ return {
8899
+ action: isSet(object.action) ? globalThis.String(object.action) : "",
8900
+ sessionId: isSet(object.sessionId) ? globalThis.String(object.sessionId) : isSet(object.session_id) ? globalThis.String(object.session_id) : ""
8901
+ };
8657
8902
  },
8658
8903
  toJSON(message) {
8659
8904
  const obj = {};
8660
8905
  if (message.action !== "") {
8661
8906
  obj.action = message.action;
8662
8907
  }
8908
+ if (message.sessionId !== "") {
8909
+ obj.sessionId = message.sessionId;
8910
+ }
8663
8911
  return obj;
8664
8912
  },
8665
8913
  create(base) {
@@ -8668,6 +8916,7 @@ var init_geode = __esm({
8668
8916
  fromPartial(object) {
8669
8917
  const message = createBaseCdcControlRequest();
8670
8918
  message.action = object.action ?? "";
8919
+ message.sessionId = object.sessionId ?? "";
8671
8920
  return message;
8672
8921
  }
8673
8922
  };
@@ -8679,7 +8928,10 @@ var init_geode = __esm({
8679
8928
  if (message.status !== "") {
8680
8929
  writer.uint32(18).string(message.status);
8681
8930
  }
8682
- if (message.guardrailEpoch !== 0) {
8931
+ if (message.guardrailEpoch !== 0n) {
8932
+ if (BigInt.asUintN(64, message.guardrailEpoch) !== message.guardrailEpoch) {
8933
+ throw new globalThis.Error("value provided for field message.guardrailEpoch of type uint64 too large");
8934
+ }
8683
8935
  writer.uint32(24).uint64(message.guardrailEpoch);
8684
8936
  }
8685
8937
  return writer;
@@ -8709,7 +8961,7 @@ var init_geode = __esm({
8709
8961
  if (tag !== 24) {
8710
8962
  break;
8711
8963
  }
8712
- message.guardrailEpoch = longToNumber(reader.uint64());
8964
+ message.guardrailEpoch = reader.uint64();
8713
8965
  continue;
8714
8966
  }
8715
8967
  }
@@ -8724,7 +8976,7 @@ var init_geode = __esm({
8724
8976
  return {
8725
8977
  success: isSet(object.success) ? globalThis.Boolean(object.success) : false,
8726
8978
  status: isSet(object.status) ? globalThis.String(object.status) : "",
8727
- guardrailEpoch: isSet(object.guardrailEpoch) ? globalThis.Number(object.guardrailEpoch) : isSet(object.guardrail_epoch) ? globalThis.Number(object.guardrail_epoch) : 0
8979
+ guardrailEpoch: isSet(object.guardrailEpoch) ? BigInt(object.guardrailEpoch) : isSet(object.guardrail_epoch) ? BigInt(object.guardrail_epoch) : 0n
8728
8980
  };
8729
8981
  },
8730
8982
  toJSON(message) {
@@ -8735,8 +8987,8 @@ var init_geode = __esm({
8735
8987
  if (message.status !== "") {
8736
8988
  obj.status = message.status;
8737
8989
  }
8738
- if (message.guardrailEpoch !== 0) {
8739
- obj.guardrailEpoch = Math.round(message.guardrailEpoch);
8990
+ if (message.guardrailEpoch !== 0n) {
8991
+ obj.guardrailEpoch = message.guardrailEpoch.toString();
8740
8992
  }
8741
8993
  return obj;
8742
8994
  },
@@ -8747,7 +8999,7 @@ var init_geode = __esm({
8747
8999
  const message = createBaseCdcControlResponse();
8748
9000
  message.success = object.success ?? false;
8749
9001
  message.status = object.status ?? "";
8750
- message.guardrailEpoch = object.guardrailEpoch ?? 0;
9002
+ message.guardrailEpoch = object.guardrailEpoch ?? 0n;
8751
9003
  return message;
8752
9004
  }
8753
9005
  };
@@ -8845,7 +9097,10 @@ var init_geode = __esm({
8845
9097
  if (message.backupType !== "") {
8846
9098
  writer.uint32(34).string(message.backupType);
8847
9099
  }
8848
- if (message.sizeBytes !== 0) {
9100
+ if (message.sizeBytes !== 0n) {
9101
+ if (BigInt.asUintN(64, message.sizeBytes) !== message.sizeBytes) {
9102
+ throw new globalThis.Error("value provided for field message.sizeBytes of type uint64 too large");
9103
+ }
8849
9104
  writer.uint32(40).uint64(message.sizeBytes);
8850
9105
  }
8851
9106
  if (message.compression !== "") {
@@ -8895,7 +9150,7 @@ var init_geode = __esm({
8895
9150
  if (tag !== 40) {
8896
9151
  break;
8897
9152
  }
8898
- message.sizeBytes = longToNumber(reader.uint64());
9153
+ message.sizeBytes = reader.uint64();
8899
9154
  continue;
8900
9155
  }
8901
9156
  case 6: {
@@ -8926,7 +9181,7 @@ var init_geode = __esm({
8926
9181
  message: isSet(object.message) ? globalThis.String(object.message) : "",
8927
9182
  backupId: isSet(object.backupId) ? globalThis.String(object.backupId) : isSet(object.backup_id) ? globalThis.String(object.backup_id) : "",
8928
9183
  backupType: isSet(object.backupType) ? globalThis.String(object.backupType) : isSet(object.backup_type) ? globalThis.String(object.backup_type) : "",
8929
- sizeBytes: isSet(object.sizeBytes) ? globalThis.Number(object.sizeBytes) : isSet(object.size_bytes) ? globalThis.Number(object.size_bytes) : 0,
9184
+ sizeBytes: isSet(object.sizeBytes) ? BigInt(object.sizeBytes) : isSet(object.size_bytes) ? BigInt(object.size_bytes) : 0n,
8930
9185
  compression: isSet(object.compression) ? globalThis.String(object.compression) : "",
8931
9186
  checksum: isSet(object.checksum) ? globalThis.String(object.checksum) : ""
8932
9187
  };
@@ -8945,8 +9200,8 @@ var init_geode = __esm({
8945
9200
  if (message.backupType !== "") {
8946
9201
  obj.backupType = message.backupType;
8947
9202
  }
8948
- if (message.sizeBytes !== 0) {
8949
- obj.sizeBytes = Math.round(message.sizeBytes);
9203
+ if (message.sizeBytes !== 0n) {
9204
+ obj.sizeBytes = message.sizeBytes.toString();
8950
9205
  }
8951
9206
  if (message.compression !== "") {
8952
9207
  obj.compression = message.compression;
@@ -8965,7 +9220,7 @@ var init_geode = __esm({
8965
9220
  message.message = object.message ?? "";
8966
9221
  message.backupId = object.backupId ?? "";
8967
9222
  message.backupType = object.backupType ?? "";
8968
- message.sizeBytes = object.sizeBytes ?? 0;
9223
+ message.sizeBytes = object.sizeBytes ?? 0n;
8969
9224
  message.compression = object.compression ?? "";
8970
9225
  message.checksum = object.checksum ?? "";
8971
9226
  return message;
@@ -9065,7 +9320,10 @@ var init_geode = __esm({
9065
9320
  if (message.targetTime !== "") {
9066
9321
  writer.uint32(34).string(message.targetTime);
9067
9322
  }
9068
- if (message.restoreTimestamp !== 0) {
9323
+ if (message.restoreTimestamp !== 0n) {
9324
+ if (BigInt.asUintN(64, message.restoreTimestamp) !== message.restoreTimestamp) {
9325
+ throw new globalThis.Error("value provided for field message.restoreTimestamp of type uint64 too large");
9326
+ }
9069
9327
  writer.uint32(40).uint64(message.restoreTimestamp);
9070
9328
  }
9071
9329
  return writer;
@@ -9109,7 +9367,7 @@ var init_geode = __esm({
9109
9367
  if (tag !== 40) {
9110
9368
  break;
9111
9369
  }
9112
- message.restoreTimestamp = longToNumber(reader.uint64());
9370
+ message.restoreTimestamp = reader.uint64();
9113
9371
  continue;
9114
9372
  }
9115
9373
  }
@@ -9126,7 +9384,7 @@ var init_geode = __esm({
9126
9384
  message: isSet(object.message) ? globalThis.String(object.message) : "",
9127
9385
  restoreDir: isSet(object.restoreDir) ? globalThis.String(object.restoreDir) : isSet(object.restore_dir) ? globalThis.String(object.restore_dir) : "",
9128
9386
  targetTime: isSet(object.targetTime) ? globalThis.String(object.targetTime) : isSet(object.target_time) ? globalThis.String(object.target_time) : "",
9129
- restoreTimestamp: isSet(object.restoreTimestamp) ? globalThis.Number(object.restoreTimestamp) : isSet(object.restore_timestamp) ? globalThis.Number(object.restore_timestamp) : 0
9387
+ restoreTimestamp: isSet(object.restoreTimestamp) ? BigInt(object.restoreTimestamp) : isSet(object.restore_timestamp) ? BigInt(object.restore_timestamp) : 0n
9130
9388
  };
9131
9389
  },
9132
9390
  toJSON(message) {
@@ -9143,8 +9401,8 @@ var init_geode = __esm({
9143
9401
  if (message.targetTime !== "") {
9144
9402
  obj.targetTime = message.targetTime;
9145
9403
  }
9146
- if (message.restoreTimestamp !== 0) {
9147
- obj.restoreTimestamp = Math.round(message.restoreTimestamp);
9404
+ if (message.restoreTimestamp !== 0n) {
9405
+ obj.restoreTimestamp = message.restoreTimestamp.toString();
9148
9406
  }
9149
9407
  return obj;
9150
9408
  },
@@ -9157,13 +9415,16 @@ var init_geode = __esm({
9157
9415
  message.message = object.message ?? "";
9158
9416
  message.restoreDir = object.restoreDir ?? "";
9159
9417
  message.targetTime = object.targetTime ?? "";
9160
- message.restoreTimestamp = object.restoreTimestamp ?? 0;
9418
+ message.restoreTimestamp = object.restoreTimestamp ?? 0n;
9161
9419
  return message;
9162
9420
  }
9163
9421
  };
9164
9422
  UploadBackupRequest = {
9165
9423
  encode(message, writer = new BinaryWriter()) {
9166
- if (message.sizeBytes !== 0) {
9424
+ if (message.sizeBytes !== 0n) {
9425
+ if (BigInt.asUintN(64, message.sizeBytes) !== message.sizeBytes) {
9426
+ throw new globalThis.Error("value provided for field message.sizeBytes of type uint64 too large");
9427
+ }
9167
9428
  writer.uint32(8).uint64(message.sizeBytes);
9168
9429
  }
9169
9430
  if (message.checksum !== "") {
@@ -9188,7 +9449,7 @@ var init_geode = __esm({
9188
9449
  if (tag !== 8) {
9189
9450
  break;
9190
9451
  }
9191
- message.sizeBytes = longToNumber(reader.uint64());
9452
+ message.sizeBytes = reader.uint64();
9192
9453
  continue;
9193
9454
  }
9194
9455
  case 2: {
@@ -9222,7 +9483,7 @@ var init_geode = __esm({
9222
9483
  },
9223
9484
  fromJSON(object) {
9224
9485
  return {
9225
- sizeBytes: isSet(object.sizeBytes) ? globalThis.Number(object.sizeBytes) : isSet(object.size_bytes) ? globalThis.Number(object.size_bytes) : 0,
9486
+ sizeBytes: isSet(object.sizeBytes) ? BigInt(object.sizeBytes) : isSet(object.size_bytes) ? BigInt(object.size_bytes) : 0n,
9226
9487
  checksum: isSet(object.checksum) ? globalThis.String(object.checksum) : "",
9227
9488
  sessionId: isSet(object.sessionId) ? globalThis.String(object.sessionId) : isSet(object.session_id) ? globalThis.String(object.session_id) : "",
9228
9489
  payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(0)
@@ -9230,8 +9491,8 @@ var init_geode = __esm({
9230
9491
  },
9231
9492
  toJSON(message) {
9232
9493
  const obj = {};
9233
- if (message.sizeBytes !== 0) {
9234
- obj.sizeBytes = Math.round(message.sizeBytes);
9494
+ if (message.sizeBytes !== 0n) {
9495
+ obj.sizeBytes = message.sizeBytes.toString();
9235
9496
  }
9236
9497
  if (message.checksum !== "") {
9237
9498
  obj.checksum = message.checksum;
@@ -9249,7 +9510,7 @@ var init_geode = __esm({
9249
9510
  },
9250
9511
  fromPartial(object) {
9251
9512
  const message = createBaseUploadBackupRequest();
9252
- message.sizeBytes = object.sizeBytes ?? 0;
9513
+ message.sizeBytes = object.sizeBytes ?? 0n;
9253
9514
  message.checksum = object.checksum ?? "";
9254
9515
  message.sessionId = object.sessionId ?? "";
9255
9516
  message.payload = object.payload ?? new Uint8Array(0);
@@ -9343,6 +9604,17 @@ function initProtoSync() {
9343
9604
  function ensureProtoInitialized() {
9344
9605
  return Promise.resolve();
9345
9606
  }
9607
+ function protoIntToJS(value) {
9608
+ if (typeof value === "number") return value;
9609
+ const n = typeof value === "bigint" ? value : BigInt(value);
9610
+ if (n >= MIN_SAFE_BIGINT && n <= MAX_SAFE_BIGINT) {
9611
+ return Number(n);
9612
+ }
9613
+ return n;
9614
+ }
9615
+ function protoIdToBigInt(value) {
9616
+ return typeof value === "bigint" ? value : BigInt(value);
9617
+ }
9346
9618
  function jsToProtoValue(value) {
9347
9619
  if (value === null || value === void 0) {
9348
9620
  return { nullVal: {} };
@@ -9352,7 +9624,7 @@ function jsToProtoValue(value) {
9352
9624
  }
9353
9625
  if (typeof value === "number") {
9354
9626
  if (Number.isInteger(value)) {
9355
- return { intVal: { value, kind: 1 } };
9627
+ return { intVal: { value: BigInt(value), kind: 1 } };
9356
9628
  }
9357
9629
  return { doubleVal: { value, kind: 1 } };
9358
9630
  }
@@ -9385,14 +9657,7 @@ function protoValueToJS(val) {
9385
9657
  if (val.nullVal !== void 0) return null;
9386
9658
  if (val.boolVal !== void 0) return val.boolVal;
9387
9659
  if (val.intVal !== void 0) {
9388
- const n = val.intVal.value;
9389
- if (typeof n === "bigint") {
9390
- if (n >= BigInt(Number.MIN_SAFE_INTEGER) && n <= BigInt(Number.MAX_SAFE_INTEGER)) {
9391
- return Number(n);
9392
- }
9393
- return n;
9394
- }
9395
- return n;
9660
+ return protoIntToJS(val.intVal.value);
9396
9661
  }
9397
9662
  if (val.doubleVal !== void 0) return val.doubleVal.value;
9398
9663
  if (val.stringVal !== void 0) return val.stringVal.value;
@@ -9427,7 +9692,7 @@ function protoValueToJS(val) {
9427
9692
  props[entry.key] = protoValueToJS(entry.value ?? {});
9428
9693
  }
9429
9694
  return {
9430
- id: typeof node2.id === "bigint" ? node2.id : BigInt(node2.id),
9695
+ id: protoIdToBigInt(node2.id),
9431
9696
  labels: node2.labels,
9432
9697
  properties: props
9433
9698
  };
@@ -9444,9 +9709,9 @@ function protoValueToJS(val) {
9444
9709
  props[entry.key] = protoValueToJS(entry.value ?? {});
9445
9710
  }
9446
9711
  return {
9447
- id: typeof edge2.id === "bigint" ? edge2.id : BigInt(edge2.id),
9448
- startNode: typeof edge2.fromId === "bigint" ? edge2.fromId : BigInt(edge2.fromId),
9449
- endNode: typeof edge2.toId === "bigint" ? edge2.toId : BigInt(edge2.toId),
9712
+ id: protoIdToBigInt(edge2.id),
9713
+ startNode: protoIdToBigInt(edge2.fromId),
9714
+ endNode: protoIdToBigInt(edge2.toId),
9450
9715
  type: edge2.label,
9451
9716
  properties: props
9452
9717
  };
@@ -9462,7 +9727,7 @@ function protoValueToJS(val) {
9462
9727
  const ext = val.extVal;
9463
9728
  if (ext.text !== void 0) return ext.text;
9464
9729
  if (ext.bytes !== void 0) return Buffer.from(ext.bytes);
9465
- if (ext.intVal !== void 0) return ext.intVal;
9730
+ if (ext.intVal !== void 0) return protoIntToJS(ext.intVal);
9466
9731
  if (ext.doubleVal !== void 0) return ext.doubleVal;
9467
9732
  if (ext.boolVal !== void 0) return ext.boolVal;
9468
9733
  return null;
@@ -9522,7 +9787,9 @@ function buildExecuteRequest(sessionId, query2, params) {
9522
9787
  function buildPullRequest(requestId, pageSize, sessionId) {
9523
9788
  return {
9524
9789
  pull: {
9525
- requestId,
9790
+ // The generated binding types request_id (uint64) as bigint; accept a
9791
+ // plain number from callers for API stability.
9792
+ requestId: typeof requestId === "bigint" ? requestId : BigInt(requestId),
9526
9793
  pageSize,
9527
9794
  sessionId
9528
9795
  }
@@ -9586,7 +9853,7 @@ function rowToRecord(row, columns) {
9586
9853
  function getProtoPath() {
9587
9854
  return PROTO_PATH;
9588
9855
  }
9589
- var __filename$1, __dirname$1, PROTO_PATH;
9856
+ var __filename$1, __dirname$1, PROTO_PATH, MIN_SAFE_BIGINT, MAX_SAFE_BIGINT;
9590
9857
  var init_proto = __esm({
9591
9858
  async "src/proto.ts"() {
9592
9859
  await init_types();
@@ -9594,6 +9861,8 @@ var init_proto = __esm({
9594
9861
  __filename$1 = fileURLToPath(import.meta.url);
9595
9862
  __dirname$1 = path.dirname(__filename$1);
9596
9863
  PROTO_PATH = path.resolve(__dirname$1, "..", "proto", "geode.proto");
9864
+ MIN_SAFE_BIGINT = BigInt(Number.MIN_SAFE_INTEGER);
9865
+ MAX_SAFE_BIGINT = BigInt(Number.MAX_SAFE_INTEGER);
9597
9866
  }
9598
9867
  });
9599
9868
 
@@ -9631,7 +9900,7 @@ var init_grpc_transport = __esm({
9631
9900
  PROTO_PATH2 = getProtoPath();
9632
9901
  PROTO_LOADER_OPTIONS = {
9633
9902
  keepCase: false,
9634
- longs: Number,
9903
+ longs: String,
9635
9904
  enums: Number,
9636
9905
  defaults: true,
9637
9906
  oneofs: true
@@ -10161,6 +10430,25 @@ var init_transport = __esm({
10161
10430
  _maxBufferBytes;
10162
10431
  _pendingProtoReads = [];
10163
10432
  _pendingResponses = [];
10433
+ /**
10434
+ * Decode failure that arrived while no reader was parked. Surfaced by the
10435
+ * next receiveProto() once the already-decoded backlog has been drained.
10436
+ */
10437
+ _pendingDecodeError = null;
10438
+ /**
10439
+ * Sticky failure latched when the read pump ends or throws. The pump is the
10440
+ * ONLY producer of responses, so once it is gone nothing can ever settle a
10441
+ * parked reader: report the failure instead of hanging (ENG-3918).
10442
+ */
10443
+ _readFailure = null;
10444
+ /** True once close() has released the QUIC client and buffers. */
10445
+ _disposed = false;
10446
+ /**
10447
+ * Serializes writes to the single bidirectional stream. `getWriter()` throws
10448
+ * "WritableStream is locked" while another write holds the lock, so queued
10449
+ * exchanges must take turns (ENG-3916).
10450
+ */
10451
+ _writeChain = Promise.resolve();
10164
10452
  constructor(address, maxMessageSize = DEFAULT_MAX_MESSAGE_SIZE, maxBufferBytes = DEFAULT_MAX_BUFFER_BYTES) {
10165
10453
  super(address);
10166
10454
  this._maxMessageSize = maxMessageSize;
@@ -10255,7 +10543,7 @@ var init_transport = __esm({
10255
10543
  while (!this._closed) {
10256
10544
  const { done, value } = await reader.read();
10257
10545
  if (done) {
10258
- this.rejectPendingReads(
10546
+ this.failFromReadPump(
10259
10547
  new TransportError({
10260
10548
  operation: "read",
10261
10549
  cause: new Error("Stream ended unexpectedly")
@@ -10269,7 +10557,7 @@ var init_transport = __esm({
10269
10557
  }
10270
10558
  } catch (err) {
10271
10559
  if (!this._closed) {
10272
- this.rejectPendingReads(
10560
+ this.failFromReadPump(
10273
10561
  new TransportError({
10274
10562
  operation: "read",
10275
10563
  cause: err instanceof Error ? err : new Error(String(err))
@@ -10282,6 +10570,19 @@ var init_transport = __esm({
10282
10570
  };
10283
10571
  void read();
10284
10572
  }
10573
+ /**
10574
+ * Latch the transport dead after the read pump ends or throws.
10575
+ *
10576
+ * Nothing can produce a response once the pump is gone, so leaving
10577
+ * `isClosed()` false makes the connection (and the pool, whose only liveness
10578
+ * predicate is that flag) believe a dead socket is healthy, and parks every
10579
+ * later reader on a producer that will never run again (ENG-3918).
10580
+ */
10581
+ failFromReadPump(error) {
10582
+ this._readFailure ??= error;
10583
+ this._closed = true;
10584
+ this.rejectPendingReads(error);
10585
+ }
10285
10586
  /**
10286
10587
  * Reject all pending reads with an error.
10287
10588
  */
@@ -10346,14 +10647,15 @@ var init_transport = __esm({
10346
10647
  this._pendingResponses.push(msg);
10347
10648
  }
10348
10649
  } catch (err) {
10650
+ const decodeError = new TransportError({
10651
+ operation: "decode",
10652
+ cause: err instanceof Error ? err : new Error(String(err))
10653
+ });
10349
10654
  const pending = this._pendingProtoReads.shift();
10350
10655
  if (pending) {
10351
- pending.reject(
10352
- new TransportError({
10353
- operation: "decode",
10354
- cause: err instanceof Error ? err : new Error(String(err))
10355
- })
10356
- );
10656
+ pending.reject(decodeError);
10657
+ } else {
10658
+ this._pendingDecodeError ??= decodeError;
10357
10659
  }
10358
10660
  }
10359
10661
  }
@@ -10384,14 +10686,18 @@ var init_transport = __esm({
10384
10686
  throw new TransportError({ operation: "sendProto", cause: new Error("No stream") });
10385
10687
  }
10386
10688
  const data = encodeWithLengthPrefix(msg);
10387
- try {
10388
- const stream = this._stream;
10689
+ const stream = this._stream;
10690
+ const write = this._writeChain.then(async () => {
10389
10691
  const writer = stream.writable.getWriter();
10390
10692
  try {
10391
10693
  await writer.write(new Uint8Array(data));
10392
10694
  } finally {
10393
10695
  writer.releaseLock();
10394
10696
  }
10697
+ });
10698
+ this._writeChain = write.catch(() => void 0);
10699
+ try {
10700
+ await write;
10395
10701
  } catch (e) {
10396
10702
  throw new TransportError({
10397
10703
  operation: "sendProto",
@@ -10404,7 +10710,6 @@ var init_transport = __esm({
10404
10710
  * Receive a protobuf message.
10405
10711
  */
10406
10712
  async receiveProto(signal) {
10407
- this.checkClosed();
10408
10713
  if (signal?.aborted) {
10409
10714
  throw new TransportError({ operation: "receiveProto", cause: new Error("Aborted") });
10410
10715
  }
@@ -10412,6 +10717,15 @@ var init_transport = __esm({
10412
10717
  if (queued) {
10413
10718
  return queued;
10414
10719
  }
10720
+ if (this._pendingDecodeError) {
10721
+ const decodeError = this._pendingDecodeError;
10722
+ this._pendingDecodeError = null;
10723
+ throw decodeError;
10724
+ }
10725
+ if (this._readFailure) {
10726
+ throw this._readFailure;
10727
+ }
10728
+ this.checkClosed();
10415
10729
  return new Promise((resolve2, reject) => {
10416
10730
  let onAbort = null;
10417
10731
  const pendingRead = {
@@ -10442,13 +10756,16 @@ var init_transport = __esm({
10442
10756
  });
10443
10757
  }
10444
10758
  async close() {
10445
- if (this._closed) return;
10759
+ if (this._disposed) return;
10760
+ this._disposed = true;
10446
10761
  this._closed = true;
10447
10762
  for (const pending of this._pendingProtoReads) {
10448
10763
  pending.reject(ErrClosed());
10449
10764
  }
10450
10765
  this._pendingProtoReads = [];
10451
10766
  this._pendingResponses = [];
10767
+ this._pendingDecodeError = null;
10768
+ this._readFailure = null;
10452
10769
  this._chunks = [];
10453
10770
  this._totalLength = 0;
10454
10771
  if (this._client) {
@@ -10823,6 +11140,12 @@ __export(explain_exports, {
10823
11140
  formatProfile: () => formatProfile,
10824
11141
  profile: () => profile
10825
11142
  });
11143
+ function toPlanNumber(value) {
11144
+ if (value === void 0 || value === null) return void 0;
11145
+ if (typeof value === "number") return value;
11146
+ if (typeof value === "bigint" || typeof value === "string") return Number(value);
11147
+ return void 0;
11148
+ }
10826
11149
  function parseExplainPayload(payload) {
10827
11150
  const ops = payload.ops ?? [];
10828
11151
  if (ops.length === 0) {
@@ -10835,8 +11158,8 @@ function parseExplainPayload(payload) {
10835
11158
  const opObj = op;
10836
11159
  return {
10837
11160
  type: opObj["kind"] || "Unknown",
10838
- cost: opObj["cost"],
10839
- rows: opObj["est_rows"],
11161
+ cost: toPlanNumber(opObj["cost"]),
11162
+ rows: toPlanNumber(opObj["est_rows"] ?? opObj["estRows"]),
10840
11163
  details: { idx: opObj["idx"] }
10841
11164
  };
10842
11165
  })
@@ -10896,8 +11219,8 @@ async function explain(conn, query2, options) {
10896
11219
  const totals = payload.totals;
10897
11220
  return {
10898
11221
  root,
10899
- totalCost: totals?.cost,
10900
- totalRows: totals?.estRows ?? totals?.est_rows,
11222
+ totalCost: toPlanNumber(totals?.cost),
11223
+ totalRows: toPlanNumber(totals?.estRows ?? totals?.est_rows),
10901
11224
  raw: payload
10902
11225
  };
10903
11226
  }
@@ -11726,26 +12049,33 @@ var init_auth = __esm({
11726
12049
  });
11727
12050
 
11728
12051
  // src/abort-utils.ts
12052
+ var TIMEOUT_ABORT_REASON = "geode:request-timeout";
11729
12053
  function withAbortTimeout(signal, timeoutMs) {
11730
12054
  const effectiveTimeout = timeoutMs ?? 0;
11731
12055
  if (!effectiveTimeout || effectiveTimeout <= 0) {
11732
12056
  return { signal, cleanup: () => {
11733
- } };
12057
+ }, timedOut: () => false };
11734
12058
  }
11735
12059
  const controller = new AbortController();
11736
- const timeoutId = setTimeout(() => controller.abort(), effectiveTimeout);
12060
+ let deadlineFired = false;
12061
+ const timeoutId = setTimeout(() => {
12062
+ deadlineFired = true;
12063
+ controller.abort(TIMEOUT_ABORT_REASON);
12064
+ }, effectiveTimeout);
12065
+ const timedOut = () => deadlineFired;
11737
12066
  if (signal?.aborted) {
11738
- controller.abort();
12067
+ controller.abort(signal.reason);
11739
12068
  return {
11740
12069
  signal: controller.signal,
11741
12070
  cleanup: () => {
11742
12071
  clearTimeout(timeoutId);
11743
- }
12072
+ },
12073
+ timedOut
11744
12074
  };
11745
12075
  }
11746
12076
  let onAbort = null;
11747
12077
  if (signal) {
11748
- onAbort = () => controller.abort();
12078
+ onAbort = () => controller.abort(signal.reason);
11749
12079
  signal.addEventListener("abort", onAbort, { once: true });
11750
12080
  }
11751
12081
  return {
@@ -11755,7 +12085,8 @@ function withAbortTimeout(signal, timeoutMs) {
11755
12085
  if (signal && onAbort) {
11756
12086
  signal.removeEventListener("abort", onAbort);
11757
12087
  }
11758
- }
12088
+ },
12089
+ timedOut
11759
12090
  };
11760
12091
  }
11761
12092
 
@@ -11914,6 +12245,10 @@ var QueryResult = class {
11914
12245
  _closed = false;
11915
12246
  _bufferIndex = 0;
11916
12247
  _rowCount = 0;
12248
+ /** Settles once the connection is back in phase after this result closed. */
12249
+ _drained = null;
12250
+ /** Owner hook (used by the pool to hold its member for the result's life). */
12251
+ _onCloseHooks = [];
11917
12252
  constructor(conn, columns, initialRows, final, ordered, orderKeys, pageSize, signal) {
11918
12253
  this._conn = conn;
11919
12254
  this._columns = columns;
@@ -11992,7 +12327,7 @@ var QueryResult = class {
11992
12327
  this._final = final;
11993
12328
  }
11994
12329
  } finally {
11995
- this.close();
12330
+ await this._settle();
11996
12331
  }
11997
12332
  }
11998
12333
  /**
@@ -12024,7 +12359,7 @@ var QueryResult = class {
12024
12359
  }
12025
12360
  return records;
12026
12361
  } finally {
12027
- this.close();
12362
+ await this._settle();
12028
12363
  }
12029
12364
  }
12030
12365
  /**
@@ -12110,19 +12445,62 @@ var QueryResult = class {
12110
12445
  }
12111
12446
  /**
12112
12447
  * Close the result set.
12448
+ *
12449
+ * When the server still owes pages, closing hands the connection the job of
12450
+ * draining them; use {@link QueryResult._settle} (or simply iterate to the
12451
+ * end) to await that. A caller that walks away never observes a connection
12452
+ * that is silently out of phase (ENG-3916).
12113
12453
  */
12114
12454
  close() {
12115
12455
  if (this._closed) {
12116
12456
  return;
12117
12457
  }
12118
12458
  this._closed = true;
12119
- this._conn._releaseResult(this);
12459
+ this._drained = this._conn._releaseResult(this, this._final);
12460
+ void this._drained.catch(() => void 0);
12461
+ const hooks = this._onCloseHooks;
12462
+ this._onCloseHooks = [];
12463
+ for (const hook of hooks) {
12464
+ hook();
12465
+ }
12466
+ }
12467
+ /**
12468
+ * @internal Whether the result still needs the connection.
12469
+ *
12470
+ * False once every page is buffered client-side: the connection is then free
12471
+ * and its pool member can be released immediately.
12472
+ */
12473
+ get _needsConnection() {
12474
+ return !this._final && !this._closed;
12475
+ }
12476
+ /**
12477
+ * @internal Register a callback fired exactly once when this result closes.
12478
+ * Fires immediately when the result is already closed.
12479
+ */
12480
+ _onClose(hook) {
12481
+ if (this._closed) {
12482
+ hook();
12483
+ return;
12484
+ }
12485
+ this._onCloseHooks.push(hook);
12486
+ }
12487
+ /** Close the result and wait for the connection to be back in phase. */
12488
+ async _settle() {
12489
+ this.close();
12490
+ if (this._drained) {
12491
+ await this._drained.catch(() => void 0);
12492
+ }
12120
12493
  }
12121
12494
  /**
12122
12495
  * Internal close (called by connection).
12123
12496
  */
12124
12497
  _close() {
12125
12498
  this._closed = true;
12499
+ const hooks = this._onCloseHooks;
12500
+ this._onCloseHooks = [];
12501
+ for (const hook of hooks) {
12502
+ hook();
12503
+ }
12126
12504
  }
12127
12505
  };
12128
12506
  var QueryResultIterator = class {
@@ -12183,6 +12561,7 @@ function columnsToColumnInfo(columns) {
12183
12561
  function dataPageToRows(page, columns) {
12184
12562
  return page.rows.map((row) => rowToRecord(row, columns));
12185
12563
  }
12564
+ var MAX_DRAIN_PAGES = 4096;
12186
12565
  var Connection = class _Connection {
12187
12566
  _config;
12188
12567
  _transport;
@@ -12192,6 +12571,21 @@ var Connection = class _Connection {
12192
12571
  _requestId = 0;
12193
12572
  _sessionId = "";
12194
12573
  _columns = [];
12574
+ _delivery = "push";
12575
+ /**
12576
+ * FIFO exchange lock.
12577
+ *
12578
+ * The connection owns ONE bidirectional stream and the wire protocol carries
12579
+ * no request/response correlation id, so two overlapping exchanges would read
12580
+ * each other's answers. Callers therefore queue instead of racing: an
12581
+ * exchange holds the lock for its FULL request -> final-response round trip,
12582
+ * and a streaming QueryResult keeps holding it until it is closed or drained
12583
+ * (ENG-3916).
12584
+ */
12585
+ _exchangeHeld = false;
12586
+ _exchangeWaiters = [];
12587
+ /** Lock release handed to the active streaming result, if any. */
12588
+ _activeRelease = null;
12195
12589
  constructor(config, transport) {
12196
12590
  this._config = config;
12197
12591
  this._transport = transport;
@@ -12239,6 +12633,55 @@ var Connection = class _Connection {
12239
12633
  get sessionId() {
12240
12634
  return this._sessionId;
12241
12635
  }
12636
+ /**
12637
+ * Take the exchange lock, returning its (idempotent) release function.
12638
+ *
12639
+ * Registration is synchronous, so waiters are served strictly in call order.
12640
+ */
12641
+ acquireExchange() {
12642
+ let released = false;
12643
+ const release = () => {
12644
+ if (released) {
12645
+ return;
12646
+ }
12647
+ released = true;
12648
+ const next = this._exchangeWaiters.shift();
12649
+ if (next) {
12650
+ next();
12651
+ return;
12652
+ }
12653
+ this._exchangeHeld = false;
12654
+ };
12655
+ if (!this._exchangeHeld) {
12656
+ this._exchangeHeld = true;
12657
+ return Promise.resolve(release);
12658
+ }
12659
+ return new Promise((resolve2) => {
12660
+ this._exchangeWaiters.push(() => resolve2(release));
12661
+ });
12662
+ }
12663
+ /** Run one complete exchange under the connection's exchange lock. */
12664
+ async withExchange(fn) {
12665
+ const release = await this.acquireExchange();
12666
+ try {
12667
+ if (this._state === "closed") {
12668
+ throw ErrClosed();
12669
+ }
12670
+ return await fn();
12671
+ } finally {
12672
+ release();
12673
+ }
12674
+ }
12675
+ /** Wake every queued exchange so it can observe the closed state. */
12676
+ drainExchangeWaiters() {
12677
+ const waiters = this._exchangeWaiters;
12678
+ this._exchangeWaiters = [];
12679
+ this._exchangeHeld = false;
12680
+ this._activeRelease = null;
12681
+ for (const wake of waiters) {
12682
+ wake();
12683
+ }
12684
+ }
12242
12685
  /** Perform the HELLO handshake. */
12243
12686
  async hello() {
12244
12687
  const msg = buildHelloRequest(
@@ -12289,29 +12732,28 @@ var Connection = class _Connection {
12289
12732
  if (options?.pageSize !== void 0) {
12290
12733
  validatePageSize(options.pageSize);
12291
12734
  }
12735
+ const resultPageSize = options?.pageSize ?? this._config.pageSize;
12736
+ validatePageSize(resultPageSize);
12737
+ const release = await this.acquireExchange();
12738
+ let handedOver = false;
12292
12739
  try {
12740
+ if (this._state === "closed") {
12741
+ throw ErrClosed();
12742
+ }
12293
12743
  this._state = "fetching";
12294
12744
  const msg = buildExecuteRequest(this._sessionId, query2, params);
12295
12745
  await this._sendWithTimeout(msg, signal);
12296
12746
  const response = await this._receiveWithTimeout(signal);
12297
12747
  if (!response.execute) {
12298
- this._state = this._inTransaction ? "in_transaction" : "idle";
12299
- throw new TransportError({
12300
- operation: "query",
12301
- cause: new Error("Invalid execute response")
12302
- });
12748
+ throw await this._protocolDesync("query", "Invalid execute response");
12303
12749
  }
12304
12750
  const execResp = response.execute;
12305
12751
  if (isErrorResponse(execResp)) {
12306
- this._state = this._inTransaction ? "in_transaction" : "idle";
12752
+ this._restoreIdleState();
12307
12753
  throw protoErrorToDriverError(execResp, execResp.status?.statusClass);
12308
12754
  }
12309
12755
  if (!isSchemaResponse(execResp)) {
12310
- this._state = this._inTransaction ? "in_transaction" : "idle";
12311
- throw new TransportError({
12312
- operation: "query",
12313
- cause: new Error("Expected schema response")
12314
- });
12756
+ throw await this._protocolDesync("query", "Expected schema response");
12315
12757
  }
12316
12758
  this._columns = execResp.schema.columns;
12317
12759
  const columns = columnsToColumnInfo(this._columns);
@@ -12319,10 +12761,12 @@ var Connection = class _Connection {
12319
12761
  let isFinal = false;
12320
12762
  let isOrdered = false;
12321
12763
  let orderKeys = [];
12322
- const inlineExec = await this._readInlineExecute(signal);
12323
- if (inlineExec) {
12764
+ let gotPushedPage = false;
12765
+ const inline = await this._readInlineExecute("query", signal);
12766
+ if (inline.status === "received") {
12767
+ const inlineExec = inline.response;
12324
12768
  if (isErrorResponse(inlineExec)) {
12325
- this._state = this._inTransaction ? "in_transaction" : "idle";
12769
+ this._restoreIdleState();
12326
12770
  throw protoErrorToDriverError(inlineExec, inlineExec.status?.statusClass);
12327
12771
  }
12328
12772
  if (isDataPageResponse(inlineExec)) {
@@ -12331,39 +12775,24 @@ var Connection = class _Connection {
12331
12775
  isFinal = page.final;
12332
12776
  isOrdered = page.ordered;
12333
12777
  orderKeys = page.orderKeys;
12778
+ gotPushedPage = true;
12334
12779
  }
12335
12780
  }
12336
- if (!isFinal && initialRows.length === 0) {
12337
- this._requestId++;
12338
- const pageSize = options?.pageSize ?? this._config.pageSize;
12339
- validatePageSize(pageSize);
12340
- const pullMsg = buildPullRequest(this._requestId, pageSize, this._sessionId);
12341
- await this._sendWithTimeout(pullMsg, signal);
12342
- while (true) {
12343
- const pullResponse = await this._receiveWithTimeout(signal);
12344
- const pullExec = pullResponse.pull?.response ?? pullResponse.execute;
12345
- if (!pullExec) {
12346
- break;
12347
- }
12348
- if (isErrorResponse(pullExec)) {
12349
- this._state = this._inTransaction ? "in_transaction" : "idle";
12350
- throw protoErrorToDriverError(pullExec, pullExec.status?.statusClass);
12351
- }
12352
- if (isDataPageResponse(pullExec)) {
12353
- const page = pullExec.page;
12354
- initialRows = dataPageToRows(page, this._columns);
12355
- isFinal = page.final;
12356
- isOrdered = page.ordered;
12357
- orderKeys = page.orderKeys;
12358
- break;
12359
- }
12360
- if (pullExec.heartbeat) {
12361
- break;
12362
- }
12363
- }
12781
+ if (gotPushedPage) {
12782
+ this._delivery = "push";
12783
+ } else {
12784
+ this._delivery = "pull";
12785
+ const pulled = await this._pullFirstPage(
12786
+ "query",
12787
+ resultPageSize,
12788
+ inline.status === "pending",
12789
+ signal
12790
+ );
12791
+ initialRows = pulled.rows;
12792
+ isFinal = pulled.final;
12793
+ isOrdered = pulled.ordered;
12794
+ orderKeys = pulled.orderKeys;
12364
12795
  }
12365
- const resultPageSize = options?.pageSize ?? this._config.pageSize;
12366
- validatePageSize(resultPageSize);
12367
12796
  const result = new QueryResult(
12368
12797
  this,
12369
12798
  columns,
@@ -12375,10 +12804,18 @@ var Connection = class _Connection {
12375
12804
  signal
12376
12805
  );
12377
12806
  this._activeResult = result;
12807
+ if (!isFinal) {
12808
+ this._activeRelease = release;
12809
+ handedOver = true;
12810
+ }
12378
12811
  return result;
12379
12812
  } catch (e) {
12380
- this._state = this._inTransaction ? "in_transaction" : "idle";
12813
+ this._restoreIdleState();
12381
12814
  throw e;
12815
+ } finally {
12816
+ if (!handedOver) {
12817
+ release();
12818
+ }
12382
12819
  }
12383
12820
  }
12384
12821
  /** Execute a query and return all rows as an array. */
@@ -12407,48 +12844,69 @@ var Connection = class _Connection {
12407
12844
  validateParamValue(value);
12408
12845
  }
12409
12846
  const signal = options?.signal;
12410
- try {
12411
- this._state = "executing";
12412
- const msg = buildExecuteRequest(this._sessionId, query2, params);
12413
- await this._sendWithTimeout(msg, signal);
12414
- const response = await this._receiveWithTimeout(signal);
12415
- if (!response.execute) {
12416
- throw new TransportError({
12417
- operation: "exec",
12418
- cause: new Error("Invalid execute response")
12419
- });
12420
- }
12421
- const execResp = response.execute;
12422
- if (isErrorResponse(execResp)) {
12423
- throw protoErrorToDriverError(execResp, execResp.status?.statusClass);
12424
- }
12425
- if (isSchemaResponse(execResp)) {
12426
- this._columns = execResp.schema.columns;
12427
- const inlineExec = await this._readInlineExecute(signal);
12428
- if (inlineExec) {
12429
- if (isErrorResponse(inlineExec)) {
12430
- throw protoErrorToDriverError(inlineExec, inlineExec.status?.statusClass);
12431
- }
12432
- if (isDataPageResponse(inlineExec) && !inlineExec.page.final) {
12433
- await this._drainRemainingPages(signal);
12847
+ return this.withExchange(async () => {
12848
+ try {
12849
+ this._state = "executing";
12850
+ const msg = buildExecuteRequest(this._sessionId, query2, params);
12851
+ await this._sendWithTimeout(msg, signal);
12852
+ const response = await this._receiveWithTimeout(signal);
12853
+ if (!response.execute) {
12854
+ throw await this._protocolDesync("exec", "Invalid execute response");
12855
+ }
12856
+ const execResp = response.execute;
12857
+ if (isErrorResponse(execResp)) {
12858
+ throw protoErrorToDriverError(execResp, execResp.status?.statusClass);
12859
+ }
12860
+ if (isSchemaResponse(execResp)) {
12861
+ this._columns = execResp.schema.columns;
12862
+ const inline = await this._readInlineExecute("exec", signal);
12863
+ if (inline.status === "pending") {
12864
+ this._delivery = "pull";
12865
+ const pulled = await this._pullFirstPage("exec", this._config.pageSize, true, signal);
12866
+ if (!pulled.final) {
12867
+ await this._drainRemainingPages(signal);
12868
+ }
12869
+ } else if (inline.status === "received") {
12870
+ const inlineExec = inline.response;
12871
+ if (isErrorResponse(inlineExec)) {
12872
+ throw protoErrorToDriverError(inlineExec, inlineExec.status?.statusClass);
12873
+ }
12874
+ if (isDataPageResponse(inlineExec) && !inlineExec.page.final) {
12875
+ this._delivery = "push";
12876
+ await this._drainRemainingPages(signal);
12877
+ }
12434
12878
  }
12435
12879
  }
12880
+ } finally {
12881
+ this._restoreIdleState();
12436
12882
  }
12437
- } finally {
12438
- this._state = this._inTransaction ? "in_transaction" : "idle";
12439
- }
12883
+ });
12440
12884
  }
12441
12885
  /** @internal Fetch the next page of results. Called by QueryResult. */
12442
12886
  async _fetchNextPage(pageSize, signal) {
12443
12887
  validatePageSize(pageSize);
12888
+ if (this._delivery === "push") {
12889
+ return this._readNextPage("fetch_next_page", signal);
12890
+ }
12444
12891
  this._requestId++;
12445
12892
  const pullMsg = buildPullRequest(this._requestId, pageSize, this._sessionId);
12446
12893
  await this._sendWithTimeout(pullMsg, signal);
12447
- while (true) {
12894
+ return this._readNextPage("fetch_next_page", signal);
12895
+ }
12896
+ /**
12897
+ * Read the next page off the stream.
12898
+ *
12899
+ * Accepts either envelope: the server pushes pages as `execute` responses and
12900
+ * wraps a PULL's answer in `pull`. Anything else means the stream is out of
12901
+ * phase with the request being served, so the connection fails closed instead
12902
+ * of silently swallowing the message.
12903
+ */
12904
+ async _readNextPage(operation, signal) {
12905
+ for (; ; ) {
12448
12906
  const response = await this._receiveWithTimeout(signal);
12449
12907
  const execResp = response.pull?.response ?? response.execute;
12450
12908
  if (!execResp) {
12451
- return { rows: [], final: true };
12909
+ throw await this._protocolDesync(operation, "Invalid page response");
12452
12910
  }
12453
12911
  if (isErrorResponse(execResp)) {
12454
12912
  throw protoErrorToDriverError(execResp, execResp.status?.statusClass);
@@ -12463,71 +12921,186 @@ var Connection = class _Connection {
12463
12921
  if (execResp.heartbeat) {
12464
12922
  return { rows: [], final: true };
12465
12923
  }
12924
+ if (isSchemaResponse(execResp)) {
12925
+ throw await this._protocolDesync(operation, "Unexpected schema response");
12926
+ }
12927
+ if (!execResp.metrics && !execResp.explain && !execResp.profile) {
12928
+ return { rows: [], final: true };
12929
+ }
12466
12930
  }
12467
12931
  }
12468
- /** Try to receive an inline response with short timeout. */
12932
+ /**
12933
+ * Wait for the response the server sends after SCHEMA.
12934
+ *
12935
+ * Returns `null` when the inline deadline (`inlineTimeout`) expires. That
12936
+ * response is then STILL in flight - the caller must reconcile it before
12937
+ * returning, because the transport is a FIFO stream without request/response
12938
+ * correlation and anything left behind is read by the next request
12939
+ * (ENG-3916).
12940
+ */
12469
12941
  async _tryReceiveInline(signal) {
12470
- if (signal?.aborted) {
12471
- return null;
12472
- }
12473
12942
  const inlineTimeoutMs = this._config.inlineTimeout ?? 5e3;
12474
12943
  const { signal: timeoutSignal, cleanup } = withAbortTimeout(signal, inlineTimeoutMs);
12475
12944
  try {
12476
12945
  return await this._transport.receiveProto(timeoutSignal);
12477
12946
  } catch (err) {
12478
- if (err instanceof TransportError && err.cause?.message === "Aborted") {
12947
+ const aborted = err instanceof TransportError && err.cause?.message === "Aborted";
12948
+ if (aborted && !signal?.aborted) {
12479
12949
  return null;
12480
12950
  }
12951
+ await this._closeOnTransportError(err);
12481
12952
  throw err;
12482
12953
  } finally {
12483
12954
  cleanup();
12484
12955
  }
12485
12956
  }
12486
- /** Read inline execute responses until a page, error, heartbeat, or timeout arrives. */
12487
- async _readInlineExecute(signal) {
12957
+ /** Read inline execute responses until a page, error, heartbeat, or the inline deadline. */
12958
+ async _readInlineExecute(operation, signal) {
12488
12959
  while (true) {
12489
12960
  const inlineResponse = await this._tryReceiveInline(signal);
12490
- const inlineExec = inlineResponse?.execute;
12961
+ if (!inlineResponse) {
12962
+ return { status: "pending" };
12963
+ }
12964
+ const inlineExec = inlineResponse.execute;
12491
12965
  if (!inlineExec) {
12492
- return null;
12966
+ throw await this._protocolDesync(operation, "Invalid inline response");
12493
12967
  }
12494
12968
  if (isErrorResponse(inlineExec) || isDataPageResponse(inlineExec)) {
12495
- return inlineExec;
12969
+ return { status: "received", response: inlineExec };
12496
12970
  }
12497
12971
  if (inlineExec.heartbeat) {
12498
- return null;
12972
+ return { status: "empty" };
12499
12973
  }
12500
12974
  }
12501
12975
  }
12502
- /** Drain remaining data pages until final=true to prevent query corruption (QUAL-T7). */
12503
- async _drainRemainingPages(signal) {
12504
- let done = false;
12505
- while (!done) {
12976
+ /**
12977
+ * Send a PULL and consume responses until every outstanding response has
12978
+ * been accounted for.
12979
+ *
12980
+ * The wire protocol is a FIFO stream with no request/response correlation
12981
+ * id, so the client must reconcile the whole exchange before it returns:
12982
+ * a response left in the transport is read by the NEXT request, which then
12983
+ * sees this query's schema and rows (ENG-3916). Up to two responses can be
12984
+ * outstanding here:
12985
+ *
12986
+ * - the inline page the server sends after SCHEMA, when the inline read
12987
+ * gave up waiting for it (`inlinePending`), and
12988
+ * - the answer to the PULL sent below, which QUIC servers always send as a
12989
+ * `pull`-wrapped message.
12990
+ *
12991
+ * Because the server writes its responses in order, a `pull`-wrapped answer
12992
+ * also proves that nothing is still coming for the EXECUTE, which is what
12993
+ * makes the reconciliation exact.
12994
+ *
12995
+ * When the exchange cannot be reconciled - a timeout, an abort or a
12996
+ * transport failure while a response is still owed - the connection is
12997
+ * closed instead of returned to the caller (and to the pool).
12998
+ *
12999
+ * NOTE (server team, ENG-3916): the durable fix is a request/response
13000
+ * correlation id in the proto. Until the wire protocol carries one, the
13001
+ * client can only reconcile by message type plus stream ordering.
13002
+ */
13003
+ async _pullFirstPage(operation, pageSize, inlinePending, signal) {
13004
+ let inlineOutstanding = inlinePending;
13005
+ let ackOutstanding = this._pullIsAcknowledged;
13006
+ let rows = [];
13007
+ let final = false;
13008
+ let ordered = false;
13009
+ let orderKeys = [];
13010
+ let gotPage = false;
13011
+ let deferredError = null;
13012
+ try {
12506
13013
  this._requestId++;
12507
- const pageSize = this._config.pageSize;
12508
13014
  const pullMsg = buildPullRequest(this._requestId, pageSize, this._sessionId);
12509
13015
  await this._sendWithTimeout(pullMsg, signal);
12510
- const response = await this._receiveWithTimeout(signal);
12511
- const pullExec = response.pull?.response ?? response.execute;
12512
- if (!pullExec) {
12513
- break;
13016
+ for (; ; ) {
13017
+ const response = await this._receiveWithTimeout(signal);
13018
+ const isPullAck = response.pull !== void 0;
13019
+ const pullExec = response.pull?.response ?? response.execute;
13020
+ if (!pullExec) {
13021
+ throw await this._protocolDesync(operation, "Invalid pull response");
13022
+ }
13023
+ if (isPullAck) {
13024
+ inlineOutstanding = false;
13025
+ ackOutstanding = false;
13026
+ } else if (inlineOutstanding) {
13027
+ inlineOutstanding = false;
13028
+ } else {
13029
+ ackOutstanding = false;
13030
+ }
13031
+ if (isErrorResponse(pullExec)) {
13032
+ deferredError ??= protoErrorToDriverError(pullExec, pullExec.status?.statusClass);
13033
+ } else if (isDataPageResponse(pullExec)) {
13034
+ const page = pullExec.page;
13035
+ const pageRows = dataPageToRows(page, this._columns);
13036
+ if (gotPage) {
13037
+ rows = rows.concat(pageRows);
13038
+ } else {
13039
+ rows = pageRows;
13040
+ ordered = page.ordered;
13041
+ orderKeys = page.orderKeys;
13042
+ gotPage = true;
13043
+ }
13044
+ final = final || page.final;
13045
+ }
13046
+ if (!inlineOutstanding && !ackOutstanding) {
13047
+ break;
13048
+ }
12514
13049
  }
12515
- if (isErrorResponse(pullExec)) {
12516
- throw protoErrorToDriverError(pullExec, pullExec.status?.statusClass);
13050
+ } catch (e) {
13051
+ if (inlineOutstanding || ackOutstanding) {
13052
+ await this._forceClose();
12517
13053
  }
12518
- if (isDataPageResponse(pullExec)) {
12519
- done = pullExec.page.final;
12520
- } else if (pullExec.heartbeat) {
12521
- done = true;
13054
+ throw e;
13055
+ }
13056
+ if (deferredError && !gotPage) {
13057
+ this._restoreIdleState();
13058
+ throw deferredError;
13059
+ }
13060
+ return { rows, final, ordered, orderKeys };
13061
+ }
13062
+ /**
13063
+ * Drain remaining data pages until final=true to prevent query corruption
13064
+ * (QUAL-T7). Honours the current delivery mode: pushed pages are read,
13065
+ * parked results are pulled one page at a time.
13066
+ */
13067
+ async _drainRemainingPages(signal) {
13068
+ for (let page = 0; page < MAX_DRAIN_PAGES; page++) {
13069
+ const { final } = await this._fetchNextPage(this._config.pageSize, signal);
13070
+ if (final) {
13071
+ return;
12522
13072
  }
12523
13073
  }
13074
+ throw await this._protocolDesync("drain", "Result exceeded the drain page limit");
12524
13075
  }
12525
- /** @internal Release the active result, returning the connection to idle. */
12526
- _releaseResult(result) {
12527
- if (this._activeResult === result) {
12528
- this._activeResult = null;
12529
- this._state = this._inTransaction ? "in_transaction" : "idle";
13076
+ /**
13077
+ * @internal Release the active result, returning the connection to idle.
13078
+ *
13079
+ * A result abandoned before `final = true` leaves pages the server still owes
13080
+ * on the stream. They are drained here - under the exchange lock the result
13081
+ * still holds - so the next caller cannot read them as its own (ENG-3916).
13082
+ * The returned promise settles once the connection is back in phase.
13083
+ */
13084
+ _releaseResult(result, final) {
13085
+ if (this._activeResult !== result) {
13086
+ return Promise.resolve();
12530
13087
  }
13088
+ this._activeResult = null;
13089
+ const release = this._activeRelease;
13090
+ this._activeRelease = null;
13091
+ this._restoreIdleState();
13092
+ if (!release) {
13093
+ return Promise.resolve();
13094
+ }
13095
+ if (final || this._state === "closed") {
13096
+ release();
13097
+ return Promise.resolve();
13098
+ }
13099
+ return this._drainRemainingPages().catch(async (e) => {
13100
+ await this._forceClose();
13101
+ }).finally(() => {
13102
+ release();
13103
+ });
12531
13104
  }
12532
13105
  /** Begin a transaction. */
12533
13106
  async begin(signal) {
@@ -12535,47 +13108,55 @@ var Connection = class _Connection {
12535
13108
  if (this._inTransaction) {
12536
13109
  throw ErrTxInProgress();
12537
13110
  }
12538
- const msg = buildBeginRequest(false, this._sessionId);
12539
- await this._sendWithTimeout(msg, signal);
12540
- const response = await this._receiveWithTimeout(signal);
12541
- if (response.begin) {
12542
- if (response.begin.sessionId) {
12543
- this._sessionId = response.begin.sessionId;
13111
+ return this.withExchange(async () => {
13112
+ const msg = buildBeginRequest(false, this._sessionId);
13113
+ await this._sendWithTimeout(msg, signal);
13114
+ const response = await this._receiveWithTimeout(signal);
13115
+ if (response.begin) {
13116
+ if (response.begin.sessionId) {
13117
+ this._sessionId = response.begin.sessionId;
13118
+ }
13119
+ } else {
13120
+ throw new TransportError({
13121
+ operation: "begin",
13122
+ cause: new Error("Invalid BEGIN response")
13123
+ });
12544
13124
  }
12545
- } else {
12546
- throw new TransportError({
12547
- operation: "begin",
12548
- cause: new Error("Invalid BEGIN response")
12549
- });
12550
- }
12551
- this._inTransaction = true;
12552
- this._state = "in_transaction";
12553
- return new Transaction(this);
13125
+ this._inTransaction = true;
13126
+ this._state = "in_transaction";
13127
+ return new Transaction(this);
13128
+ });
12554
13129
  }
12555
13130
  /** @internal Commit the current transaction. Called by Transaction. */
12556
13131
  async _commit(signal) {
12557
- const msg = buildCommitRequest(this._sessionId);
12558
- await this._sendWithTimeout(msg, signal);
12559
- const response = await this._receiveWithTimeout(signal);
12560
- if (!response.commit) {
12561
- throw new TransportError({
12562
- operation: "commit",
12563
- cause: new Error("Invalid COMMIT response")
12564
- });
12565
- }
12566
- if (!response.commit.success) {
12567
- throw new DriverError({
12568
- statusClass: StatusClass.TRANSACTION_STATE,
12569
- subclass: "000",
12570
- code: "CommitFailed",
12571
- message: "Commit failed"
12572
- });
12573
- }
12574
- this._inTransaction = false;
12575
- this._state = "idle";
13132
+ return this.withExchange(async () => {
13133
+ const msg = buildCommitRequest(this._sessionId);
13134
+ await this._sendWithTimeout(msg, signal);
13135
+ const response = await this._receiveWithTimeout(signal);
13136
+ if (!response.commit) {
13137
+ throw new TransportError({
13138
+ operation: "commit",
13139
+ cause: new Error("Invalid COMMIT response")
13140
+ });
13141
+ }
13142
+ if (!response.commit.success) {
13143
+ throw new DriverError({
13144
+ statusClass: StatusClass.TRANSACTION_STATE,
13145
+ subclass: "000",
13146
+ code: "CommitFailed",
13147
+ message: "Commit failed"
13148
+ });
13149
+ }
13150
+ this._inTransaction = false;
13151
+ this._state = "idle";
13152
+ });
12576
13153
  }
12577
13154
  /** @internal Rollback the current transaction. Called by Transaction. */
12578
13155
  async _rollback(signal) {
13156
+ return this.withExchange(() => this._rollbackExchange(signal));
13157
+ }
13158
+ /** Send ROLLBACK and consume its answer. The exchange lock must be held. */
13159
+ async _rollbackExchange(signal) {
12579
13160
  const msg = buildRollbackRequest(this._sessionId);
12580
13161
  await this._sendWithTimeout(msg, signal);
12581
13162
  const response = await this._receiveWithTimeout(signal);
@@ -12591,76 +13172,101 @@ var Connection = class _Connection {
12591
13172
  /** @internal Create a named savepoint. Called by Transaction. */
12592
13173
  async _savepoint(name, signal) {
12593
13174
  validateSavepointName(name);
12594
- const msg = buildSavepointRequest(name, this._sessionId);
12595
- await this._sendWithTimeout(msg, signal);
12596
- const response = await this._receiveWithTimeout(signal);
12597
- if (!response.savepoint) {
12598
- throw new TransportError({
12599
- operation: "savepoint",
12600
- cause: new Error("Invalid SAVEPOINT response")
12601
- });
12602
- }
12603
- if (!response.savepoint.success) {
12604
- throw new DriverError({
12605
- statusClass: StatusClass.TRANSACTION_STATE,
12606
- subclass: "000",
12607
- code: "SavepointFailed",
12608
- message: `Failed to create savepoint: ${name}`
12609
- });
12610
- }
13175
+ return this.withExchange(async () => {
13176
+ const msg = buildSavepointRequest(name, this._sessionId);
13177
+ await this._sendWithTimeout(msg, signal);
13178
+ const response = await this._receiveWithTimeout(signal);
13179
+ if (!response.savepoint) {
13180
+ throw new TransportError({
13181
+ operation: "savepoint",
13182
+ cause: new Error("Invalid SAVEPOINT response")
13183
+ });
13184
+ }
13185
+ if (!response.savepoint.success) {
13186
+ throw new DriverError({
13187
+ statusClass: StatusClass.TRANSACTION_STATE,
13188
+ subclass: "000",
13189
+ code: "SavepointFailed",
13190
+ message: `Failed to create savepoint: ${name}`
13191
+ });
13192
+ }
13193
+ });
12611
13194
  }
12612
13195
  /** @internal Rollback to a previously created savepoint. Called by Transaction. */
12613
13196
  async _rollbackTo(name, signal) {
12614
13197
  validateSavepointName(name);
12615
- const msg = buildRollbackToRequest(name, this._sessionId);
12616
- await this._sendWithTimeout(msg, signal);
12617
- const response = await this._receiveWithTimeout(signal);
12618
- if (!response.rollbackTo) {
12619
- throw new TransportError({
12620
- operation: "rollback_to",
12621
- cause: new Error("Invalid ROLLBACK TO response")
12622
- });
12623
- }
12624
- if (!response.rollbackTo.success) {
12625
- throw new DriverError({
12626
- statusClass: StatusClass.TRANSACTION_STATE,
12627
- subclass: "000",
12628
- code: "RollbackToFailed",
12629
- message: `Failed to rollback to savepoint: ${name}`
12630
- });
12631
- }
13198
+ return this.withExchange(async () => {
13199
+ const msg = buildRollbackToRequest(name, this._sessionId);
13200
+ await this._sendWithTimeout(msg, signal);
13201
+ const response = await this._receiveWithTimeout(signal);
13202
+ if (!response.rollbackTo) {
13203
+ throw new TransportError({
13204
+ operation: "rollback_to",
13205
+ cause: new Error("Invalid ROLLBACK TO response")
13206
+ });
13207
+ }
13208
+ if (!response.rollbackTo.success) {
13209
+ throw new DriverError({
13210
+ statusClass: StatusClass.TRANSACTION_STATE,
13211
+ subclass: "000",
13212
+ code: "RollbackToFailed",
13213
+ message: `Failed to rollback to savepoint: ${name}`
13214
+ });
13215
+ }
13216
+ });
12632
13217
  }
12633
13218
  /** Ping the server to check connection health. */
12634
13219
  async ping(signal) {
12635
13220
  if (this._state === "closed") {
12636
13221
  throw ErrClosed();
12637
13222
  }
12638
- const msg = buildPingRequest();
12639
- await this._sendWithTimeout(msg, signal);
12640
- const response = await this._receiveWithTimeout(signal);
12641
- if (!response.ping) {
12642
- throw new TransportError({
12643
- operation: "ping",
12644
- cause: new Error("Invalid PING response")
12645
- });
12646
- }
12647
- if (!response.ping.ok) {
12648
- throw new TransportError({
12649
- operation: "ping",
12650
- cause: new Error("Server returned not ok")
12651
- });
12652
- }
13223
+ return this.withExchange(async () => {
13224
+ const msg = buildPingRequest();
13225
+ await this._sendWithTimeout(msg, signal);
13226
+ const response = await this._receiveWithTimeout(signal);
13227
+ if (!response.ping) {
13228
+ throw new TransportError({
13229
+ operation: "ping",
13230
+ cause: new Error("Invalid PING response")
13231
+ });
13232
+ }
13233
+ if (!response.ping.ok) {
13234
+ throw new TransportError({
13235
+ operation: "ping",
13236
+ cause: new Error("Server returned not ok")
13237
+ });
13238
+ }
13239
+ });
12653
13240
  }
12654
13241
  /** Reset the connection session. */
12655
13242
  async reset(signal) {
12656
13243
  if (this._state === "closed") {
12657
13244
  throw ErrClosed();
12658
13245
  }
12659
- if (this._inTransaction) {
12660
- await this._rollback(signal);
13246
+ const retained = this._activeRelease;
13247
+ this._activeRelease = null;
13248
+ if (this._activeResult) {
13249
+ this._activeResult._close();
13250
+ this._activeResult = null;
13251
+ }
13252
+ const release = retained ?? await this.acquireExchange();
13253
+ try {
13254
+ if (this.isClosed) {
13255
+ throw ErrClosed();
13256
+ }
13257
+ if (retained) {
13258
+ await this._drainRemainingPages(signal);
13259
+ }
13260
+ if (this._inTransaction) {
13261
+ await this._rollbackExchange(signal);
13262
+ }
13263
+ this._state = "idle";
13264
+ } catch (e) {
13265
+ await this._forceClose();
13266
+ throw e;
13267
+ } finally {
13268
+ release();
12661
13269
  }
12662
- this._state = "idle";
12663
- this._activeResult = null;
12664
13270
  }
12665
13271
  /** Close the connection. */
12666
13272
  async close() {
@@ -12668,11 +13274,21 @@ var Connection = class _Connection {
12668
13274
  return;
12669
13275
  }
12670
13276
  this._state = "closed";
13277
+ this._abandonActiveResult();
13278
+ this.drainExchangeWaiters();
13279
+ await this._transport.close();
13280
+ }
13281
+ /** Drop the active result and hand its exchange lock back. */
13282
+ _abandonActiveResult() {
12671
13283
  if (this._activeResult) {
12672
13284
  this._activeResult._close();
12673
13285
  this._activeResult = null;
12674
13286
  }
12675
- await this._transport.close();
13287
+ const release = this._activeRelease;
13288
+ this._activeRelease = null;
13289
+ if (release) {
13290
+ release();
13291
+ }
12676
13292
  }
12677
13293
  /** Create a prepared statement. */
12678
13294
  async prepare(query2) {
@@ -12694,64 +13310,110 @@ var Connection = class _Connection {
12694
13310
  const { batch: doBatch } = await init_batch().then(() => batch_exports);
12695
13311
  return doBatch(this, queries, options);
12696
13312
  }
12697
- /** Check connection state before operation. */
13313
+ /**
13314
+ * Check connection state before operation.
13315
+ *
13316
+ * Concurrent requests are NOT rejected any more: they queue on the exchange
13317
+ * lock (ENG-3916). Only genuinely illegal states fail fast here.
13318
+ */
12698
13319
  checkState(operation) {
12699
13320
  if (this._state === "closed") {
12700
13321
  throw ErrClosed();
12701
13322
  }
12702
- if (this._state === "fetching" || this._activeResult) {
12703
- throw ErrQueryInProgress();
12704
- }
12705
13323
  if (operation === "begin" && this._inTransaction) {
12706
13324
  throw ErrTxInProgress();
12707
13325
  }
12708
13326
  }
12709
13327
  /** Send a protobuf message with request timeout enforcement. */
12710
13328
  async _sendWithTimeout(msg, signal) {
12711
- const { signal: timeoutSignal, cleanup } = this._withRequestTimeout(signal);
13329
+ const handle = this._withRequestTimeout(signal);
12712
13330
  try {
12713
- await this._transport.sendProto(msg, timeoutSignal);
13331
+ await this._transport.sendProto(msg, handle.signal);
12714
13332
  } catch (e) {
12715
- await this._closeOnTransportError(e);
13333
+ await this._closeOnTransportError(e, handle.timedOut());
12716
13334
  throw e;
12717
13335
  } finally {
12718
- cleanup();
13336
+ handle.cleanup();
12719
13337
  }
12720
13338
  }
12721
13339
  /** Receive a protobuf message with request timeout enforcement. */
12722
13340
  async _receiveWithTimeout(signal) {
12723
- const { signal: timeoutSignal, cleanup } = this._withRequestTimeout(signal);
13341
+ const handle = this._withRequestTimeout(signal);
12724
13342
  try {
12725
- return await this._transport.receiveProto(timeoutSignal);
13343
+ return await this._transport.receiveProto(handle.signal);
12726
13344
  } catch (e) {
12727
- await this._closeOnTransportError(e);
13345
+ await this._closeOnTransportError(e, true);
12728
13346
  throw e;
12729
13347
  } finally {
12730
- cleanup();
13348
+ handle.cleanup();
12731
13349
  }
12732
13350
  }
12733
13351
  /** Create a combined abort signal from requestTimeout and optional caller signal (CWE-703). */
12734
13352
  _withRequestTimeout(signal) {
12735
13353
  return withAbortTimeout(signal, this._config.requestTimeout);
12736
13354
  }
12737
- async _closeOnTransportError(err) {
12738
- if (!(err instanceof TransportError) || err.cause?.message === "Aborted") {
13355
+ /**
13356
+ * Tear the connection down after a transport failure.
13357
+ *
13358
+ * `responseOwed` marks the cases where the server may still answer: a request
13359
+ * deadline that elapsed, or any aborted receive. Those leave the stream out
13360
+ * of phase, so the connection must not be reused (or returned to the pool)
13361
+ * even though the underlying socket is still open (ENG-3918).
13362
+ */
13363
+ async _closeOnTransportError(err, responseOwed = false) {
13364
+ if (!(err instanceof TransportError)) {
13365
+ return;
13366
+ }
13367
+ if (err.cause?.message === "Aborted" && !responseOwed) {
12739
13368
  return;
12740
13369
  }
13370
+ await this._forceClose();
13371
+ }
13372
+ /**
13373
+ * Whether the server answers every PULL with its own message.
13374
+ *
13375
+ * QUIC servers reply to a PULL with a `pull`-wrapped response, so that
13376
+ * response has to be consumed before the connection is back in phase. The
13377
+ * gRPC transport has no PULL RPC: it serves PULLs from the Execute stream
13378
+ * that is already open, so no extra message is produced.
13379
+ */
13380
+ get _pullIsAcknowledged() {
13381
+ return this._config.transport !== "grpc";
13382
+ }
13383
+ /**
13384
+ * Tear the connection down after a protocol desync and build the error.
13385
+ *
13386
+ * The stream carries no correlation ids, so a message that cannot belong to
13387
+ * the request being served means client and server are out of phase: every
13388
+ * later response would answer an earlier request, silently handing one
13389
+ * caller another caller's rows. Failing closed makes the connection
13390
+ * unusable, and the pool drops closed connections instead of reusing them.
13391
+ */
13392
+ async _protocolDesync(operation, detail) {
13393
+ await this._forceClose();
13394
+ return new TransportError({ operation, cause: new Error(detail) });
13395
+ }
13396
+ /** Close the transport and drop any active result, ignoring teardown errors. */
13397
+ async _forceClose() {
12741
13398
  if (this._state === "closed") {
12742
13399
  return;
12743
13400
  }
12744
13401
  this._state = "closed";
12745
13402
  this._inTransaction = false;
12746
- if (this._activeResult) {
12747
- this._activeResult._close();
12748
- this._activeResult = null;
12749
- }
13403
+ this._abandonActiveResult();
13404
+ this.drainExchangeWaiters();
12750
13405
  try {
12751
13406
  await this._transport.close();
12752
13407
  } catch {
12753
13408
  }
12754
13409
  }
13410
+ /** Return to the resting state, unless the connection was torn down. */
13411
+ _restoreIdleState() {
13412
+ if (this._state === "closed") {
13413
+ return;
13414
+ }
13415
+ this._state = this._inTransaction ? "in_transaction" : "idle";
13416
+ }
12755
13417
  };
12756
13418
 
12757
13419
  // src/pool.ts
@@ -12895,6 +13557,7 @@ var ConnectionPool = class _ConnectionPool {
12895
13557
  if (signal?.aborted) {
12896
13558
  throw new TransportError({ operation: "acquire", cause: new Error("Aborted") });
12897
13559
  }
13560
+ this.evictBrokenConnections();
12898
13561
  const available = this._connections.find((c) => !c.inUse && !c.connection.isClosed);
12899
13562
  if (available) {
12900
13563
  available.inUse = true;
@@ -13003,9 +13666,29 @@ var ConnectionPool = class _ConnectionPool {
13003
13666
  }
13004
13667
  /**
13005
13668
  * Execute a query using a pooled connection.
13669
+ *
13670
+ * A streaming result keeps fetching pages from the connection it was created
13671
+ * on, so the pooled member stays checked out until the result is closed
13672
+ * (ENG-3916). A result whose rows are already buffered needs nothing further
13673
+ * from the connection and releases the member right away.
13006
13674
  */
13007
13675
  async query(query2, options) {
13008
- return this.withConnection((conn) => conn.query(query2, options), options?.signal);
13676
+ const conn = await this.acquire(options?.signal);
13677
+ let result;
13678
+ try {
13679
+ result = await conn.query(query2, options);
13680
+ } catch (e) {
13681
+ await this.release(conn);
13682
+ throw e;
13683
+ }
13684
+ if (!result._needsConnection) {
13685
+ await this.release(conn);
13686
+ return result;
13687
+ }
13688
+ result._onClose(() => {
13689
+ void this.release(conn);
13690
+ });
13691
+ return result;
13009
13692
  }
13010
13693
  /**
13011
13694
  * Execute a query and return all rows.
@@ -13095,6 +13778,30 @@ var ConnectionPool = class _ConnectionPool {
13095
13778
  this._pendingConnections--;
13096
13779
  }
13097
13780
  }
13781
+ /**
13782
+ * Drop every idle member whose connection is no longer usable.
13783
+ *
13784
+ * `Connection.isClosed` is the pool's only liveness predicate, and a
13785
+ * connection torn down after a desync reports closed: leaving those members
13786
+ * in place both risks reuse and starves the pool of its maxConnections slots
13787
+ * until the next maintenance tick (ENG-3918).
13788
+ */
13789
+ evictBrokenConnections() {
13790
+ for (let i = this._connections.length - 1; i >= 0; i--) {
13791
+ const member = this._connections[i];
13792
+ if (member && !member.inUse && member.connection.isClosed) {
13793
+ this._connections.splice(i, 1);
13794
+ void this.closeQuietly(member.connection);
13795
+ }
13796
+ }
13797
+ }
13798
+ /** Close a discarded connection, ignoring teardown failures. */
13799
+ async closeQuietly(conn) {
13800
+ try {
13801
+ await conn.close();
13802
+ } catch {
13803
+ }
13804
+ }
13098
13805
  /**
13099
13806
  * Remove a connection from the pool.
13100
13807
  */
@@ -14589,7 +15296,7 @@ var GeodeCipher = class {
14589
15296
  try {
14590
15297
  return Buffer.concat([decipher.update(data), decipher.final()]);
14591
15298
  } catch (err) {
14592
- throw new Error(`geode: crypto: decrypt: ${err.message}`);
15299
+ throw new Error(`geode: crypto: decrypt: ${err.message}`, { cause: err });
14593
15300
  }
14594
15301
  }
14595
15302
  /** Encrypt a string, returning a base64-encoded result. */