@xnetjs/sqlite 0.1.1 → 0.2.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.
|
@@ -591,6 +591,9 @@ var ElectronSQLiteAdapter = class {
|
|
|
591
591
|
for (const property of input.properties) {
|
|
592
592
|
ops.push(
|
|
593
593
|
() => this.getOrPrepare(
|
|
594
|
+
// Full LWW ordering triple (lamport → wallTime → author), matching
|
|
595
|
+
// `shouldReplace` in @xnetjs/data. A lamport-only guard let arrival
|
|
596
|
+
// order decide same-lamport conflicts, diverging replicas (0272).
|
|
594
597
|
`INSERT INTO node_properties
|
|
595
598
|
(node_id, property_key, value, lamport_time, updated_by, updated_at)
|
|
596
599
|
VALUES (?, ?, ?, ?, ?, ?)
|
|
@@ -599,7 +602,11 @@ var ElectronSQLiteAdapter = class {
|
|
|
599
602
|
lamport_time = excluded.lamport_time,
|
|
600
603
|
updated_by = excluded.updated_by,
|
|
601
604
|
updated_at = excluded.updated_at
|
|
602
|
-
WHERE excluded.lamport_time > node_properties.lamport_time
|
|
605
|
+
WHERE excluded.lamport_time > node_properties.lamport_time
|
|
606
|
+
OR (excluded.lamport_time = node_properties.lamport_time
|
|
607
|
+
AND (excluded.updated_at > node_properties.updated_at
|
|
608
|
+
OR (excluded.updated_at = node_properties.updated_at
|
|
609
|
+
AND excluded.updated_by > node_properties.updated_by)))`
|
|
603
610
|
).run(
|
|
604
611
|
property.nodeId,
|
|
605
612
|
property.propertyKey,
|
package/dist/adapters/web.js
CHANGED
|
@@ -489,6 +489,9 @@ var WebSQLiteAdapter = class {
|
|
|
489
489
|
}
|
|
490
490
|
for (const property of input.properties) {
|
|
491
491
|
await this.run(
|
|
492
|
+
// Full LWW ordering triple (lamport → wallTime → author), matching
|
|
493
|
+
// `shouldReplace` in @xnetjs/data. A lamport-only guard let arrival
|
|
494
|
+
// order decide same-lamport conflicts, diverging replicas (0272).
|
|
492
495
|
`INSERT INTO node_properties
|
|
493
496
|
(node_id, property_key, value, lamport_time, updated_by, updated_at)
|
|
494
497
|
VALUES (?, ?, ?, ?, ?, ?)
|
|
@@ -497,7 +500,11 @@ var WebSQLiteAdapter = class {
|
|
|
497
500
|
lamport_time = excluded.lamport_time,
|
|
498
501
|
updated_by = excluded.updated_by,
|
|
499
502
|
updated_at = excluded.updated_at
|
|
500
|
-
WHERE excluded.lamport_time > node_properties.lamport_time
|
|
503
|
+
WHERE excluded.lamport_time > node_properties.lamport_time
|
|
504
|
+
OR (excluded.lamport_time = node_properties.lamport_time
|
|
505
|
+
AND (excluded.updated_at > node_properties.updated_at
|
|
506
|
+
OR (excluded.updated_at = node_properties.updated_at
|
|
507
|
+
AND excluded.updated_by > node_properties.updated_by)))`,
|
|
501
508
|
[
|
|
502
509
|
property.nodeId,
|
|
503
510
|
property.propertyKey,
|