Skip to content

Commit

Permalink
Resolve merge conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Janez Stupar committed Feb 27, 2024
2 parents 27f1d59 + 1e417fc commit 074e695
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## 0.1.3
Fix edge case when INSERT SELECT statements contain literals.

## 0.1.3
Bump dependencies

## 0.1.2
Records flagged as deleted are not modified again when a delete query targeting them is executed.

Expand Down
42 changes: 24 additions & 18 deletions lib/src/crdt_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ class CrdtArgParser {
ref = element;
}
if (ref.columnName == name) {
if (ref.parent is SetComponent) {
final parent = ref.parent as SetComponent;
if (ref.parent is SingleColumnSetComponent) {
final parent = ref.parent as SingleColumnSetComponent;
if (parent.expression is NumberedVariable) {
final numbered = parent.expression as NumberedVariable;
if (numbered.explicitIndex != null) {
Expand Down Expand Up @@ -233,22 +233,25 @@ class CrdtUtil {
set = argParser.fromIterable(
'hlc',
set,
(SetComponent element) => element.column.columnName == 'hlc',
(listLength) => SetComponent(
<SingleColumnSetComponent>(element) =>
element.column.columnName == 'hlc',
(listLength) => SingleColumnSetComponent(
column: Reference(columnName: 'hlc'),
expression: NumberedVariable(listLength)));
set = argParser.fromIterable(
'node_id',
set,
(SetComponent element) => element.column.columnName == 'node_id',
(listLength) => SetComponent(
<SingleColumnSetComponent>(element) =>
element.column.columnName == 'node_id',
(listLength) => SingleColumnSetComponent(
column: Reference(columnName: 'node_id'),
expression: NumberedVariable(listLength)));
set = argParser.fromIterable(
'modified',
set,
(SetComponent element) => element.column.columnName == 'modified',
(listLength) => SetComponent(
<SingleColumnSetComponent>(element) =>
element.column.columnName == 'modified',
(listLength) => SingleColumnSetComponent(
column: Reference(columnName: 'modified'),
expression: NumberedVariable(listLength)));

Expand Down Expand Up @@ -314,19 +317,19 @@ class CrdtUtil {
withClause: statement.withClause,
table: statement.table,
set: [
SetComponent(
SingleColumnSetComponent(
column: Reference(columnName: 'is_deleted'),
expression: NumberedVariable(argCount + 1),
),
SetComponent(
SingleColumnSetComponent(
column: Reference(columnName: 'hlc'),
expression: NumberedVariable(argCount + 2),
),
SetComponent(
SingleColumnSetComponent(
column: Reference(columnName: 'node_id'),
expression: NumberedVariable(argCount + 3),
),
SetComponent(
SingleColumnSetComponent(
column: Reference(columnName: 'modified'),
expression: NumberedVariable(argCount + 4),
),
Expand Down Expand Up @@ -436,22 +439,25 @@ class CrdtUtil {
action.set = argParser.fromIterable(
'hlc',
action.set,
(SetComponent element) => element.column.columnName == 'hlc',
(listLength) => SetComponent(
<SingleColumnSetComponent>(element) =>
element.column.columnName == 'hlc',
(listLength) => SingleColumnSetComponent(
column: Reference(columnName: 'hlc'),
expression: NumberedVariable(listLength)));
action.set = argParser.fromIterable(
'node_id',
action.set,
(SetComponent element) => element.column.columnName == 'node_id',
(listLength) => SetComponent(
<SingleColumnSetComponent>(element) =>
element.column.columnName == 'node_id',
(listLength) => SingleColumnSetComponent(
column: Reference(columnName: 'node_id'),
expression: NumberedVariable(listLength)));
action.set = argParser.fromIterable(
'modified',
action.set,
(SetComponent element) => element.column.columnName == 'modified',
(listLength) => SetComponent(
<SingleColumnSetComponent>(element) =>
element.column.columnName == 'modified',
(listLength) => SingleColumnSetComponent(
column: Reference(columnName: 'modified'),
expression: NumberedVariable(listLength)));
}
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: synchroflite
description: Dart implementation of Conflict-free Replicated Data Types (CRDTs) using Sqlite
version: 0.1.3
version: 0.1.4
homepage: https://github.com/JanezStupar/synchroflite
repository: https://github.com/JanezStupar/synchroflite.git
issue_tracker: https://github.com/JanezStupar/synchroflite/issues
Expand All @@ -12,9 +12,9 @@ dependencies:
sqflite_common: ^2.5.0
sqflite_common_ffi: ^2.3.0+2
sqflite_common_ffi_web: ^0.4.0
sql_crdt: ^2.1.4
sql_crdt: ^2.1.6
json_annotation: ^4.8.1
sqlparser: ^0.32.0
sqlparser: ^0.34.0
source_span: ^1.10.0
collection: ^1.17.2

Expand Down

0 comments on commit 074e695

Please sign in to comment.