chore: Upgrade Serverpod to 4.0.0-beta.1 (#105)

This commit is contained in:
Marcelo Mendonça Soares 2026-07-27 23:25:23 -03:00 • committed by GitHub
commit 40dbd7a73a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
119 changed files with 1635 additions and 2852 deletions

View file

@ -11,7 +11,7 @@ dependencies:
benchmark_harness: ^2.4.0 benchmark_harness: ^2.4.0
intl: ^0.20.2 intl: ^0.20.2
path: ^1.9.1 path: ^1.9.1
serverpod_database: 4.0.0-beta.0 serverpod_database: 4.0.0-beta.1
serverpod_offline_sync: serverpod_offline_sync:
path: ../packages/serverpod_offline_sync path: ../packages/serverpod_offline_sync
serverpod_offline_sync_server: serverpod_offline_sync_server:

View file

@ -7,7 +7,6 @@ import 'dart:typed_data';
import 'package:benchmark_harness/benchmark_harness.dart'; import 'package:benchmark_harness/benchmark_harness.dart';
import 'package:path/path.dart' as p; import 'package:path/path.dart' as p;
import 'package:serverpod_database/serverpod_database.dart'; import 'package:serverpod_database/serverpod_database.dart';
import 'package:serverpod_offline_sync/serverpod_offline_sync.dart';
import 'package:serverpod_offline_sync_server/serverpod_offline_sync_server.dart'; import 'package:serverpod_offline_sync_server/serverpod_offline_sync_server.dart';
import 'package:serverpod_offline_sync_test_client/serverpod_offline_sync_test_client.dart'; import 'package:serverpod_offline_sync_test_client/serverpod_offline_sync_test_client.dart';

View file

@ -46,9 +46,6 @@ class QueryCountingDatabase implements Database {
offset: offset, offset: offset,
orderBy: orderBy, orderBy: orderBy,
orderByList: orderByList, orderByList: orderByList,
// Remove this once the deprecated member is removed.
// ignore: deprecated_member_use
orderDescending: orderDescending,
transaction: transaction, transaction: transaction,
include: include, include: include,
lockMode: lockMode, lockMode: lockMode,
@ -92,9 +89,6 @@ class QueryCountingDatabase implements Database {
offset: offset, offset: offset,
orderBy: orderBy, orderBy: orderBy,
orderByList: orderByList, orderByList: orderByList,
// Remove this once the deprecated member is removed.
// ignore: deprecated_member_use
orderDescending: orderDescending,
transaction: transaction, transaction: transaction,
include: include, include: include,
lockMode: lockMode, lockMode: lockMode,
@ -225,9 +219,6 @@ class QueryCountingDatabase implements Database {
offset: offset, offset: offset,
orderBy: orderBy, orderBy: orderBy,
orderByList: orderByList, orderByList: orderByList,
// Remove this once the deprecated member is removed.
// ignore: deprecated_member_use
orderDescending: orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -247,9 +238,6 @@ class QueryCountingDatabase implements Database {
rows, rows,
orderBy: orderBy, orderBy: orderBy,
orderByList: orderByList, orderByList: orderByList,
// Remove this once the deprecated member is removed.
// ignore: deprecated_member_use
orderDescending: orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -278,9 +266,6 @@ class QueryCountingDatabase implements Database {
where: where, where: where,
orderBy: orderBy, orderBy: orderBy,
orderByList: orderByList, orderByList: orderByList,
// Remove this once the deprecated member is removed.
// ignore: deprecated_member_use
orderDescending: orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );

View file

@ -16,7 +16,7 @@ dependencies:
http: ^1.5.0 http: ^1.5.0
path: ^1.9.1 path: ^1.9.1
path_provider: ^2.1.5 path_provider: ^2.1.5
serverpod_database: 4.0.0-beta.0 serverpod_database: 4.0.0-beta.1
serverpod_offline_sync_client: serverpod_offline_sync_client:
path: ../../packages/serverpod_offline_sync_client path: ../../packages/serverpod_offline_sync_client
serverpod_offline_sync_test_client: serverpod_offline_sync_test_client:

View file

@ -1,6 +1,6 @@
name: drift_offline_sync name: drift_offline_sync
description: A Drift plugin to build offline-first applications with CRDT support. description: A Drift plugin to build offline-first applications with CRDT support.
version: 4.0.0-beta.0 version: 4.0.0-beta.1
repository: https://github.com/marcelomendoncasoares/drift_offline_sync repository: https://github.com/marcelomendoncasoares/drift_offline_sync
environment: environment:

View file

@ -16,7 +16,7 @@ import 'package:serverpod_serialization/serverpod_serialization.dart' as _i1;
/// ///
/// This class is used to represent the base HLC timestamp, which will be /// This class is used to represent the base HLC timestamp, which will be
/// extended with the node ID (in its canonical or normalized form). /// extended with the node ID (in its canonical or normalized form).
class BaseHlc implements _i1.SerializableModel { class BaseHlc implements _i1.SerializableModel, _i1.ProtocolSerialization {
BaseHlc({ BaseHlc({
required this.hlcDatetime, required this.hlcDatetime,
required this.hlcCounter, required this.hlcCounter,
@ -59,6 +59,15 @@ class BaseHlc implements _i1.SerializableModel {
}; };
} }
@override
Map<String, dynamic> toJsonForProtocol() {
return {
'__className__': 'serverpod_offline_sync.BaseHlc',
'hlcDatetime': hlcDatetime.toJson(),
'hlcCounter': hlcCounter,
};
}
@override @override
String toString() { String toString() {
return _i1.SerializationManager.encode(this); return _i1.SerializationManager.encode(this);

View file

@ -8,6 +8,7 @@
// ignore_for_file: type_literal_in_constant_pattern // ignore_for_file: type_literal_in_constant_pattern
// ignore_for_file: use_super_parameters // ignore_for_file: use_super_parameters
// ignore_for_file: invalid_use_of_internal_member // ignore_for_file: invalid_use_of_internal_member
// ignore_for_file: dead_code, unnecessary_type_check
// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:serverpod_serialization/serverpod_serialization.dart' as _i1; import 'package:serverpod_serialization/serverpod_serialization.dart' as _i1;

View file

@ -10,8 +10,8 @@ resolution: workspace
dependencies: dependencies:
clock: ^1.1.2 clock: ^1.1.2
serverpod_database: 4.0.0-beta.0 serverpod_database: 4.0.0-beta.1
serverpod_serialization: 4.0.0-beta.0 serverpod_serialization: 4.0.0-beta.1
uuid: ^4.5.3 uuid: ^4.5.3
dev_dependencies: dev_dependencies:

View file

@ -1,5 +1,4 @@
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
import 'package:serverpod_offline_sync/serverpod_offline_sync.dart';
import 'package:serverpod_serialization/serverpod_serialization.dart'; import 'package:serverpod_serialization/serverpod_serialization.dart';
import '../protocol/protocol.dart'; import '../protocol/protocol.dart';

View file

@ -1,5 +1,3 @@
import 'package:serverpod_offline_sync/serverpod_offline_sync.dart';
import '../protocol/protocol.dart'; import '../protocol/protocol.dart';
/// Last serialized index that still represents a visible CRDT row. /// Last serialized index that still represents a visible CRDT row.

View file

@ -2,7 +2,6 @@ import 'dart:async';
import 'package:serverpod_client/serverpod_client.dart'; import 'package:serverpod_client/serverpod_client.dart';
import 'package:serverpod_database/serverpod_database.dart'; import 'package:serverpod_database/serverpod_database.dart';
import 'package:serverpod_offline_sync/serverpod_offline_sync.dart';
import '../protocol/protocol.dart'; import '../protocol/protocol.dart';
import 'exceptions.dart'; import 'exceptions.dart';

View file

@ -1,5 +1,4 @@
import 'package:serverpod_database/serverpod_database.dart'; import 'package:serverpod_database/serverpod_database.dart';
import 'package:serverpod_offline_sync/serverpod_offline_sync.dart';
import 'package:uuid/uuid.dart'; import 'package:uuid/uuid.dart';
import '../managers/scope.dart'; import '../managers/scope.dart';

View file

@ -1,7 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:serverpod_database/serverpod_database.dart'; import 'package:serverpod_database/serverpod_database.dart';
import 'package:serverpod_offline_sync/serverpod_offline_sync.dart';
import 'package:uuid/uuid.dart'; import 'package:uuid/uuid.dart';
import '../database/database.dart'; import '../database/database.dart';

View file

@ -5,7 +5,6 @@
import 'dart:async'; import 'dart:async';
import 'package:serverpod_database/serverpod_database.dart'; import 'package:serverpod_database/serverpod_database.dart';
import 'package:serverpod_offline_sync/serverpod_offline_sync.dart';
import 'package:uuid/uuid.dart'; import 'package:uuid/uuid.dart';
import '../crdt/exceptions.dart'; import '../crdt/exceptions.dart';
@ -241,9 +240,6 @@ class CrdtDatabase implements Database {
offset: offset, offset: offset,
orderBy: orderBy, orderBy: orderBy,
orderByList: orderByList, orderByList: orderByList,
// Remove this once the deprecated member is removed.
// ignore: deprecated_member_use
orderDescending: orderDescending,
transaction: transaction, transaction: transaction,
include: include, include: include,
lockMode: lockMode, lockMode: lockMode,
@ -302,9 +298,6 @@ class CrdtDatabase implements Database {
offset: offset, offset: offset,
orderBy: orderBy, orderBy: orderBy,
orderByList: orderByList, orderByList: orderByList,
// Remove this once the deprecated member is removed.
// ignore: deprecated_member_use
orderDescending: orderDescending,
transaction: transaction, transaction: transaction,
include: include, include: include,
lockMode: lockMode, lockMode: lockMode,
@ -712,9 +705,6 @@ class CrdtDatabase implements Database {
offset: offset, offset: offset,
orderBy: orderBy, orderBy: orderBy,
orderByList: orderByList, orderByList: orderByList,
// Remove this once the deprecated member is removed.
// ignore: deprecated_member_use
orderDescending: orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -737,9 +727,6 @@ class CrdtDatabase implements Database {
offset: offset, offset: offset,
orderBy: orderBy, orderBy: orderBy,
orderByList: orderByList, orderByList: orderByList,
// Remove this once the deprecated member is removed.
// ignore: deprecated_member_use
orderDescending: orderDescending,
transaction: tx, transaction: tx,
); );
@ -769,9 +756,6 @@ class CrdtDatabase implements Database {
), ),
orderBy: orderBy, orderBy: orderBy,
orderByList: orderByList, orderByList: orderByList,
// Remove this once the deprecated member is removed.
// ignore: deprecated_member_use
orderDescending: orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -812,9 +796,6 @@ class CrdtDatabase implements Database {
where: where, where: where,
orderBy: orderBy, orderBy: orderBy,
orderByList: orderByList, orderByList: orderByList,
// Remove this once the deprecated member is removed.
// ignore: deprecated_member_use
orderDescending: orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -833,9 +814,6 @@ class CrdtDatabase implements Database {
), ),
orderBy: orderBy, orderBy: orderBy,
orderByList: orderByList, orderByList: orderByList,
// Remove this once the deprecated member is removed.
// ignore: deprecated_member_use
orderDescending: orderDescending,
transaction: tx, transaction: tx,
); );

View file

@ -1,5 +1,4 @@
import 'package:serverpod_database/serverpod_database.dart'; import 'package:serverpod_database/serverpod_database.dart';
import 'package:serverpod_offline_sync/serverpod_offline_sync.dart';
import 'package:serverpod_serialization/serverpod_serialization.dart'; import 'package:serverpod_serialization/serverpod_serialization.dart';
import '../crdt/exceptions.dart'; import '../crdt/exceptions.dart';

View file

@ -1,4 +1,3 @@
import 'package:serverpod_offline_sync/serverpod_offline_sync.dart';
import 'package:uuid/uuid.dart'; import 'package:uuid/uuid.dart';
import '../protocol/protocol.dart'; import '../protocol/protocol.dart';

View file

@ -13,10 +13,10 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:serverpod_offline_sync/serverpod_offline_sync.dart' as _i1; import 'package:serverpod_offline_sync/serverpod_offline_sync.dart' as _i1;
import 'package:serverpod_database/serverpod_database.dart' as _i2; import 'package:serverpod_database/serverpod_database.dart' as _i2;
import '../data/row.dart' as _i3; import 'package:serverpod_client/serverpod_client.dart' as _i3;
import '../node/node.dart' as _i4; import '../data/row.dart' as _i4;
import '../data/deleted_reason.dart' as _i5; import '../node/node.dart' as _i5;
import 'package:serverpod_client/serverpod_client.dart' as _i6; import '../data/deleted_reason.dart' as _i6;
import 'package:serverpod_offline_sync_client/src/protocol/protocol.dart' import 'package:serverpod_offline_sync_client/src/protocol/protocol.dart'
as _i7; as _i7;
@ -25,7 +25,7 @@ import 'package:serverpod_offline_sync_client/src/protocol/protocol.dart'
/// This table stores materialized monotone CLFlag metadata after a visibility /// This table stores materialized monotone CLFlag metadata after a visibility
/// change event has been recorded. /// change event has been recorded.
abstract class CrdtDataDeleted extends _i1.BaseHlc abstract class CrdtDataDeleted extends _i1.BaseHlc
implements _i2.TableRow<int?> { implements _i2.TableRow<int?>, _i3.ProtocolSerialization {
CrdtDataDeleted._({ CrdtDataDeleted._({
this.id, this.id,
required super.hlcDatetime, required super.hlcDatetime,
@ -42,33 +42,33 @@ abstract class CrdtDataDeleted extends _i1.BaseHlc
int? id, int? id,
required DateTime hlcDatetime, required DateTime hlcDatetime,
required int hlcCounter, required int hlcCounter,
_i3.CrdtDataRow? row, _i4.CrdtDataRow? row,
required int rowId, required int rowId,
required int nodeId, required int nodeId,
_i4.CrdtNode? node, _i5.CrdtNode? node,
required int clFlag, required int clFlag,
required _i5.CrdtDataDeletedReason reason, required _i6.CrdtDataDeletedReason reason,
}) = _CrdtDataDeletedImpl; }) = _CrdtDataDeletedImpl;
factory CrdtDataDeleted.fromJson(Map<String, dynamic> jsonSerialization) { factory CrdtDataDeleted.fromJson(Map<String, dynamic> jsonSerialization) {
return CrdtDataDeleted( return CrdtDataDeleted(
id: jsonSerialization['id'] as int?, id: jsonSerialization['id'] as int?,
hlcDatetime: _i6.DateTimeJsonExtension.fromJson( hlcDatetime: _i3.DateTimeJsonExtension.fromJson(
jsonSerialization['hlcDatetime'], jsonSerialization['hlcDatetime'],
), ),
hlcCounter: jsonSerialization['hlcCounter'] as int, hlcCounter: jsonSerialization['hlcCounter'] as int,
row: jsonSerialization['row'] == null row: jsonSerialization['row'] == null
? null ? null
: _i7.Protocol().deserialize<_i3.CrdtDataRow>( : _i7.Protocol().deserialize<_i4.CrdtDataRow>(
jsonSerialization['row'], jsonSerialization['row'],
), ),
rowId: jsonSerialization['rowId'] as int, rowId: jsonSerialization['rowId'] as int,
nodeId: jsonSerialization['nodeId'] as int, nodeId: jsonSerialization['nodeId'] as int,
node: jsonSerialization['node'] == null node: jsonSerialization['node'] == null
? null ? null
: _i7.Protocol().deserialize<_i4.CrdtNode>(jsonSerialization['node']), : _i7.Protocol().deserialize<_i5.CrdtNode>(jsonSerialization['node']),
clFlag: jsonSerialization['clFlag'] as int, clFlag: jsonSerialization['clFlag'] as int,
reason: _i5.CrdtDataDeletedReason.fromJson( reason: _i6.CrdtDataDeletedReason.fromJson(
(jsonSerialization['reason'] as int), (jsonSerialization['reason'] as int),
), ),
); );
@ -82,20 +82,20 @@ abstract class CrdtDataDeleted extends _i1.BaseHlc
int? id; int? id;
/// Row whose visibility is tracked. /// Row whose visibility is tracked.
_i3.CrdtDataRow? row; _i4.CrdtDataRow? row;
int rowId; int rowId;
int nodeId; int nodeId;
/// The node that updated the field. /// The node that updated the field.
_i4.CrdtNode? node; _i5.CrdtNode? node;
/// Monotone causal-length flag. Odd values are visible and even values are deleted. /// Monotone causal-length flag. Odd values are visible and even values are deleted.
int clFlag; int clFlag;
/// Why the row entered its current visibility generation. /// Why the row entered its current visibility generation.
_i5.CrdtDataDeletedReason reason; _i6.CrdtDataDeletedReason reason;
@override @override
_i2.Table<int?> get table => t; _i2.Table<int?> get table => t;
@ -103,17 +103,17 @@ abstract class CrdtDataDeleted extends _i1.BaseHlc
/// Returns a shallow copy of this [CrdtDataDeleted] /// Returns a shallow copy of this [CrdtDataDeleted]
/// with some or all fields replaced by the given arguments. /// with some or all fields replaced by the given arguments.
@override @override
@_i6.useResult @_i3.useResult
CrdtDataDeleted copyWith({ CrdtDataDeleted copyWith({
int? id, int? id,
DateTime? hlcDatetime, DateTime? hlcDatetime,
int? hlcCounter, int? hlcCounter,
_i3.CrdtDataRow? row, _i4.CrdtDataRow? row,
int? rowId, int? rowId,
int? nodeId, int? nodeId,
_i4.CrdtNode? node, _i5.CrdtNode? node,
int? clFlag, int? clFlag,
_i5.CrdtDataDeletedReason? reason, _i6.CrdtDataDeletedReason? reason,
}); });
@override @override
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -131,9 +131,25 @@ abstract class CrdtDataDeleted extends _i1.BaseHlc
}; };
} }
@override
Map<String, dynamic> toJsonForProtocol() {
return {
'__className__': 'serverpod_offline_sync.CrdtDataDeleted',
if (id != null) 'id': id,
'hlcDatetime': hlcDatetime.toJson(),
'hlcCounter': hlcCounter,
if (row != null) 'row': row?.toJsonForProtocol(),
'rowId': rowId,
'nodeId': nodeId,
if (node != null) 'node': node?.toJsonForProtocol(),
'clFlag': clFlag,
'reason': reason.toJson(),
};
}
static CrdtDataDeletedInclude include({ static CrdtDataDeletedInclude include({
_i3.CrdtDataRowInclude? row, _i4.CrdtDataRowInclude? row,
_i4.CrdtNodeInclude? node, _i5.CrdtNodeInclude? node,
}) { }) {
return CrdtDataDeletedInclude._( return CrdtDataDeletedInclude._(
row: row, row: row,
@ -146,8 +162,6 @@ abstract class CrdtDataDeleted extends _i1.BaseHlc
int? limit, int? limit,
int? offset, int? offset,
_i2.OrderByBuilder<CrdtDataDeletedTable>? orderBy, _i2.OrderByBuilder<CrdtDataDeletedTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataDeletedTable>? orderByList, _i2.OrderByListBuilder<CrdtDataDeletedTable>? orderByList,
CrdtDataDeletedInclude? include, CrdtDataDeletedInclude? include,
}) { }) {
@ -156,8 +170,6 @@ abstract class CrdtDataDeleted extends _i1.BaseHlc
limit: limit, limit: limit,
offset: offset, offset: offset,
orderBy: orderBy?.call(CrdtDataDeleted.t), orderBy: orderBy?.call(CrdtDataDeleted.t),
orderDescending: // ignore: deprecated_member_use_from_same_package
orderDescending,
orderByList: orderByList?.call(CrdtDataDeleted.t), orderByList: orderByList?.call(CrdtDataDeleted.t),
include: include, include: include,
); );
@ -165,7 +177,7 @@ abstract class CrdtDataDeleted extends _i1.BaseHlc
@override @override
String toString() { String toString() {
return _i6.SerializationManager.encode(this); return _i3.SerializationManager.encode(this);
} }
} }
@ -176,12 +188,12 @@ class _CrdtDataDeletedImpl extends CrdtDataDeleted {
int? id, int? id,
required DateTime hlcDatetime, required DateTime hlcDatetime,
required int hlcCounter, required int hlcCounter,
_i3.CrdtDataRow? row, _i4.CrdtDataRow? row,
required int rowId, required int rowId,
required int nodeId, required int nodeId,
_i4.CrdtNode? node, _i5.CrdtNode? node,
required int clFlag, required int clFlag,
required _i5.CrdtDataDeletedReason reason, required _i6.CrdtDataDeletedReason reason,
}) : super._( }) : super._(
id: id, id: id,
hlcDatetime: hlcDatetime, hlcDatetime: hlcDatetime,
@ -196,7 +208,7 @@ class _CrdtDataDeletedImpl extends CrdtDataDeleted {
/// Returns a shallow copy of this [CrdtDataDeleted] /// Returns a shallow copy of this [CrdtDataDeleted]
/// with some or all fields replaced by the given arguments. /// with some or all fields replaced by the given arguments.
@_i6.useResult @_i3.useResult
@override @override
CrdtDataDeleted copyWith({ CrdtDataDeleted copyWith({
Object? id = _Undefined, Object? id = _Undefined,
@ -207,16 +219,16 @@ class _CrdtDataDeletedImpl extends CrdtDataDeleted {
int? nodeId, int? nodeId,
Object? node = _Undefined, Object? node = _Undefined,
int? clFlag, int? clFlag,
_i5.CrdtDataDeletedReason? reason, _i6.CrdtDataDeletedReason? reason,
}) { }) {
return CrdtDataDeleted( return CrdtDataDeleted(
id: id is int? ? id : this.id, id: id is int? ? id : this.id,
hlcDatetime: hlcDatetime ?? this.hlcDatetime, hlcDatetime: hlcDatetime ?? this.hlcDatetime,
hlcCounter: hlcCounter ?? this.hlcCounter, hlcCounter: hlcCounter ?? this.hlcCounter,
row: row is _i3.CrdtDataRow? ? row : this.row?.copyWith(), row: row is _i4.CrdtDataRow? ? row : this.row?.copyWith(),
rowId: rowId ?? this.rowId, rowId: rowId ?? this.rowId,
nodeId: nodeId ?? this.nodeId, nodeId: nodeId ?? this.nodeId,
node: node is _i4.CrdtNode? ? node : this.node?.copyWith(), node: node is _i5.CrdtNode? ? node : this.node?.copyWith(),
clFlag: clFlag ?? this.clFlag, clFlag: clFlag ?? this.clFlag,
reason: reason ?? this.reason, reason: reason ?? this.reason,
); );
@ -252,8 +264,8 @@ class CrdtDataDeletedUpdateTable extends _i2.UpdateTable<CrdtDataDeletedTable> {
value, value,
); );
_i2.ColumnValue<_i5.CrdtDataDeletedReason, _i5.CrdtDataDeletedReason> reason( _i2.ColumnValue<_i6.CrdtDataDeletedReason, _i6.CrdtDataDeletedReason> reason(
_i5.CrdtDataDeletedReason value, _i6.CrdtDataDeletedReason value,
) => _i2.ColumnValue( ) => _i2.ColumnValue(
table.reason, table.reason,
value, value,
@ -300,43 +312,43 @@ class CrdtDataDeletedTable extends _i2.Table<int?> {
late final _i2.ColumnInt hlcCounter; late final _i2.ColumnInt hlcCounter;
/// Row whose visibility is tracked. /// Row whose visibility is tracked.
_i3.CrdtDataRowTable? _row; _i4.CrdtDataRowTable? _row;
late final _i2.ColumnInt rowId; late final _i2.ColumnInt rowId;
late final _i2.ColumnInt nodeId; late final _i2.ColumnInt nodeId;
/// The node that updated the field. /// The node that updated the field.
_i4.CrdtNodeTable? _node; _i5.CrdtNodeTable? _node;
/// Monotone causal-length flag. Odd values are visible and even values are deleted. /// Monotone causal-length flag. Odd values are visible and even values are deleted.
late final _i2.ColumnInt clFlag; late final _i2.ColumnInt clFlag;
/// Why the row entered its current visibility generation. /// Why the row entered its current visibility generation.
late final _i2.ColumnEnum<_i5.CrdtDataDeletedReason> reason; late final _i2.ColumnEnum<_i6.CrdtDataDeletedReason> reason;
_i3.CrdtDataRowTable get row { _i4.CrdtDataRowTable get row {
if (_row != null) return _row!; if (_row != null) return _row!;
_row = _i2.createRelationTable( _row = _i2.createRelationTable(
relationFieldName: 'row', relationFieldName: 'row',
field: CrdtDataDeleted.t.rowId, field: CrdtDataDeleted.t.rowId,
foreignField: _i3.CrdtDataRow.t.id, foreignField: _i4.CrdtDataRow.t.id,
tableRelation: tableRelation, tableRelation: tableRelation,
createTable: (foreignTableRelation) => createTable: (foreignTableRelation) =>
_i3.CrdtDataRowTable(tableRelation: foreignTableRelation), _i4.CrdtDataRowTable(tableRelation: foreignTableRelation),
); );
return _row!; return _row!;
} }
_i4.CrdtNodeTable get node { _i5.CrdtNodeTable get node {
if (_node != null) return _node!; if (_node != null) return _node!;
_node = _i2.createRelationTable( _node = _i2.createRelationTable(
relationFieldName: 'node', relationFieldName: 'node',
field: CrdtDataDeleted.t.nodeId, field: CrdtDataDeleted.t.nodeId,
foreignField: _i4.CrdtNode.t.id, foreignField: _i5.CrdtNode.t.id,
tableRelation: tableRelation, tableRelation: tableRelation,
createTable: (foreignTableRelation) => createTable: (foreignTableRelation) =>
_i4.CrdtNodeTable(tableRelation: foreignTableRelation), _i5.CrdtNodeTable(tableRelation: foreignTableRelation),
); );
return _node!; return _node!;
} }
@ -366,16 +378,16 @@ class CrdtDataDeletedTable extends _i2.Table<int?> {
class CrdtDataDeletedInclude extends _i2.IncludeObject { class CrdtDataDeletedInclude extends _i2.IncludeObject {
CrdtDataDeletedInclude._({ CrdtDataDeletedInclude._({
_i3.CrdtDataRowInclude? row, _i4.CrdtDataRowInclude? row,
_i4.CrdtNodeInclude? node, _i5.CrdtNodeInclude? node,
}) { }) {
_row = row; _row = row;
_node = node; _node = node;
} }
_i3.CrdtDataRowInclude? _row; _i4.CrdtDataRowInclude? _row;
_i4.CrdtNodeInclude? _node; _i5.CrdtNodeInclude? _node;
@override @override
Map<String, _i2.Include?> get includes => { Map<String, _i2.Include?> get includes => {
@ -393,8 +405,6 @@ class CrdtDataDeletedIncludeList extends _i2.IncludeList {
super.limit, super.limit,
super.offset, super.offset,
super.orderBy, super.orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
super.orderDescending,
super.orderByList, super.orderByList,
super.include, super.include,
}) { }) {
@ -441,8 +451,6 @@ class CrdtDataDeletedRepository {
int? limit, int? limit,
int? offset, int? offset,
_i2.OrderByBuilder<CrdtDataDeletedTable>? orderBy, _i2.OrderByBuilder<CrdtDataDeletedTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataDeletedTable>? orderByList, _i2.OrderByListBuilder<CrdtDataDeletedTable>? orderByList,
_i2.Transaction? transaction, _i2.Transaction? transaction,
CrdtDataDeletedInclude? include, CrdtDataDeletedInclude? include,
@ -453,8 +461,6 @@ class CrdtDataDeletedRepository {
where: where?.call(CrdtDataDeleted.t), where: where?.call(CrdtDataDeleted.t),
orderBy: orderBy?.call(CrdtDataDeleted.t), orderBy: orderBy?.call(CrdtDataDeleted.t),
orderByList: orderByList?.call(CrdtDataDeleted.t), orderByList: orderByList?.call(CrdtDataDeleted.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
limit: limit, limit: limit,
offset: offset, offset: offset,
transaction: transaction, transaction: transaction,
@ -486,8 +492,6 @@ class CrdtDataDeletedRepository {
_i2.WhereExpressionBuilder<CrdtDataDeletedTable>? where, _i2.WhereExpressionBuilder<CrdtDataDeletedTable>? where,
int? offset, int? offset,
_i2.OrderByBuilder<CrdtDataDeletedTable>? orderBy, _i2.OrderByBuilder<CrdtDataDeletedTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataDeletedTable>? orderByList, _i2.OrderByListBuilder<CrdtDataDeletedTable>? orderByList,
_i2.Transaction? transaction, _i2.Transaction? transaction,
CrdtDataDeletedInclude? include, CrdtDataDeletedInclude? include,
@ -498,8 +502,6 @@ class CrdtDataDeletedRepository {
where: where?.call(CrdtDataDeleted.t), where: where?.call(CrdtDataDeleted.t),
orderBy: orderBy?.call(CrdtDataDeleted.t), orderBy: orderBy?.call(CrdtDataDeleted.t),
orderByList: orderByList?.call(CrdtDataDeleted.t), orderByList: orderByList?.call(CrdtDataDeleted.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
offset: offset, offset: offset,
transaction: transaction, transaction: transaction,
include: include, include: include,
@ -709,8 +711,6 @@ class CrdtDataDeletedRepository {
int? offset, int? offset,
_i2.OrderByBuilder<CrdtDataDeletedTable>? orderBy, _i2.OrderByBuilder<CrdtDataDeletedTable>? orderBy,
_i2.OrderByListBuilder<CrdtDataDeletedTable>? orderByList, _i2.OrderByListBuilder<CrdtDataDeletedTable>? orderByList,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.Transaction? transaction, _i2.Transaction? transaction,
bool noReturn = false, bool noReturn = false,
}) async { }) async {
@ -721,8 +721,6 @@ class CrdtDataDeletedRepository {
offset: offset, offset: offset,
orderBy: orderBy?.call(CrdtDataDeleted.t), orderBy: orderBy?.call(CrdtDataDeleted.t),
orderByList: orderByList?.call(CrdtDataDeleted.t), orderByList: orderByList?.call(CrdtDataDeleted.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -743,8 +741,6 @@ class CrdtDataDeletedRepository {
_i2.DatabaseSession session, _i2.DatabaseSession session,
List<CrdtDataDeleted> rows, { List<CrdtDataDeleted> rows, {
_i2.OrderByBuilder<CrdtDataDeletedTable>? orderBy, _i2.OrderByBuilder<CrdtDataDeletedTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataDeletedTable>? orderByList, _i2.OrderByListBuilder<CrdtDataDeletedTable>? orderByList,
_i2.Transaction? transaction, _i2.Transaction? transaction,
bool noReturn = false, bool noReturn = false,
@ -753,8 +749,6 @@ class CrdtDataDeletedRepository {
rows, rows,
orderBy: orderBy?.call(CrdtDataDeleted.t), orderBy: orderBy?.call(CrdtDataDeleted.t),
orderByList: orderByList?.call(CrdtDataDeleted.t), orderByList: orderByList?.call(CrdtDataDeleted.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -784,8 +778,6 @@ class CrdtDataDeletedRepository {
_i2.DatabaseSession session, { _i2.DatabaseSession session, {
required _i2.WhereExpressionBuilder<CrdtDataDeletedTable> where, required _i2.WhereExpressionBuilder<CrdtDataDeletedTable> where,
_i2.OrderByBuilder<CrdtDataDeletedTable>? orderBy, _i2.OrderByBuilder<CrdtDataDeletedTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataDeletedTable>? orderByList, _i2.OrderByListBuilder<CrdtDataDeletedTable>? orderByList,
_i2.Transaction? transaction, _i2.Transaction? transaction,
bool noReturn = false, bool noReturn = false,
@ -794,8 +786,6 @@ class CrdtDataDeletedRepository {
where: where(CrdtDataDeleted.t), where: where(CrdtDataDeleted.t),
orderBy: orderBy?.call(CrdtDataDeleted.t), orderBy: orderBy?.call(CrdtDataDeleted.t),
orderByList: orderByList?.call(CrdtDataDeleted.t), orderByList: orderByList?.call(CrdtDataDeleted.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -841,7 +831,7 @@ class CrdtDataDeletedAttachRowRepository {
Future<void> row( Future<void> row(
_i2.DatabaseSession session, _i2.DatabaseSession session,
CrdtDataDeleted crdtDataDeleted, CrdtDataDeleted crdtDataDeleted,
_i3.CrdtDataRow row, { _i4.CrdtDataRow row, {
_i2.Transaction? transaction, _i2.Transaction? transaction,
}) async { }) async {
if (crdtDataDeleted.id == null) { if (crdtDataDeleted.id == null) {
@ -864,7 +854,7 @@ class CrdtDataDeletedAttachRowRepository {
Future<void> node( Future<void> node(
_i2.DatabaseSession session, _i2.DatabaseSession session,
CrdtDataDeleted crdtDataDeleted, CrdtDataDeleted crdtDataDeleted,
_i4.CrdtNode node, { _i5.CrdtNode node, {
_i2.Transaction? transaction, _i2.Transaction? transaction,
}) async { }) async {
if (crdtDataDeleted.id == null) { if (crdtDataDeleted.id == null) {

View file

@ -13,11 +13,11 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:serverpod_offline_sync/serverpod_offline_sync.dart' as _i1; import 'package:serverpod_offline_sync/serverpod_offline_sync.dart' as _i1;
import 'package:serverpod_database/serverpod_database.dart' as _i2; import 'package:serverpod_database/serverpod_database.dart' as _i2;
import '../data/row.dart' as _i3; import 'package:serverpod_client/serverpod_client.dart' as _i3;
import '../schema/column.dart' as _i4; import '../data/row.dart' as _i4;
import '../node/node.dart' as _i5; import '../schema/column.dart' as _i5;
import '../data/foreign_key.dart' as _i6; import '../node/node.dart' as _i6;
import 'package:serverpod_client/serverpod_client.dart' as _i7; import '../data/foreign_key.dart' as _i7;
import 'package:serverpod_offline_sync_client/src/protocol/protocol.dart' import 'package:serverpod_offline_sync_client/src/protocol/protocol.dart'
as _i8; as _i8;
@ -25,7 +25,8 @@ import 'package:serverpod_offline_sync_client/src/protocol/protocol.dart'
/// ///
/// This table stores only the HLC timestamp for a field. During merge, if the /// This table stores only the HLC timestamp for a field. During merge, if the
/// other HLC is greater, the actual data must be fetched from the table itself. /// other HLC is greater, the actual data must be fetched from the table itself.
abstract class CrdtDataField extends _i1.BaseHlc implements _i2.TableRow<int?> { abstract class CrdtDataField extends _i1.BaseHlc
implements _i2.TableRow<int?>, _i3.ProtocolSerialization {
CrdtDataField._({ CrdtDataField._({
this.id, this.id,
required super.hlcDatetime, required super.hlcDatetime,
@ -44,40 +45,40 @@ abstract class CrdtDataField extends _i1.BaseHlc implements _i2.TableRow<int?> {
required DateTime hlcDatetime, required DateTime hlcDatetime,
required int hlcCounter, required int hlcCounter,
required int rowId, required int rowId,
_i3.CrdtDataRow? row, _i4.CrdtDataRow? row,
required int columnId, required int columnId,
_i4.CrdtSchemaColumn? column, _i5.CrdtSchemaColumn? column,
required int nodeId, required int nodeId,
_i5.CrdtNode? node, _i6.CrdtNode? node,
_i6.CrdtDataForeignKey? foreignKey, _i7.CrdtDataForeignKey? foreignKey,
}) = _CrdtDataFieldImpl; }) = _CrdtDataFieldImpl;
factory CrdtDataField.fromJson(Map<String, dynamic> jsonSerialization) { factory CrdtDataField.fromJson(Map<String, dynamic> jsonSerialization) {
return CrdtDataField( return CrdtDataField(
id: jsonSerialization['id'] as int?, id: jsonSerialization['id'] as int?,
hlcDatetime: _i7.DateTimeJsonExtension.fromJson( hlcDatetime: _i3.DateTimeJsonExtension.fromJson(
jsonSerialization['hlcDatetime'], jsonSerialization['hlcDatetime'],
), ),
hlcCounter: jsonSerialization['hlcCounter'] as int, hlcCounter: jsonSerialization['hlcCounter'] as int,
rowId: jsonSerialization['rowId'] as int, rowId: jsonSerialization['rowId'] as int,
row: jsonSerialization['row'] == null row: jsonSerialization['row'] == null
? null ? null
: _i8.Protocol().deserialize<_i3.CrdtDataRow>( : _i8.Protocol().deserialize<_i4.CrdtDataRow>(
jsonSerialization['row'], jsonSerialization['row'],
), ),
columnId: jsonSerialization['columnId'] as int, columnId: jsonSerialization['columnId'] as int,
column: jsonSerialization['column'] == null column: jsonSerialization['column'] == null
? null ? null
: _i8.Protocol().deserialize<_i4.CrdtSchemaColumn>( : _i8.Protocol().deserialize<_i5.CrdtSchemaColumn>(
jsonSerialization['column'], jsonSerialization['column'],
), ),
nodeId: jsonSerialization['nodeId'] as int, nodeId: jsonSerialization['nodeId'] as int,
node: jsonSerialization['node'] == null node: jsonSerialization['node'] == null
? null ? null
: _i8.Protocol().deserialize<_i5.CrdtNode>(jsonSerialization['node']), : _i8.Protocol().deserialize<_i6.CrdtNode>(jsonSerialization['node']),
foreignKey: jsonSerialization['foreignKey'] == null foreignKey: jsonSerialization['foreignKey'] == null
? null ? null
: _i8.Protocol().deserialize<_i6.CrdtDataForeignKey>( : _i8.Protocol().deserialize<_i7.CrdtDataForeignKey>(
jsonSerialization['foreignKey'], jsonSerialization['foreignKey'],
), ),
); );
@ -93,21 +94,21 @@ abstract class CrdtDataField extends _i1.BaseHlc implements _i2.TableRow<int?> {
int rowId; int rowId;
/// Row that the field belongs to. /// Row that the field belongs to.
_i3.CrdtDataRow? row; _i4.CrdtDataRow? row;
int columnId; int columnId;
/// Column that the field belongs to. /// Column that the field belongs to.
_i4.CrdtSchemaColumn? column; _i5.CrdtSchemaColumn? column;
int nodeId; int nodeId;
/// The node that updated the field. /// The node that updated the field.
_i5.CrdtNode? node; _i6.CrdtNode? node;
/// The foreign key information for the field, if this field holds a /// The foreign key information for the field, if this field holds a
/// reference to another row. /// reference to another row.
_i6.CrdtDataForeignKey? foreignKey; _i7.CrdtDataForeignKey? foreignKey;
@override @override
_i2.Table<int?> get table => t; _i2.Table<int?> get table => t;
@ -115,18 +116,18 @@ abstract class CrdtDataField extends _i1.BaseHlc implements _i2.TableRow<int?> {
/// Returns a shallow copy of this [CrdtDataField] /// Returns a shallow copy of this [CrdtDataField]
/// with some or all fields replaced by the given arguments. /// with some or all fields replaced by the given arguments.
@override @override
@_i7.useResult @_i3.useResult
CrdtDataField copyWith({ CrdtDataField copyWith({
int? id, int? id,
DateTime? hlcDatetime, DateTime? hlcDatetime,
int? hlcCounter, int? hlcCounter,
int? rowId, int? rowId,
_i3.CrdtDataRow? row, _i4.CrdtDataRow? row,
int? columnId, int? columnId,
_i4.CrdtSchemaColumn? column, _i5.CrdtSchemaColumn? column,
int? nodeId, int? nodeId,
_i5.CrdtNode? node, _i6.CrdtNode? node,
_i6.CrdtDataForeignKey? foreignKey, _i7.CrdtDataForeignKey? foreignKey,
}); });
@override @override
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -145,11 +146,28 @@ abstract class CrdtDataField extends _i1.BaseHlc implements _i2.TableRow<int?> {
}; };
} }
@override
Map<String, dynamic> toJsonForProtocol() {
return {
'__className__': 'serverpod_offline_sync.CrdtDataField',
if (id != null) 'id': id,
'hlcDatetime': hlcDatetime.toJson(),
'hlcCounter': hlcCounter,
'rowId': rowId,
if (row != null) 'row': row?.toJsonForProtocol(),
'columnId': columnId,
if (column != null) 'column': column?.toJsonForProtocol(),
'nodeId': nodeId,
if (node != null) 'node': node?.toJsonForProtocol(),
if (foreignKey != null) 'foreignKey': foreignKey?.toJsonForProtocol(),
};
}
static CrdtDataFieldInclude include({ static CrdtDataFieldInclude include({
_i3.CrdtDataRowInclude? row, _i4.CrdtDataRowInclude? row,
_i4.CrdtSchemaColumnInclude? column, _i5.CrdtSchemaColumnInclude? column,
_i5.CrdtNodeInclude? node, _i6.CrdtNodeInclude? node,
_i6.CrdtDataForeignKeyInclude? foreignKey, _i7.CrdtDataForeignKeyInclude? foreignKey,
}) { }) {
return CrdtDataFieldInclude._( return CrdtDataFieldInclude._(
row: row, row: row,
@ -164,8 +182,6 @@ abstract class CrdtDataField extends _i1.BaseHlc implements _i2.TableRow<int?> {
int? limit, int? limit,
int? offset, int? offset,
_i2.OrderByBuilder<CrdtDataFieldTable>? orderBy, _i2.OrderByBuilder<CrdtDataFieldTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataFieldTable>? orderByList, _i2.OrderByListBuilder<CrdtDataFieldTable>? orderByList,
CrdtDataFieldInclude? include, CrdtDataFieldInclude? include,
}) { }) {
@ -174,8 +190,6 @@ abstract class CrdtDataField extends _i1.BaseHlc implements _i2.TableRow<int?> {
limit: limit, limit: limit,
offset: offset, offset: offset,
orderBy: orderBy?.call(CrdtDataField.t), orderBy: orderBy?.call(CrdtDataField.t),
orderDescending: // ignore: deprecated_member_use_from_same_package
orderDescending,
orderByList: orderByList?.call(CrdtDataField.t), orderByList: orderByList?.call(CrdtDataField.t),
include: include, include: include,
); );
@ -183,7 +197,7 @@ abstract class CrdtDataField extends _i1.BaseHlc implements _i2.TableRow<int?> {
@override @override
String toString() { String toString() {
return _i7.SerializationManager.encode(this); return _i3.SerializationManager.encode(this);
} }
} }
@ -195,12 +209,12 @@ class _CrdtDataFieldImpl extends CrdtDataField {
required DateTime hlcDatetime, required DateTime hlcDatetime,
required int hlcCounter, required int hlcCounter,
required int rowId, required int rowId,
_i3.CrdtDataRow? row, _i4.CrdtDataRow? row,
required int columnId, required int columnId,
_i4.CrdtSchemaColumn? column, _i5.CrdtSchemaColumn? column,
required int nodeId, required int nodeId,
_i5.CrdtNode? node, _i6.CrdtNode? node,
_i6.CrdtDataForeignKey? foreignKey, _i7.CrdtDataForeignKey? foreignKey,
}) : super._( }) : super._(
id: id, id: id,
hlcDatetime: hlcDatetime, hlcDatetime: hlcDatetime,
@ -216,7 +230,7 @@ class _CrdtDataFieldImpl extends CrdtDataField {
/// Returns a shallow copy of this [CrdtDataField] /// Returns a shallow copy of this [CrdtDataField]
/// with some or all fields replaced by the given arguments. /// with some or all fields replaced by the given arguments.
@_i7.useResult @_i3.useResult
@override @override
CrdtDataField copyWith({ CrdtDataField copyWith({
Object? id = _Undefined, Object? id = _Undefined,
@ -235,14 +249,14 @@ class _CrdtDataFieldImpl extends CrdtDataField {
hlcDatetime: hlcDatetime ?? this.hlcDatetime, hlcDatetime: hlcDatetime ?? this.hlcDatetime,
hlcCounter: hlcCounter ?? this.hlcCounter, hlcCounter: hlcCounter ?? this.hlcCounter,
rowId: rowId ?? this.rowId, rowId: rowId ?? this.rowId,
row: row is _i3.CrdtDataRow? ? row : this.row?.copyWith(), row: row is _i4.CrdtDataRow? ? row : this.row?.copyWith(),
columnId: columnId ?? this.columnId, columnId: columnId ?? this.columnId,
column: column is _i4.CrdtSchemaColumn? column: column is _i5.CrdtSchemaColumn?
? column ? column
: this.column?.copyWith(), : this.column?.copyWith(),
nodeId: nodeId ?? this.nodeId, nodeId: nodeId ?? this.nodeId,
node: node is _i5.CrdtNode? ? node : this.node?.copyWith(), node: node is _i6.CrdtNode? ? node : this.node?.copyWith(),
foreignKey: foreignKey is _i6.CrdtDataForeignKey? foreignKey: foreignKey is _i7.CrdtDataForeignKey?
? foreignKey ? foreignKey
: this.foreignKey?.copyWith(), : this.foreignKey?.copyWith(),
); );
@ -316,70 +330,70 @@ class CrdtDataFieldTable extends _i2.Table<int?> {
late final _i2.ColumnInt rowId; late final _i2.ColumnInt rowId;
/// Row that the field belongs to. /// Row that the field belongs to.
_i3.CrdtDataRowTable? _row; _i4.CrdtDataRowTable? _row;
late final _i2.ColumnInt columnId; late final _i2.ColumnInt columnId;
/// Column that the field belongs to. /// Column that the field belongs to.
_i4.CrdtSchemaColumnTable? _column; _i5.CrdtSchemaColumnTable? _column;
late final _i2.ColumnInt nodeId; late final _i2.ColumnInt nodeId;
/// The node that updated the field. /// The node that updated the field.
_i5.CrdtNodeTable? _node; _i6.CrdtNodeTable? _node;
/// The foreign key information for the field, if this field holds a /// The foreign key information for the field, if this field holds a
/// reference to another row. /// reference to another row.
_i6.CrdtDataForeignKeyTable? _foreignKey; _i7.CrdtDataForeignKeyTable? _foreignKey;
_i3.CrdtDataRowTable get row { _i4.CrdtDataRowTable get row {
if (_row != null) return _row!; if (_row != null) return _row!;
_row = _i2.createRelationTable( _row = _i2.createRelationTable(
relationFieldName: 'row', relationFieldName: 'row',
field: CrdtDataField.t.rowId, field: CrdtDataField.t.rowId,
foreignField: _i3.CrdtDataRow.t.id, foreignField: _i4.CrdtDataRow.t.id,
tableRelation: tableRelation, tableRelation: tableRelation,
createTable: (foreignTableRelation) => createTable: (foreignTableRelation) =>
_i3.CrdtDataRowTable(tableRelation: foreignTableRelation), _i4.CrdtDataRowTable(tableRelation: foreignTableRelation),
); );
return _row!; return _row!;
} }
_i4.CrdtSchemaColumnTable get column { _i5.CrdtSchemaColumnTable get column {
if (_column != null) return _column!; if (_column != null) return _column!;
_column = _i2.createRelationTable( _column = _i2.createRelationTable(
relationFieldName: 'column', relationFieldName: 'column',
field: CrdtDataField.t.columnId, field: CrdtDataField.t.columnId,
foreignField: _i4.CrdtSchemaColumn.t.id, foreignField: _i5.CrdtSchemaColumn.t.id,
tableRelation: tableRelation, tableRelation: tableRelation,
createTable: (foreignTableRelation) => createTable: (foreignTableRelation) =>
_i4.CrdtSchemaColumnTable(tableRelation: foreignTableRelation), _i5.CrdtSchemaColumnTable(tableRelation: foreignTableRelation),
); );
return _column!; return _column!;
} }
_i5.CrdtNodeTable get node { _i6.CrdtNodeTable get node {
if (_node != null) return _node!; if (_node != null) return _node!;
_node = _i2.createRelationTable( _node = _i2.createRelationTable(
relationFieldName: 'node', relationFieldName: 'node',
field: CrdtDataField.t.nodeId, field: CrdtDataField.t.nodeId,
foreignField: _i5.CrdtNode.t.id, foreignField: _i6.CrdtNode.t.id,
tableRelation: tableRelation, tableRelation: tableRelation,
createTable: (foreignTableRelation) => createTable: (foreignTableRelation) =>
_i5.CrdtNodeTable(tableRelation: foreignTableRelation), _i6.CrdtNodeTable(tableRelation: foreignTableRelation),
); );
return _node!; return _node!;
} }
_i6.CrdtDataForeignKeyTable get foreignKey { _i7.CrdtDataForeignKeyTable get foreignKey {
if (_foreignKey != null) return _foreignKey!; if (_foreignKey != null) return _foreignKey!;
_foreignKey = _i2.createRelationTable( _foreignKey = _i2.createRelationTable(
relationFieldName: 'foreignKey', relationFieldName: 'foreignKey',
field: CrdtDataField.t.id, field: CrdtDataField.t.id,
foreignField: _i6.CrdtDataForeignKey.t.fieldId, foreignField: _i7.CrdtDataForeignKey.t.fieldId,
tableRelation: tableRelation, tableRelation: tableRelation,
createTable: (foreignTableRelation) => createTable: (foreignTableRelation) =>
_i6.CrdtDataForeignKeyTable(tableRelation: foreignTableRelation), _i7.CrdtDataForeignKeyTable(tableRelation: foreignTableRelation),
); );
return _foreignKey!; return _foreignKey!;
} }
@ -414,10 +428,10 @@ class CrdtDataFieldTable extends _i2.Table<int?> {
class CrdtDataFieldInclude extends _i2.IncludeObject { class CrdtDataFieldInclude extends _i2.IncludeObject {
CrdtDataFieldInclude._({ CrdtDataFieldInclude._({
_i3.CrdtDataRowInclude? row, _i4.CrdtDataRowInclude? row,
_i4.CrdtSchemaColumnInclude? column, _i5.CrdtSchemaColumnInclude? column,
_i5.CrdtNodeInclude? node, _i6.CrdtNodeInclude? node,
_i6.CrdtDataForeignKeyInclude? foreignKey, _i7.CrdtDataForeignKeyInclude? foreignKey,
}) { }) {
_row = row; _row = row;
_column = column; _column = column;
@ -425,13 +439,13 @@ class CrdtDataFieldInclude extends _i2.IncludeObject {
_foreignKey = foreignKey; _foreignKey = foreignKey;
} }
_i3.CrdtDataRowInclude? _row; _i4.CrdtDataRowInclude? _row;
_i4.CrdtSchemaColumnInclude? _column; _i5.CrdtSchemaColumnInclude? _column;
_i5.CrdtNodeInclude? _node; _i6.CrdtNodeInclude? _node;
_i6.CrdtDataForeignKeyInclude? _foreignKey; _i7.CrdtDataForeignKeyInclude? _foreignKey;
@override @override
Map<String, _i2.Include?> get includes => { Map<String, _i2.Include?> get includes => {
@ -451,8 +465,6 @@ class CrdtDataFieldIncludeList extends _i2.IncludeList {
super.limit, super.limit,
super.offset, super.offset,
super.orderBy, super.orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
super.orderDescending,
super.orderByList, super.orderByList,
super.include, super.include,
}) { }) {
@ -501,8 +513,6 @@ class CrdtDataFieldRepository {
int? limit, int? limit,
int? offset, int? offset,
_i2.OrderByBuilder<CrdtDataFieldTable>? orderBy, _i2.OrderByBuilder<CrdtDataFieldTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataFieldTable>? orderByList, _i2.OrderByListBuilder<CrdtDataFieldTable>? orderByList,
_i2.Transaction? transaction, _i2.Transaction? transaction,
CrdtDataFieldInclude? include, CrdtDataFieldInclude? include,
@ -513,8 +523,6 @@ class CrdtDataFieldRepository {
where: where?.call(CrdtDataField.t), where: where?.call(CrdtDataField.t),
orderBy: orderBy?.call(CrdtDataField.t), orderBy: orderBy?.call(CrdtDataField.t),
orderByList: orderByList?.call(CrdtDataField.t), orderByList: orderByList?.call(CrdtDataField.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
limit: limit, limit: limit,
offset: offset, offset: offset,
transaction: transaction, transaction: transaction,
@ -546,8 +554,6 @@ class CrdtDataFieldRepository {
_i2.WhereExpressionBuilder<CrdtDataFieldTable>? where, _i2.WhereExpressionBuilder<CrdtDataFieldTable>? where,
int? offset, int? offset,
_i2.OrderByBuilder<CrdtDataFieldTable>? orderBy, _i2.OrderByBuilder<CrdtDataFieldTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataFieldTable>? orderByList, _i2.OrderByListBuilder<CrdtDataFieldTable>? orderByList,
_i2.Transaction? transaction, _i2.Transaction? transaction,
CrdtDataFieldInclude? include, CrdtDataFieldInclude? include,
@ -558,8 +564,6 @@ class CrdtDataFieldRepository {
where: where?.call(CrdtDataField.t), where: where?.call(CrdtDataField.t),
orderBy: orderBy?.call(CrdtDataField.t), orderBy: orderBy?.call(CrdtDataField.t),
orderByList: orderByList?.call(CrdtDataField.t), orderByList: orderByList?.call(CrdtDataField.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
offset: offset, offset: offset,
transaction: transaction, transaction: transaction,
include: include, include: include,
@ -767,8 +771,6 @@ class CrdtDataFieldRepository {
int? offset, int? offset,
_i2.OrderByBuilder<CrdtDataFieldTable>? orderBy, _i2.OrderByBuilder<CrdtDataFieldTable>? orderBy,
_i2.OrderByListBuilder<CrdtDataFieldTable>? orderByList, _i2.OrderByListBuilder<CrdtDataFieldTable>? orderByList,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.Transaction? transaction, _i2.Transaction? transaction,
bool noReturn = false, bool noReturn = false,
}) async { }) async {
@ -779,8 +781,6 @@ class CrdtDataFieldRepository {
offset: offset, offset: offset,
orderBy: orderBy?.call(CrdtDataField.t), orderBy: orderBy?.call(CrdtDataField.t),
orderByList: orderByList?.call(CrdtDataField.t), orderByList: orderByList?.call(CrdtDataField.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -801,8 +801,6 @@ class CrdtDataFieldRepository {
_i2.DatabaseSession session, _i2.DatabaseSession session,
List<CrdtDataField> rows, { List<CrdtDataField> rows, {
_i2.OrderByBuilder<CrdtDataFieldTable>? orderBy, _i2.OrderByBuilder<CrdtDataFieldTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataFieldTable>? orderByList, _i2.OrderByListBuilder<CrdtDataFieldTable>? orderByList,
_i2.Transaction? transaction, _i2.Transaction? transaction,
bool noReturn = false, bool noReturn = false,
@ -811,8 +809,6 @@ class CrdtDataFieldRepository {
rows, rows,
orderBy: orderBy?.call(CrdtDataField.t), orderBy: orderBy?.call(CrdtDataField.t),
orderByList: orderByList?.call(CrdtDataField.t), orderByList: orderByList?.call(CrdtDataField.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -842,8 +838,6 @@ class CrdtDataFieldRepository {
_i2.DatabaseSession session, { _i2.DatabaseSession session, {
required _i2.WhereExpressionBuilder<CrdtDataFieldTable> where, required _i2.WhereExpressionBuilder<CrdtDataFieldTable> where,
_i2.OrderByBuilder<CrdtDataFieldTable>? orderBy, _i2.OrderByBuilder<CrdtDataFieldTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataFieldTable>? orderByList, _i2.OrderByListBuilder<CrdtDataFieldTable>? orderByList,
_i2.Transaction? transaction, _i2.Transaction? transaction,
bool noReturn = false, bool noReturn = false,
@ -852,8 +846,6 @@ class CrdtDataFieldRepository {
where: where(CrdtDataField.t), where: where(CrdtDataField.t),
orderBy: orderBy?.call(CrdtDataField.t), orderBy: orderBy?.call(CrdtDataField.t),
orderByList: orderByList?.call(CrdtDataField.t), orderByList: orderByList?.call(CrdtDataField.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -899,7 +891,7 @@ class CrdtDataFieldAttachRowRepository {
Future<void> row( Future<void> row(
_i2.DatabaseSession session, _i2.DatabaseSession session,
CrdtDataField crdtDataField, CrdtDataField crdtDataField,
_i3.CrdtDataRow row, { _i4.CrdtDataRow row, {
_i2.Transaction? transaction, _i2.Transaction? transaction,
}) async { }) async {
if (crdtDataField.id == null) { if (crdtDataField.id == null) {
@ -922,7 +914,7 @@ class CrdtDataFieldAttachRowRepository {
Future<void> column( Future<void> column(
_i2.DatabaseSession session, _i2.DatabaseSession session,
CrdtDataField crdtDataField, CrdtDataField crdtDataField,
_i4.CrdtSchemaColumn column, { _i5.CrdtSchemaColumn column, {
_i2.Transaction? transaction, _i2.Transaction? transaction,
}) async { }) async {
if (crdtDataField.id == null) { if (crdtDataField.id == null) {
@ -945,7 +937,7 @@ class CrdtDataFieldAttachRowRepository {
Future<void> node( Future<void> node(
_i2.DatabaseSession session, _i2.DatabaseSession session,
CrdtDataField crdtDataField, CrdtDataField crdtDataField,
_i5.CrdtNode node, { _i6.CrdtNode node, {
_i2.Transaction? transaction, _i2.Transaction? transaction,
}) async { }) async {
if (crdtDataField.id == null) { if (crdtDataField.id == null) {
@ -968,7 +960,7 @@ class CrdtDataFieldAttachRowRepository {
Future<void> foreignKey( Future<void> foreignKey(
_i2.DatabaseSession session, _i2.DatabaseSession session,
CrdtDataField crdtDataField, CrdtDataField crdtDataField,
_i6.CrdtDataForeignKey foreignKey, { _i7.CrdtDataForeignKey foreignKey, {
_i2.Transaction? transaction, _i2.Transaction? transaction,
}) async { }) async {
if (foreignKey.id == null) { if (foreignKey.id == null) {
@ -979,9 +971,9 @@ class CrdtDataFieldAttachRowRepository {
} }
var $foreignKey = foreignKey.copyWith(fieldId: crdtDataField.id); var $foreignKey = foreignKey.copyWith(fieldId: crdtDataField.id);
await session.db.updateRow<_i6.CrdtDataForeignKey>( await session.db.updateRow<_i7.CrdtDataForeignKey>(
$foreignKey, $foreignKey,
columns: [_i6.CrdtDataForeignKey.t.fieldId], columns: [_i7.CrdtDataForeignKey.t.fieldId],
transaction: transaction, transaction: transaction,
); );
} }
@ -1013,9 +1005,9 @@ class CrdtDataFieldDetachRowRepository {
} }
var $$foreignKey = $foreignKey.copyWith(fieldId: null); var $$foreignKey = $foreignKey.copyWith(fieldId: null);
await session.db.updateRow<_i6.CrdtDataForeignKey>( await session.db.updateRow<_i7.CrdtDataForeignKey>(
$$foreignKey, $$foreignKey,
columns: [_i6.CrdtDataForeignKey.t.fieldId], columns: [_i7.CrdtDataForeignKey.t.fieldId],
transaction: transaction, transaction: transaction,
); );
} }

View file

@ -12,8 +12,8 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:serverpod_database/serverpod_database.dart' as _i1; import 'package:serverpod_database/serverpod_database.dart' as _i1;
import '../data/field.dart' as _i2; import 'package:serverpod_client/serverpod_client.dart' as _i2;
import 'package:serverpod_client/serverpod_client.dart' as _i3; import '../data/field.dart' as _i3;
import '../data/foreign_key_override_reason.dart' as _i4; import '../data/foreign_key_override_reason.dart' as _i4;
import 'package:serverpod_offline_sync_client/src/protocol/protocol.dart' import 'package:serverpod_offline_sync_client/src/protocol/protocol.dart'
as _i5; as _i5;
@ -28,7 +28,8 @@ import 'package:serverpod_offline_sync_client/src/protocol/protocol.dart'
/// facts plus this attempted FK value. The projection columns record what was /// facts plus this attempted FK value. The projection columns record what was
/// materialized into the domain row; they do not decide business semantics or /// materialized into the domain row; they do not decide business semantics or
/// create user field updates during merge. /// create user field updates during merge.
abstract class CrdtDataForeignKey implements _i1.TableRow<int?> { abstract class CrdtDataForeignKey
implements _i1.TableRow<int?>, _i2.ProtocolSerialization {
CrdtDataForeignKey._({ CrdtDataForeignKey._({
this.id, this.id,
this.field, this.field,
@ -40,10 +41,10 @@ abstract class CrdtDataForeignKey implements _i1.TableRow<int?> {
factory CrdtDataForeignKey({ factory CrdtDataForeignKey({
int? id, int? id,
_i2.CrdtDataField? field, _i3.CrdtDataField? field,
required int fieldId, required int fieldId,
required _i3.UuidValue? attemptedValue, required _i2.UuidValue? attemptedValue,
_i3.UuidValue? visibleValue, _i2.UuidValue? visibleValue,
_i4.CrdtForeignKeyOverrideReason? overrideReason, _i4.CrdtForeignKeyOverrideReason? overrideReason,
}) = _CrdtDataForeignKeyImpl; }) = _CrdtDataForeignKeyImpl;
@ -52,18 +53,18 @@ abstract class CrdtDataForeignKey implements _i1.TableRow<int?> {
id: jsonSerialization['id'] as int?, id: jsonSerialization['id'] as int?,
field: jsonSerialization['field'] == null field: jsonSerialization['field'] == null
? null ? null
: _i5.Protocol().deserialize<_i2.CrdtDataField>( : _i5.Protocol().deserialize<_i3.CrdtDataField>(
jsonSerialization['field'], jsonSerialization['field'],
), ),
fieldId: jsonSerialization['fieldId'] as int, fieldId: jsonSerialization['fieldId'] as int,
attemptedValue: jsonSerialization['attemptedValue'] == null attemptedValue: jsonSerialization['attemptedValue'] == null
? null ? null
: _i3.UuidValueJsonExtension.fromJson( : _i2.UuidValueJsonExtension.fromJson(
jsonSerialization['attemptedValue'], jsonSerialization['attemptedValue'],
), ),
visibleValue: jsonSerialization['visibleValue'] == null visibleValue: jsonSerialization['visibleValue'] == null
? null ? null
: _i3.UuidValueJsonExtension.fromJson( : _i2.UuidValueJsonExtension.fromJson(
jsonSerialization['visibleValue'], jsonSerialization['visibleValue'],
), ),
overrideReason: jsonSerialization['overrideReason'] == null overrideReason: jsonSerialization['overrideReason'] == null
@ -82,7 +83,7 @@ abstract class CrdtDataForeignKey implements _i1.TableRow<int?> {
int? id; int? id;
/// The field that the foreign key belongs to. /// The field that the foreign key belongs to.
_i2.CrdtDataField? field; _i3.CrdtDataField? field;
int fieldId; int fieldId;
@ -90,11 +91,11 @@ abstract class CrdtDataForeignKey implements _i1.TableRow<int?> {
/// ///
/// This may be null for nullable foreign keys. This is durable FK field-value /// This may be null for nullable foreign keys. This is durable FK field-value
/// storage for CRDT columns whose CrdtDataField row stores only HLC metadata. /// storage for CRDT columns whose CrdtDataField row stores only HLC metadata.
_i3.UuidValue? attemptedValue; _i2.UuidValue? attemptedValue;
/// The foreign key value that is currently visible in the actual data row /// The foreign key value that is currently visible in the actual data row
/// when an override is active (overrideReason is non-null). /// when an override is active (overrideReason is non-null).
_i3.UuidValue? visibleValue; _i2.UuidValue? visibleValue;
/// The authoritative indicator and reason for an active projection override. /// The authoritative indicator and reason for an active projection override.
/// ///
@ -109,13 +110,13 @@ abstract class CrdtDataForeignKey implements _i1.TableRow<int?> {
/// Returns a shallow copy of this [CrdtDataForeignKey] /// Returns a shallow copy of this [CrdtDataForeignKey]
/// with some or all fields replaced by the given arguments. /// with some or all fields replaced by the given arguments.
@_i3.useResult @_i2.useResult
CrdtDataForeignKey copyWith({ CrdtDataForeignKey copyWith({
int? id, int? id,
_i2.CrdtDataField? field, _i3.CrdtDataField? field,
int? fieldId, int? fieldId,
_i3.UuidValue? attemptedValue, _i2.UuidValue? attemptedValue,
_i3.UuidValue? visibleValue, _i2.UuidValue? visibleValue,
_i4.CrdtForeignKeyOverrideReason? overrideReason, _i4.CrdtForeignKeyOverrideReason? overrideReason,
}); });
@override @override
@ -131,7 +132,20 @@ abstract class CrdtDataForeignKey implements _i1.TableRow<int?> {
}; };
} }
static CrdtDataForeignKeyInclude include({_i2.CrdtDataFieldInclude? field}) { @override
Map<String, dynamic> toJsonForProtocol() {
return {
'__className__': 'serverpod_offline_sync.CrdtDataForeignKey',
if (id != null) 'id': id,
if (field != null) 'field': field?.toJsonForProtocol(),
'fieldId': fieldId,
if (attemptedValue != null) 'attemptedValue': attemptedValue?.toJson(),
if (visibleValue != null) 'visibleValue': visibleValue?.toJson(),
if (overrideReason != null) 'overrideReason': overrideReason?.toJson(),
};
}
static CrdtDataForeignKeyInclude include({_i3.CrdtDataFieldInclude? field}) {
return CrdtDataForeignKeyInclude._(field: field); return CrdtDataForeignKeyInclude._(field: field);
} }
@ -140,8 +154,6 @@ abstract class CrdtDataForeignKey implements _i1.TableRow<int?> {
int? limit, int? limit,
int? offset, int? offset,
_i1.OrderByBuilder<CrdtDataForeignKeyTable>? orderBy, _i1.OrderByBuilder<CrdtDataForeignKeyTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i1.OrderByListBuilder<CrdtDataForeignKeyTable>? orderByList, _i1.OrderByListBuilder<CrdtDataForeignKeyTable>? orderByList,
CrdtDataForeignKeyInclude? include, CrdtDataForeignKeyInclude? include,
}) { }) {
@ -150,8 +162,6 @@ abstract class CrdtDataForeignKey implements _i1.TableRow<int?> {
limit: limit, limit: limit,
offset: offset, offset: offset,
orderBy: orderBy?.call(CrdtDataForeignKey.t), orderBy: orderBy?.call(CrdtDataForeignKey.t),
orderDescending: // ignore: deprecated_member_use_from_same_package
orderDescending,
orderByList: orderByList?.call(CrdtDataForeignKey.t), orderByList: orderByList?.call(CrdtDataForeignKey.t),
include: include, include: include,
); );
@ -159,7 +169,7 @@ abstract class CrdtDataForeignKey implements _i1.TableRow<int?> {
@override @override
String toString() { String toString() {
return _i3.SerializationManager.encode(this); return _i2.SerializationManager.encode(this);
} }
} }
@ -168,10 +178,10 @@ class _Undefined {}
class _CrdtDataForeignKeyImpl extends CrdtDataForeignKey { class _CrdtDataForeignKeyImpl extends CrdtDataForeignKey {
_CrdtDataForeignKeyImpl({ _CrdtDataForeignKeyImpl({
int? id, int? id,
_i2.CrdtDataField? field, _i3.CrdtDataField? field,
required int fieldId, required int fieldId,
required _i3.UuidValue? attemptedValue, required _i2.UuidValue? attemptedValue,
_i3.UuidValue? visibleValue, _i2.UuidValue? visibleValue,
_i4.CrdtForeignKeyOverrideReason? overrideReason, _i4.CrdtForeignKeyOverrideReason? overrideReason,
}) : super._( }) : super._(
id: id, id: id,
@ -184,7 +194,7 @@ class _CrdtDataForeignKeyImpl extends CrdtDataForeignKey {
/// Returns a shallow copy of this [CrdtDataForeignKey] /// Returns a shallow copy of this [CrdtDataForeignKey]
/// with some or all fields replaced by the given arguments. /// with some or all fields replaced by the given arguments.
@_i3.useResult @_i2.useResult
@override @override
CrdtDataForeignKey copyWith({ CrdtDataForeignKey copyWith({
Object? id = _Undefined, Object? id = _Undefined,
@ -196,12 +206,12 @@ class _CrdtDataForeignKeyImpl extends CrdtDataForeignKey {
}) { }) {
return CrdtDataForeignKey( return CrdtDataForeignKey(
id: id is int? ? id : this.id, id: id is int? ? id : this.id,
field: field is _i2.CrdtDataField? ? field : this.field?.copyWith(), field: field is _i3.CrdtDataField? ? field : this.field?.copyWith(),
fieldId: fieldId ?? this.fieldId, fieldId: fieldId ?? this.fieldId,
attemptedValue: attemptedValue is _i3.UuidValue? attemptedValue: attemptedValue is _i2.UuidValue?
? attemptedValue ? attemptedValue
: this.attemptedValue, : this.attemptedValue,
visibleValue: visibleValue is _i3.UuidValue? visibleValue: visibleValue is _i2.UuidValue?
? visibleValue ? visibleValue
: this.visibleValue, : this.visibleValue,
overrideReason: overrideReason is _i4.CrdtForeignKeyOverrideReason? overrideReason: overrideReason is _i4.CrdtForeignKeyOverrideReason?
@ -220,15 +230,15 @@ class CrdtDataForeignKeyUpdateTable
value, value,
); );
_i1.ColumnValue<_i3.UuidValue, _i3.UuidValue> attemptedValue( _i1.ColumnValue<_i2.UuidValue, _i2.UuidValue> attemptedValue(
_i3.UuidValue? value, _i2.UuidValue? value,
) => _i1.ColumnValue( ) => _i1.ColumnValue(
table.attemptedValue, table.attemptedValue,
value, value,
); );
_i1.ColumnValue<_i3.UuidValue, _i3.UuidValue> visibleValue( _i1.ColumnValue<_i2.UuidValue, _i2.UuidValue> visibleValue(
_i3.UuidValue? value, _i2.UuidValue? value,
) => _i1.ColumnValue( ) => _i1.ColumnValue(
table.visibleValue, table.visibleValue,
value, value,
@ -270,7 +280,7 @@ class CrdtDataForeignKeyTable extends _i1.Table<int?> {
late final CrdtDataForeignKeyUpdateTable updateTable; late final CrdtDataForeignKeyUpdateTable updateTable;
/// The field that the foreign key belongs to. /// The field that the foreign key belongs to.
_i2.CrdtDataFieldTable? _field; _i3.CrdtDataFieldTable? _field;
late final _i1.ColumnInt fieldId; late final _i1.ColumnInt fieldId;
@ -292,15 +302,15 @@ class CrdtDataForeignKeyTable extends _i1.Table<int?> {
/// row, field, and tombstone facts. /// row, field, and tombstone facts.
late final _i1.ColumnEnum<_i4.CrdtForeignKeyOverrideReason> overrideReason; late final _i1.ColumnEnum<_i4.CrdtForeignKeyOverrideReason> overrideReason;
_i2.CrdtDataFieldTable get field { _i3.CrdtDataFieldTable get field {
if (_field != null) return _field!; if (_field != null) return _field!;
_field = _i1.createRelationTable( _field = _i1.createRelationTable(
relationFieldName: 'field', relationFieldName: 'field',
field: CrdtDataForeignKey.t.fieldId, field: CrdtDataForeignKey.t.fieldId,
foreignField: _i2.CrdtDataField.t.id, foreignField: _i3.CrdtDataField.t.id,
tableRelation: tableRelation, tableRelation: tableRelation,
createTable: (foreignTableRelation) => createTable: (foreignTableRelation) =>
_i2.CrdtDataFieldTable(tableRelation: foreignTableRelation), _i3.CrdtDataFieldTable(tableRelation: foreignTableRelation),
); );
return _field!; return _field!;
} }
@ -324,11 +334,11 @@ class CrdtDataForeignKeyTable extends _i1.Table<int?> {
} }
class CrdtDataForeignKeyInclude extends _i1.IncludeObject { class CrdtDataForeignKeyInclude extends _i1.IncludeObject {
CrdtDataForeignKeyInclude._({_i2.CrdtDataFieldInclude? field}) { CrdtDataForeignKeyInclude._({_i3.CrdtDataFieldInclude? field}) {
_field = field; _field = field;
} }
_i2.CrdtDataFieldInclude? _field; _i3.CrdtDataFieldInclude? _field;
@override @override
Map<String, _i1.Include?> get includes => {'field': _field}; Map<String, _i1.Include?> get includes => {'field': _field};
@ -343,8 +353,6 @@ class CrdtDataForeignKeyIncludeList extends _i1.IncludeList {
super.limit, super.limit,
super.offset, super.offset,
super.orderBy, super.orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
super.orderDescending,
super.orderByList, super.orderByList,
super.include, super.include,
}) { }) {
@ -391,8 +399,6 @@ class CrdtDataForeignKeyRepository {
int? limit, int? limit,
int? offset, int? offset,
_i1.OrderByBuilder<CrdtDataForeignKeyTable>? orderBy, _i1.OrderByBuilder<CrdtDataForeignKeyTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i1.OrderByListBuilder<CrdtDataForeignKeyTable>? orderByList, _i1.OrderByListBuilder<CrdtDataForeignKeyTable>? orderByList,
_i1.Transaction? transaction, _i1.Transaction? transaction,
CrdtDataForeignKeyInclude? include, CrdtDataForeignKeyInclude? include,
@ -403,8 +409,6 @@ class CrdtDataForeignKeyRepository {
where: where?.call(CrdtDataForeignKey.t), where: where?.call(CrdtDataForeignKey.t),
orderBy: orderBy?.call(CrdtDataForeignKey.t), orderBy: orderBy?.call(CrdtDataForeignKey.t),
orderByList: orderByList?.call(CrdtDataForeignKey.t), orderByList: orderByList?.call(CrdtDataForeignKey.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
limit: limit, limit: limit,
offset: offset, offset: offset,
transaction: transaction, transaction: transaction,
@ -436,8 +440,6 @@ class CrdtDataForeignKeyRepository {
_i1.WhereExpressionBuilder<CrdtDataForeignKeyTable>? where, _i1.WhereExpressionBuilder<CrdtDataForeignKeyTable>? where,
int? offset, int? offset,
_i1.OrderByBuilder<CrdtDataForeignKeyTable>? orderBy, _i1.OrderByBuilder<CrdtDataForeignKeyTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i1.OrderByListBuilder<CrdtDataForeignKeyTable>? orderByList, _i1.OrderByListBuilder<CrdtDataForeignKeyTable>? orderByList,
_i1.Transaction? transaction, _i1.Transaction? transaction,
CrdtDataForeignKeyInclude? include, CrdtDataForeignKeyInclude? include,
@ -448,8 +450,6 @@ class CrdtDataForeignKeyRepository {
where: where?.call(CrdtDataForeignKey.t), where: where?.call(CrdtDataForeignKey.t),
orderBy: orderBy?.call(CrdtDataForeignKey.t), orderBy: orderBy?.call(CrdtDataForeignKey.t),
orderByList: orderByList?.call(CrdtDataForeignKey.t), orderByList: orderByList?.call(CrdtDataForeignKey.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
offset: offset, offset: offset,
transaction: transaction, transaction: transaction,
include: include, include: include,
@ -659,8 +659,6 @@ class CrdtDataForeignKeyRepository {
int? offset, int? offset,
_i1.OrderByBuilder<CrdtDataForeignKeyTable>? orderBy, _i1.OrderByBuilder<CrdtDataForeignKeyTable>? orderBy,
_i1.OrderByListBuilder<CrdtDataForeignKeyTable>? orderByList, _i1.OrderByListBuilder<CrdtDataForeignKeyTable>? orderByList,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i1.Transaction? transaction, _i1.Transaction? transaction,
bool noReturn = false, bool noReturn = false,
}) async { }) async {
@ -671,8 +669,6 @@ class CrdtDataForeignKeyRepository {
offset: offset, offset: offset,
orderBy: orderBy?.call(CrdtDataForeignKey.t), orderBy: orderBy?.call(CrdtDataForeignKey.t),
orderByList: orderByList?.call(CrdtDataForeignKey.t), orderByList: orderByList?.call(CrdtDataForeignKey.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -693,8 +689,6 @@ class CrdtDataForeignKeyRepository {
_i1.DatabaseSession session, _i1.DatabaseSession session,
List<CrdtDataForeignKey> rows, { List<CrdtDataForeignKey> rows, {
_i1.OrderByBuilder<CrdtDataForeignKeyTable>? orderBy, _i1.OrderByBuilder<CrdtDataForeignKeyTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i1.OrderByListBuilder<CrdtDataForeignKeyTable>? orderByList, _i1.OrderByListBuilder<CrdtDataForeignKeyTable>? orderByList,
_i1.Transaction? transaction, _i1.Transaction? transaction,
bool noReturn = false, bool noReturn = false,
@ -703,8 +697,6 @@ class CrdtDataForeignKeyRepository {
rows, rows,
orderBy: orderBy?.call(CrdtDataForeignKey.t), orderBy: orderBy?.call(CrdtDataForeignKey.t),
orderByList: orderByList?.call(CrdtDataForeignKey.t), orderByList: orderByList?.call(CrdtDataForeignKey.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -734,8 +726,6 @@ class CrdtDataForeignKeyRepository {
_i1.DatabaseSession session, { _i1.DatabaseSession session, {
required _i1.WhereExpressionBuilder<CrdtDataForeignKeyTable> where, required _i1.WhereExpressionBuilder<CrdtDataForeignKeyTable> where,
_i1.OrderByBuilder<CrdtDataForeignKeyTable>? orderBy, _i1.OrderByBuilder<CrdtDataForeignKeyTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i1.OrderByListBuilder<CrdtDataForeignKeyTable>? orderByList, _i1.OrderByListBuilder<CrdtDataForeignKeyTable>? orderByList,
_i1.Transaction? transaction, _i1.Transaction? transaction,
bool noReturn = false, bool noReturn = false,
@ -744,8 +734,6 @@ class CrdtDataForeignKeyRepository {
where: where(CrdtDataForeignKey.t), where: where(CrdtDataForeignKey.t),
orderBy: orderBy?.call(CrdtDataForeignKey.t), orderBy: orderBy?.call(CrdtDataForeignKey.t),
orderByList: orderByList?.call(CrdtDataForeignKey.t), orderByList: orderByList?.call(CrdtDataForeignKey.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -791,7 +779,7 @@ class CrdtDataForeignKeyAttachRowRepository {
Future<void> field( Future<void> field(
_i1.DatabaseSession session, _i1.DatabaseSession session,
CrdtDataForeignKey crdtDataForeignKey, CrdtDataForeignKey crdtDataForeignKey,
_i2.CrdtDataField field, { _i3.CrdtDataField field, {
_i1.Transaction? transaction, _i1.Transaction? transaction,
}) async { }) async {
if (crdtDataForeignKey.id == null) { if (crdtDataForeignKey.id == null) {

View file

@ -13,10 +13,10 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:serverpod_offline_sync/serverpod_offline_sync.dart' as _i1; import 'package:serverpod_offline_sync/serverpod_offline_sync.dart' as _i1;
import 'package:serverpod_database/serverpod_database.dart' as _i2; import 'package:serverpod_database/serverpod_database.dart' as _i2;
import '../data/row_visibility.dart' as _i3; import 'package:serverpod_client/serverpod_client.dart' as _i3;
import '../node/scope.dart' as _i4; import '../data/row_visibility.dart' as _i4;
import '../schema/table.dart' as _i5; import '../node/scope.dart' as _i5;
import 'package:serverpod_client/serverpod_client.dart' as _i6; import '../schema/table.dart' as _i6;
import '../node/node.dart' as _i7; import '../node/node.dart' as _i7;
import '../data/deleted.dart' as _i8; import '../data/deleted.dart' as _i8;
import '../data/field.dart' as _i9; import '../data/field.dart' as _i9;
@ -30,7 +30,8 @@ import 'package:serverpod_offline_sync_client/src/protocol/protocol.dart'
/// ///
/// The row is also the HLC timestamp for when it was inserted. This is used to /// The row is also the HLC timestamp for when it was inserted. This is used to
/// avoid creating one entry per field until a field is updated. /// avoid creating one entry per field until a field is updated.
abstract class CrdtDataRow extends _i1.BaseHlc implements _i2.TableRow<int?> { abstract class CrdtDataRow extends _i1.BaseHlc
implements _i2.TableRow<int?>, _i3.ProtocolSerialization {
CrdtDataRow._({ CrdtDataRow._({
this.id, this.id,
required super.hlcDatetime, required super.hlcDatetime,
@ -42,23 +43,23 @@ abstract class CrdtDataRow extends _i1.BaseHlc implements _i2.TableRow<int?> {
required this.uuidRowId, required this.uuidRowId,
required this.nodeId, required this.nodeId,
this.node, this.node,
_i3.CrdtDataRowVisibility? visibility, _i4.CrdtDataRowVisibility? visibility,
this.deleted, this.deleted,
this.fields, this.fields,
}) : visibility = visibility ?? _i3.CrdtDataRowVisibility.userInsert; }) : visibility = visibility ?? _i4.CrdtDataRowVisibility.userInsert;
factory CrdtDataRow({ factory CrdtDataRow({
int? id, int? id,
required DateTime hlcDatetime, required DateTime hlcDatetime,
required int hlcCounter, required int hlcCounter,
required int scopeId, required int scopeId,
_i4.CrdtScope? scope, _i5.CrdtScope? scope,
required int tblId, required int tblId,
_i5.CrdtSchemaTable? tbl, _i6.CrdtSchemaTable? tbl,
required _i6.UuidValue uuidRowId, required _i3.UuidValue uuidRowId,
required int nodeId, required int nodeId,
_i7.CrdtNode? node, _i7.CrdtNode? node,
_i3.CrdtDataRowVisibility? visibility, _i4.CrdtDataRowVisibility? visibility,
_i8.CrdtDataDeleted? deleted, _i8.CrdtDataDeleted? deleted,
List<_i9.CrdtDataField>? fields, List<_i9.CrdtDataField>? fields,
}) = _CrdtDataRowImpl; }) = _CrdtDataRowImpl;
@ -66,23 +67,23 @@ abstract class CrdtDataRow extends _i1.BaseHlc implements _i2.TableRow<int?> {
factory CrdtDataRow.fromJson(Map<String, dynamic> jsonSerialization) { factory CrdtDataRow.fromJson(Map<String, dynamic> jsonSerialization) {
return CrdtDataRow( return CrdtDataRow(
id: jsonSerialization['id'] as int?, id: jsonSerialization['id'] as int?,
hlcDatetime: _i6.DateTimeJsonExtension.fromJson( hlcDatetime: _i3.DateTimeJsonExtension.fromJson(
jsonSerialization['hlcDatetime'], jsonSerialization['hlcDatetime'],
), ),
hlcCounter: jsonSerialization['hlcCounter'] as int, hlcCounter: jsonSerialization['hlcCounter'] as int,
scopeId: jsonSerialization['scopeId'] as int, scopeId: jsonSerialization['scopeId'] as int,
scope: jsonSerialization['scope'] == null scope: jsonSerialization['scope'] == null
? null ? null
: _i10.Protocol().deserialize<_i4.CrdtScope>( : _i10.Protocol().deserialize<_i5.CrdtScope>(
jsonSerialization['scope'], jsonSerialization['scope'],
), ),
tblId: jsonSerialization['tblId'] as int, tblId: jsonSerialization['tblId'] as int,
tbl: jsonSerialization['tbl'] == null tbl: jsonSerialization['tbl'] == null
? null ? null
: _i10.Protocol().deserialize<_i5.CrdtSchemaTable>( : _i10.Protocol().deserialize<_i6.CrdtSchemaTable>(
jsonSerialization['tbl'], jsonSerialization['tbl'],
), ),
uuidRowId: _i6.UuidValueJsonExtension.fromJson( uuidRowId: _i3.UuidValueJsonExtension.fromJson(
jsonSerialization['uuidRowId'], jsonSerialization['uuidRowId'],
), ),
nodeId: jsonSerialization['nodeId'] as int, nodeId: jsonSerialization['nodeId'] as int,
@ -93,7 +94,7 @@ abstract class CrdtDataRow extends _i1.BaseHlc implements _i2.TableRow<int?> {
), ),
visibility: jsonSerialization['visibility'] == null visibility: jsonSerialization['visibility'] == null
? null ? null
: _i3.CrdtDataRowVisibility.fromJson( : _i4.CrdtDataRowVisibility.fromJson(
(jsonSerialization['visibility'] as int), (jsonSerialization['visibility'] as int),
), ),
deleted: jsonSerialization['deleted'] == null deleted: jsonSerialization['deleted'] == null
@ -119,15 +120,15 @@ abstract class CrdtDataRow extends _i1.BaseHlc implements _i2.TableRow<int?> {
int scopeId; int scopeId;
/// Identifier for the scope that owns the data. /// Identifier for the scope that owns the data.
_i4.CrdtScope? scope; _i5.CrdtScope? scope;
int tblId; int tblId;
/// Reference to the table this row belongs to. /// Reference to the table this row belongs to.
_i5.CrdtSchemaTable? tbl; _i6.CrdtSchemaTable? tbl;
/// Row identifier. /// Row identifier.
_i6.UuidValue uuidRowId; _i3.UuidValue uuidRowId;
int nodeId; int nodeId;
@ -138,7 +139,7 @@ abstract class CrdtDataRow extends _i1.BaseHlc implements _i2.TableRow<int?> {
/// ///
/// Updated by user tombstone writes and foreign key projection. Visible /// Updated by user tombstone writes and foreign key projection. Visible
/// states are listed before hidden states in CrdtDataRowVisibility. /// states are listed before hidden states in CrdtDataRowVisibility.
_i3.CrdtDataRowVisibility visibility; _i4.CrdtDataRowVisibility visibility;
/// The synced user tombstone for this row. /// The synced user tombstone for this row.
/// ///
@ -155,19 +156,19 @@ abstract class CrdtDataRow extends _i1.BaseHlc implements _i2.TableRow<int?> {
/// Returns a shallow copy of this [CrdtDataRow] /// Returns a shallow copy of this [CrdtDataRow]
/// with some or all fields replaced by the given arguments. /// with some or all fields replaced by the given arguments.
@override @override
@_i6.useResult @_i3.useResult
CrdtDataRow copyWith({ CrdtDataRow copyWith({
int? id, int? id,
DateTime? hlcDatetime, DateTime? hlcDatetime,
int? hlcCounter, int? hlcCounter,
int? scopeId, int? scopeId,
_i4.CrdtScope? scope, _i5.CrdtScope? scope,
int? tblId, int? tblId,
_i5.CrdtSchemaTable? tbl, _i6.CrdtSchemaTable? tbl,
_i6.UuidValue? uuidRowId, _i3.UuidValue? uuidRowId,
int? nodeId, int? nodeId,
_i7.CrdtNode? node, _i7.CrdtNode? node,
_i3.CrdtDataRowVisibility? visibility, _i4.CrdtDataRowVisibility? visibility,
_i8.CrdtDataDeleted? deleted, _i8.CrdtDataDeleted? deleted,
List<_i9.CrdtDataField>? fields, List<_i9.CrdtDataField>? fields,
}); });
@ -192,9 +193,30 @@ abstract class CrdtDataRow extends _i1.BaseHlc implements _i2.TableRow<int?> {
}; };
} }
@override
Map<String, dynamic> toJsonForProtocol() {
return {
'__className__': 'serverpod_offline_sync.CrdtDataRow',
if (id != null) 'id': id,
'hlcDatetime': hlcDatetime.toJson(),
'hlcCounter': hlcCounter,
'scopeId': scopeId,
if (scope != null) 'scope': scope?.toJsonForProtocol(),
'tblId': tblId,
if (tbl != null) 'tbl': tbl?.toJsonForProtocol(),
'uuidRowId': uuidRowId.toJson(),
'nodeId': nodeId,
if (node != null) 'node': node?.toJsonForProtocol(),
'visibility': visibility.toJson(),
if (deleted != null) 'deleted': deleted?.toJsonForProtocol(),
if (fields != null)
'fields': fields?.toJson(valueToJson: (v) => v.toJsonForProtocol()),
};
}
static CrdtDataRowInclude include({ static CrdtDataRowInclude include({
_i4.CrdtScopeInclude? scope, _i5.CrdtScopeInclude? scope,
_i5.CrdtSchemaTableInclude? tbl, _i6.CrdtSchemaTableInclude? tbl,
_i7.CrdtNodeInclude? node, _i7.CrdtNodeInclude? node,
_i8.CrdtDataDeletedInclude? deleted, _i8.CrdtDataDeletedInclude? deleted,
_i9.CrdtDataFieldIncludeList? fields, _i9.CrdtDataFieldIncludeList? fields,
@ -213,8 +235,6 @@ abstract class CrdtDataRow extends _i1.BaseHlc implements _i2.TableRow<int?> {
int? limit, int? limit,
int? offset, int? offset,
_i2.OrderByBuilder<CrdtDataRowTable>? orderBy, _i2.OrderByBuilder<CrdtDataRowTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataRowTable>? orderByList, _i2.OrderByListBuilder<CrdtDataRowTable>? orderByList,
CrdtDataRowInclude? include, CrdtDataRowInclude? include,
}) { }) {
@ -223,8 +243,6 @@ abstract class CrdtDataRow extends _i1.BaseHlc implements _i2.TableRow<int?> {
limit: limit, limit: limit,
offset: offset, offset: offset,
orderBy: orderBy?.call(CrdtDataRow.t), orderBy: orderBy?.call(CrdtDataRow.t),
orderDescending: // ignore: deprecated_member_use_from_same_package
orderDescending,
orderByList: orderByList?.call(CrdtDataRow.t), orderByList: orderByList?.call(CrdtDataRow.t),
include: include, include: include,
); );
@ -232,7 +250,7 @@ abstract class CrdtDataRow extends _i1.BaseHlc implements _i2.TableRow<int?> {
@override @override
String toString() { String toString() {
return _i6.SerializationManager.encode(this); return _i3.SerializationManager.encode(this);
} }
} }
@ -244,13 +262,13 @@ class _CrdtDataRowImpl extends CrdtDataRow {
required DateTime hlcDatetime, required DateTime hlcDatetime,
required int hlcCounter, required int hlcCounter,
required int scopeId, required int scopeId,
_i4.CrdtScope? scope, _i5.CrdtScope? scope,
required int tblId, required int tblId,
_i5.CrdtSchemaTable? tbl, _i6.CrdtSchemaTable? tbl,
required _i6.UuidValue uuidRowId, required _i3.UuidValue uuidRowId,
required int nodeId, required int nodeId,
_i7.CrdtNode? node, _i7.CrdtNode? node,
_i3.CrdtDataRowVisibility? visibility, _i4.CrdtDataRowVisibility? visibility,
_i8.CrdtDataDeleted? deleted, _i8.CrdtDataDeleted? deleted,
List<_i9.CrdtDataField>? fields, List<_i9.CrdtDataField>? fields,
}) : super._( }) : super._(
@ -271,7 +289,7 @@ class _CrdtDataRowImpl extends CrdtDataRow {
/// Returns a shallow copy of this [CrdtDataRow] /// Returns a shallow copy of this [CrdtDataRow]
/// with some or all fields replaced by the given arguments. /// with some or all fields replaced by the given arguments.
@_i6.useResult @_i3.useResult
@override @override
CrdtDataRow copyWith({ CrdtDataRow copyWith({
Object? id = _Undefined, Object? id = _Undefined,
@ -281,10 +299,10 @@ class _CrdtDataRowImpl extends CrdtDataRow {
Object? scope = _Undefined, Object? scope = _Undefined,
int? tblId, int? tblId,
Object? tbl = _Undefined, Object? tbl = _Undefined,
_i6.UuidValue? uuidRowId, _i3.UuidValue? uuidRowId,
int? nodeId, int? nodeId,
Object? node = _Undefined, Object? node = _Undefined,
_i3.CrdtDataRowVisibility? visibility, _i4.CrdtDataRowVisibility? visibility,
Object? deleted = _Undefined, Object? deleted = _Undefined,
Object? fields = _Undefined, Object? fields = _Undefined,
}) { }) {
@ -293,9 +311,9 @@ class _CrdtDataRowImpl extends CrdtDataRow {
hlcDatetime: hlcDatetime ?? this.hlcDatetime, hlcDatetime: hlcDatetime ?? this.hlcDatetime,
hlcCounter: hlcCounter ?? this.hlcCounter, hlcCounter: hlcCounter ?? this.hlcCounter,
scopeId: scopeId ?? this.scopeId, scopeId: scopeId ?? this.scopeId,
scope: scope is _i4.CrdtScope? ? scope : this.scope?.copyWith(), scope: scope is _i5.CrdtScope? ? scope : this.scope?.copyWith(),
tblId: tblId ?? this.tblId, tblId: tblId ?? this.tblId,
tbl: tbl is _i5.CrdtSchemaTable? ? tbl : this.tbl?.copyWith(), tbl: tbl is _i6.CrdtSchemaTable? ? tbl : this.tbl?.copyWith(),
uuidRowId: uuidRowId ?? this.uuidRowId, uuidRowId: uuidRowId ?? this.uuidRowId,
nodeId: nodeId ?? this.nodeId, nodeId: nodeId ?? this.nodeId,
node: node is _i7.CrdtNode? ? node : this.node?.copyWith(), node: node is _i7.CrdtNode? ? node : this.node?.copyWith(),
@ -334,8 +352,8 @@ class CrdtDataRowUpdateTable extends _i2.UpdateTable<CrdtDataRowTable> {
value, value,
); );
_i2.ColumnValue<_i6.UuidValue, _i6.UuidValue> uuidRowId( _i2.ColumnValue<_i3.UuidValue, _i3.UuidValue> uuidRowId(
_i6.UuidValue value, _i3.UuidValue value,
) => _i2.ColumnValue( ) => _i2.ColumnValue(
table.uuidRowId, table.uuidRowId,
value, value,
@ -346,8 +364,8 @@ class CrdtDataRowUpdateTable extends _i2.UpdateTable<CrdtDataRowTable> {
value, value,
); );
_i2.ColumnValue<_i3.CrdtDataRowVisibility, _i3.CrdtDataRowVisibility> _i2.ColumnValue<_i4.CrdtDataRowVisibility, _i4.CrdtDataRowVisibility>
visibility(_i3.CrdtDataRowVisibility value) => _i2.ColumnValue( visibility(_i4.CrdtDataRowVisibility value) => _i2.ColumnValue(
table.visibility, table.visibility,
value, value,
); );
@ -399,12 +417,12 @@ class CrdtDataRowTable extends _i2.Table<int?> {
late final _i2.ColumnInt scopeId; late final _i2.ColumnInt scopeId;
/// Identifier for the scope that owns the data. /// Identifier for the scope that owns the data.
_i4.CrdtScopeTable? _scope; _i5.CrdtScopeTable? _scope;
late final _i2.ColumnInt tblId; late final _i2.ColumnInt tblId;
/// Reference to the table this row belongs to. /// Reference to the table this row belongs to.
_i5.CrdtSchemaTableTable? _tbl; _i6.CrdtSchemaTableTable? _tbl;
/// Row identifier. /// Row identifier.
late final _i2.ColumnUuid uuidRowId; late final _i2.ColumnUuid uuidRowId;
@ -418,7 +436,7 @@ class CrdtDataRowTable extends _i2.Table<int?> {
/// ///
/// Updated by user tombstone writes and foreign key projection. Visible /// Updated by user tombstone writes and foreign key projection. Visible
/// states are listed before hidden states in CrdtDataRowVisibility. /// states are listed before hidden states in CrdtDataRowVisibility.
late final _i2.ColumnEnum<_i3.CrdtDataRowVisibility> visibility; late final _i2.ColumnEnum<_i4.CrdtDataRowVisibility> visibility;
/// The synced user tombstone for this row. /// The synced user tombstone for this row.
/// ///
@ -432,28 +450,28 @@ class CrdtDataRowTable extends _i2.Table<int?> {
/// The fields for this row. /// The fields for this row.
_i2.ManyRelation<_i9.CrdtDataFieldTable>? _fields; _i2.ManyRelation<_i9.CrdtDataFieldTable>? _fields;
_i4.CrdtScopeTable get scope { _i5.CrdtScopeTable get scope {
if (_scope != null) return _scope!; if (_scope != null) return _scope!;
_scope = _i2.createRelationTable( _scope = _i2.createRelationTable(
relationFieldName: 'scope', relationFieldName: 'scope',
field: CrdtDataRow.t.scopeId, field: CrdtDataRow.t.scopeId,
foreignField: _i4.CrdtScope.t.id, foreignField: _i5.CrdtScope.t.id,
tableRelation: tableRelation, tableRelation: tableRelation,
createTable: (foreignTableRelation) => createTable: (foreignTableRelation) =>
_i4.CrdtScopeTable(tableRelation: foreignTableRelation), _i5.CrdtScopeTable(tableRelation: foreignTableRelation),
); );
return _scope!; return _scope!;
} }
_i5.CrdtSchemaTableTable get tbl { _i6.CrdtSchemaTableTable get tbl {
if (_tbl != null) return _tbl!; if (_tbl != null) return _tbl!;
_tbl = _i2.createRelationTable( _tbl = _i2.createRelationTable(
relationFieldName: 'tbl', relationFieldName: 'tbl',
field: CrdtDataRow.t.tblId, field: CrdtDataRow.t.tblId,
foreignField: _i5.CrdtSchemaTable.t.id, foreignField: _i6.CrdtSchemaTable.t.id,
tableRelation: tableRelation, tableRelation: tableRelation,
createTable: (foreignTableRelation) => createTable: (foreignTableRelation) =>
_i5.CrdtSchemaTableTable(tableRelation: foreignTableRelation), _i6.CrdtSchemaTableTable(tableRelation: foreignTableRelation),
); );
return _tbl!; return _tbl!;
} }
@ -551,8 +569,8 @@ class CrdtDataRowTable extends _i2.Table<int?> {
class CrdtDataRowInclude extends _i2.IncludeObject { class CrdtDataRowInclude extends _i2.IncludeObject {
CrdtDataRowInclude._({ CrdtDataRowInclude._({
_i4.CrdtScopeInclude? scope, _i5.CrdtScopeInclude? scope,
_i5.CrdtSchemaTableInclude? tbl, _i6.CrdtSchemaTableInclude? tbl,
_i7.CrdtNodeInclude? node, _i7.CrdtNodeInclude? node,
_i8.CrdtDataDeletedInclude? deleted, _i8.CrdtDataDeletedInclude? deleted,
_i9.CrdtDataFieldIncludeList? fields, _i9.CrdtDataFieldIncludeList? fields,
@ -564,9 +582,9 @@ class CrdtDataRowInclude extends _i2.IncludeObject {
_fields = fields; _fields = fields;
} }
_i4.CrdtScopeInclude? _scope; _i5.CrdtScopeInclude? _scope;
_i5.CrdtSchemaTableInclude? _tbl; _i6.CrdtSchemaTableInclude? _tbl;
_i7.CrdtNodeInclude? _node; _i7.CrdtNodeInclude? _node;
@ -593,8 +611,6 @@ class CrdtDataRowIncludeList extends _i2.IncludeList {
super.limit, super.limit,
super.offset, super.offset,
super.orderBy, super.orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
super.orderDescending,
super.orderByList, super.orderByList,
super.include, super.include,
}) { }) {
@ -643,8 +659,6 @@ class CrdtDataRowRepository {
int? limit, int? limit,
int? offset, int? offset,
_i2.OrderByBuilder<CrdtDataRowTable>? orderBy, _i2.OrderByBuilder<CrdtDataRowTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataRowTable>? orderByList, _i2.OrderByListBuilder<CrdtDataRowTable>? orderByList,
_i2.Transaction? transaction, _i2.Transaction? transaction,
CrdtDataRowInclude? include, CrdtDataRowInclude? include,
@ -655,8 +669,6 @@ class CrdtDataRowRepository {
where: where?.call(CrdtDataRow.t), where: where?.call(CrdtDataRow.t),
orderBy: orderBy?.call(CrdtDataRow.t), orderBy: orderBy?.call(CrdtDataRow.t),
orderByList: orderByList?.call(CrdtDataRow.t), orderByList: orderByList?.call(CrdtDataRow.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
limit: limit, limit: limit,
offset: offset, offset: offset,
transaction: transaction, transaction: transaction,
@ -688,8 +700,6 @@ class CrdtDataRowRepository {
_i2.WhereExpressionBuilder<CrdtDataRowTable>? where, _i2.WhereExpressionBuilder<CrdtDataRowTable>? where,
int? offset, int? offset,
_i2.OrderByBuilder<CrdtDataRowTable>? orderBy, _i2.OrderByBuilder<CrdtDataRowTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataRowTable>? orderByList, _i2.OrderByListBuilder<CrdtDataRowTable>? orderByList,
_i2.Transaction? transaction, _i2.Transaction? transaction,
CrdtDataRowInclude? include, CrdtDataRowInclude? include,
@ -700,8 +710,6 @@ class CrdtDataRowRepository {
where: where?.call(CrdtDataRow.t), where: where?.call(CrdtDataRow.t),
orderBy: orderBy?.call(CrdtDataRow.t), orderBy: orderBy?.call(CrdtDataRow.t),
orderByList: orderByList?.call(CrdtDataRow.t), orderByList: orderByList?.call(CrdtDataRow.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
offset: offset, offset: offset,
transaction: transaction, transaction: transaction,
include: include, include: include,
@ -909,8 +917,6 @@ class CrdtDataRowRepository {
int? offset, int? offset,
_i2.OrderByBuilder<CrdtDataRowTable>? orderBy, _i2.OrderByBuilder<CrdtDataRowTable>? orderBy,
_i2.OrderByListBuilder<CrdtDataRowTable>? orderByList, _i2.OrderByListBuilder<CrdtDataRowTable>? orderByList,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.Transaction? transaction, _i2.Transaction? transaction,
bool noReturn = false, bool noReturn = false,
}) async { }) async {
@ -921,8 +927,6 @@ class CrdtDataRowRepository {
offset: offset, offset: offset,
orderBy: orderBy?.call(CrdtDataRow.t), orderBy: orderBy?.call(CrdtDataRow.t),
orderByList: orderByList?.call(CrdtDataRow.t), orderByList: orderByList?.call(CrdtDataRow.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -943,8 +947,6 @@ class CrdtDataRowRepository {
_i2.DatabaseSession session, _i2.DatabaseSession session,
List<CrdtDataRow> rows, { List<CrdtDataRow> rows, {
_i2.OrderByBuilder<CrdtDataRowTable>? orderBy, _i2.OrderByBuilder<CrdtDataRowTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataRowTable>? orderByList, _i2.OrderByListBuilder<CrdtDataRowTable>? orderByList,
_i2.Transaction? transaction, _i2.Transaction? transaction,
bool noReturn = false, bool noReturn = false,
@ -953,8 +955,6 @@ class CrdtDataRowRepository {
rows, rows,
orderBy: orderBy?.call(CrdtDataRow.t), orderBy: orderBy?.call(CrdtDataRow.t),
orderByList: orderByList?.call(CrdtDataRow.t), orderByList: orderByList?.call(CrdtDataRow.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -984,8 +984,6 @@ class CrdtDataRowRepository {
_i2.DatabaseSession session, { _i2.DatabaseSession session, {
required _i2.WhereExpressionBuilder<CrdtDataRowTable> where, required _i2.WhereExpressionBuilder<CrdtDataRowTable> where,
_i2.OrderByBuilder<CrdtDataRowTable>? orderBy, _i2.OrderByBuilder<CrdtDataRowTable>? orderBy,
@Deprecated('Use desc() on the orderBy column instead.')
bool orderDescending = false,
_i2.OrderByListBuilder<CrdtDataRowTable>? orderByList, _i2.OrderByListBuilder<CrdtDataRowTable>? orderByList,
_i2.Transaction? transaction, _i2.Transaction? transaction,
bool noReturn = false, bool noReturn = false,
@ -994,8 +992,6 @@ class CrdtDataRowRepository {
where: where(CrdtDataRow.t), where: where(CrdtDataRow.t),
orderBy: orderBy?.call(CrdtDataRow.t), orderBy: orderBy?.call(CrdtDataRow.t),
orderByList: orderByList?.call(CrdtDataRow.t), orderByList: orderByList?.call(CrdtDataRow.t),
orderDescending: // ignore: deprecated_member_use
orderDescending,
transaction: transaction, transaction: transaction,
noReturn: noReturn, noReturn: noReturn,
); );
@ -1070,7 +1066,7 @@ class CrdtDataRowAttachRowRepository {
Future<void> scope( Future<void> scope(
_i2.DatabaseSession session, _i2.DatabaseSession session,
CrdtDataRow crdtDataRow, CrdtDataRow crdtDataRow,
_i4.CrdtScope scope, { _i5.CrdtScope scope, {
_i2.Transaction? transaction, _i2.Transaction? transaction,
}) async { }) async {
if (crdtDataRow.id == null) { if (crdtDataRow.id == null) {
@ -1093,7 +1089,7 @@ class CrdtDataRowAttachRowRepository {
Future<void> tbl( Future<void> tbl(
_i2.DatabaseSession session, _i2.DatabaseSession session,
CrdtDataRow crdtDataRow, CrdtDataRow crdtDataRow,
_i5.CrdtSchemaTable tbl, { _i6.CrdtSchemaTable tbl, {
_i2.Transaction? transaction, _i2.Transaction? transaction,
}) async { }) async {
if (crdtDataRow.id == null) { if (crdtDataRow.id == null) {

Some files were not shown because too many files have changed in this diff Show more