@rocicorp/zero 0.23.2025090500 → 0.23.3000000000-canary.0

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clientToServer
3
- } from "./chunk-3UQYJK2Q.js";
3
+ } from "./chunk-SFEW47R5.js";
4
4
  import {
5
5
  AbstractQuery,
6
6
  ExpressionBuilder,
@@ -346,4 +346,4 @@ export {
346
346
  withValidation,
347
347
  createBuilder
348
348
  };
349
- //# sourceMappingURL=chunk-P3L6JY54.js.map
349
+ //# sourceMappingURL=chunk-3RQ3JGRV.js.map
@@ -8204,16 +8204,10 @@ async function upsertImpl(tx, arg, schema, ivmBranch) {
8204
8204
  schema.tables[arg.tableName].primaryKey,
8205
8205
  arg.value
8206
8206
  );
8207
- const val = defaultOptionalFieldsToNull(
8208
- schema.tables[arg.tableName],
8209
- arg.value
8210
- );
8211
- await tx.set(key, val);
8212
- if (ivmBranch) {
8213
- must(ivmBranch.getSource(arg.tableName)).push({
8214
- type: "set",
8215
- row: arg.value
8216
- });
8207
+ if (await tx.has(key)) {
8208
+ await updateImpl(tx, { ...arg, op: "update" }, schema, ivmBranch);
8209
+ } else {
8210
+ await insertImpl(tx, { ...arg, op: "insert" }, schema, ivmBranch);
8217
8211
  }
8218
8212
  }
8219
8213
  async function updateImpl(tx, arg, schema, ivmBranch) {
@@ -8680,7 +8674,7 @@ function makeMessage(message, context, logLevel) {
8680
8674
  }
8681
8675
 
8682
8676
  // ../zero-client/src/client/version.ts
8683
- var version2 = "0.23.2025090500";
8677
+ var version2 = "0.23.3000000000-canary.0";
8684
8678
 
8685
8679
  // ../zero-client/src/client/log-options.ts
8686
8680
  var LevelFilterLogSink = class {
@@ -11621,4 +11615,4 @@ export {
11621
11615
  update_needed_reason_type_enum_exports,
11622
11616
  Zero
11623
11617
  };
11624
- //# sourceMappingURL=chunk-3UQYJK2Q.js.map
11618
+ //# sourceMappingURL=chunk-SFEW47R5.js.map