chore: Bump version to 0.0.2 and update CHANGELOG (#111)
This commit is contained in:
parent
1ddfef2988
commit
c04bde5e6f
9 changed files with 177 additions and 238 deletions
|
|
@ -18,7 +18,7 @@ enum CrdtDataDeletedReason implements _i1.SerializableModel {
|
|||
userReinsert,
|
||||
userDelete,
|
||||
userCascadeDelete,
|
||||
uniqueLoser
|
||||
uniqueLoser,
|
||||
;
|
||||
|
||||
static CrdtDataDeletedReason fromJson(int index) {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ enum CrdtForeignKeyOverrideReason implements _i1.SerializableModel {
|
|||
/// cannot repair the value (restrict, no action, cascade, or the column is
|
||||
/// non-nullable), so the row is hidden by projection while the attempt is
|
||||
/// preserved.
|
||||
missingParent
|
||||
missingParent,
|
||||
;
|
||||
|
||||
static CrdtForeignKeyOverrideReason fromJson(int index) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ enum CrdtDataRowVisibility implements _i1.SerializableModel {
|
|||
foreignKeyRestrictRestore,
|
||||
userDelete,
|
||||
userCascadeDelete,
|
||||
foreignKeyCascade
|
||||
foreignKeyCascade,
|
||||
;
|
||||
|
||||
static CrdtDataRowVisibility fromJson(int index) {
|
||||
|
|
|
|||
|
|
@ -350,8 +350,6 @@ class CrdtScopeRepository {
|
|||
|
||||
final attachRow = const CrdtScopeAttachRowRepository._();
|
||||
|
||||
final detach = const CrdtScopeDetachRepository._();
|
||||
|
||||
final detachRow = const CrdtScopeDetachRowRepository._();
|
||||
|
||||
/// Returns a list of [CrdtScope]s matching the given query parameters.
|
||||
|
|
@ -831,34 +829,6 @@ class CrdtScopeAttachRowRepository {
|
|||
}
|
||||
}
|
||||
|
||||
class CrdtScopeDetachRepository {
|
||||
const CrdtScopeDetachRepository._();
|
||||
|
||||
/// Detaches the relation between this [CrdtScope] and the given [CrdtScopeNode]
|
||||
/// by setting the [CrdtScopeNode]'s foreign key `scopeId` to `null`.
|
||||
///
|
||||
/// This removes the association between the two models without deleting
|
||||
/// the related record.
|
||||
Future<void> nodes(
|
||||
_i1.DatabaseSession session,
|
||||
List<_i3.CrdtScopeNode> crdtScopeNode, {
|
||||
_i1.Transaction? transaction,
|
||||
}) async {
|
||||
if (crdtScopeNode.any((e) => e.id == null)) {
|
||||
throw ArgumentError.notNull('crdtScopeNode.id');
|
||||
}
|
||||
|
||||
var $crdtScopeNode = crdtScopeNode
|
||||
.map((e) => e.copyWith(scopeId: null))
|
||||
.toList();
|
||||
await session.db.update<_i3.CrdtScopeNode>(
|
||||
$crdtScopeNode,
|
||||
columns: [_i3.CrdtScopeNode.t.scopeId],
|
||||
transaction: transaction,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CrdtScopeDetachRowRepository {
|
||||
const CrdtScopeDetachRowRepository._();
|
||||
|
||||
|
|
@ -883,26 +853,4 @@ class CrdtScopeDetachRowRepository {
|
|||
transaction: transaction,
|
||||
);
|
||||
}
|
||||
|
||||
/// Detaches the relation between this [CrdtScope] and the given [CrdtScopeNode]
|
||||
/// by setting the [CrdtScopeNode]'s foreign key `scopeId` to `null`.
|
||||
///
|
||||
/// This removes the association between the two models without deleting
|
||||
/// the related record.
|
||||
Future<void> nodes(
|
||||
_i1.DatabaseSession session,
|
||||
_i3.CrdtScopeNode crdtScopeNode, {
|
||||
_i1.Transaction? transaction,
|
||||
}) async {
|
||||
if (crdtScopeNode.id == null) {
|
||||
throw ArgumentError.notNull('crdtScopeNode.id');
|
||||
}
|
||||
|
||||
var $crdtScopeNode = crdtScopeNode.copyWith(scopeId: null);
|
||||
await session.db.updateRow<_i3.CrdtScopeNode>(
|
||||
$crdtScopeNode,
|
||||
columns: [_i3.CrdtScopeNode.t.scopeId],
|
||||
transaction: transaction,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import 'package:serverpod_serialization/serverpod_serialization.dart' as _i1;
|
|||
/// The role gates CRDT writes only. Reads remain membership-wide.
|
||||
enum CrdtScopeRole implements _i1.SerializableModel {
|
||||
readOnly,
|
||||
readWrite
|
||||
readWrite,
|
||||
;
|
||||
|
||||
static CrdtScopeRole fromJson(String name) {
|
||||
|
|
|
|||
|
|
@ -64,7 +64,9 @@ class Protocol extends _i1.DatabaseSerializationManager {
|
|||
|
||||
static final Protocol _instance = Protocol._();
|
||||
|
||||
static final List<_i1.TableDefinition> targetTableDefinitions = [
|
||||
final Set<_i2.SerializationManager> _hostProtocols = {};
|
||||
|
||||
static List<_i1.TableDefinition> get targetTableDefinitions => [
|
||||
_i1.TableDefinition(
|
||||
name: 'crdt_data_fields',
|
||||
dartName: 'CrdtDataField',
|
||||
|
|
@ -904,8 +906,6 @@ class Protocol extends _i1.DatabaseSerializationManager {
|
|||
),
|
||||
];
|
||||
|
||||
final Set<_i2.SerializationManager> _hostProtocols = {};
|
||||
|
||||
void registerHostProtocol(
|
||||
String projectName,
|
||||
_i2.SerializationManager protocol,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ enum CrdtSyncViolationOperation implements _i1.SerializableModel {
|
|||
mergeDelete,
|
||||
outboundInsert,
|
||||
outboundUpdate,
|
||||
outboundDelete
|
||||
outboundDelete,
|
||||
;
|
||||
|
||||
static CrdtSyncViolationOperation fromJson(String name) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import 'package:serverpod_serialization/serverpod_serialization.dart' as _i1;
|
|||
enum CrdtSyncViolationType implements _i1.SerializableModel {
|
||||
ownershipCollision,
|
||||
missingDomainRow,
|
||||
unauthorizedWrite
|
||||
unauthorizedWrite,
|
||||
;
|
||||
|
||||
static CrdtSyncViolationType fromJson(String name) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
name: serverpod_offline_sync
|
||||
version: 0.0.1
|
||||
version: 0.0.2
|
||||
description: Shared package for the Serverpod Offline Sync project.
|
||||
homepage: https://github.com/marcelomendoncasoares/serverpod_offline_sync
|
||||
|
||||
|
|
@ -11,8 +11,8 @@ resolution: workspace
|
|||
dependencies:
|
||||
clock: ^1.1.2
|
||||
meta: ^1.18.0
|
||||
serverpod_database: 4.0.0-beta.1
|
||||
serverpod_serialization: 4.0.0-beta.1
|
||||
serverpod_database: 4.0.0-beta.2
|
||||
serverpod_serialization: 4.0.0-beta.2
|
||||
uuid: ^4.5.3
|
||||
|
||||
dev_dependencies:
|
||||
|
|
|
|||
Loading…
Reference in a new issue