MssqlRelationMutation<TParent, TChild> class

Explicit writes against one relation of one parent row.

Not a change tracker and not a cascade: create fills the foreign key on insert, associate / dissociate rewrite declared key columns, and attach / detach / sync speak only to a declared pivot. Target rows that are not the parent are never deleted here — a missing counterpart after detach is a dangling child the caller still owns.

Annotations
  • @immutable

Constructors

MssqlRelationMutation({required MssqlSession session, required MssqlDialect dialect, required MssqlClock clock, required MssqlTableBinding<TParent> parentBinding, required TParent parent, required MssqlRelation<TParent, TChild> relation, MssqlScopeSelection scope = const MssqlScopeSelection.empty(), MssqlChangeHub? changes})

Properties

changes MssqlChangeHub?
final
clock MssqlClock
final
dialect MssqlDialect
final
hashCode int
The hash code for this object.
no setterinherited
parent → TParent
final
parentBinding MssqlTableBinding<TParent>
final
relation MssqlRelation<TParent, TChild>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scope MssqlScopeSelection
final
session → MssqlSession
final

Methods

associate(TChild related) Future<void>
Points this parent at related, or related at this parent.
attach(TChild related, {Map<String, Object?> pivot = const <String, Object?>{}}) Future<void>
Inserts a pivot row linking related to this parent.
copy(MssqlSession session) MssqlRelationMutation<TParent, TChild>
This mutation against another session, for a transaction body.
create(TChild child, {Map<String, Object?> pivot = const <String, Object?>{}}) Future<TChild>
Inserts child with this parent's key written onto the foreign key.
detach(TChild related) Future<void>
Removes the pivot row for related. The target row stays.
detachAll() Future<void>
Removes every pivot row for this parent. Target rows stay.
dissociate({TChild? related}) Future<void>
Clears the declared foreign key. Does not delete any row.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sync(Iterable<TChild> related, {bool detaching = true}) Future<void>
Makes the pivot match related and nothing else.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited