InstanceDatabaseOps<T extends Model> mixin

Instance-level persistence helpers for Model types.

This mixin forwards instance operations (save, update, delete) to the static Archery ORM functions while respecting the model's configured disk (or an explicitly provided disk override).

Superclass constraints
Mixin applications
Available extensions

Properties

createdAt DateTime?
Creation timestamp (UTC).
getter/setter pairinherited
disk DatabaseDisk
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
id int?
Primary key (auto-incremented by backend).
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
updatedAt DateTime?
Last update timestamp (UTC).
getter/setter pairinherited
uuid String?
UUID for cross-backend identification.
getter/setter pairinherited

Methods

attach(Model sibling, {required ModelRelationshipType relationship, PivotTable<Model, Model>? table, DatabaseDisk disk = Model.defaultDisk}) Future<bool>

Available on Model, provided by the ModelRelationshipOps extension

Attaches sibling to this model using the given relationship type.
belongsToMany<T extends Model>({required PivotTable<Model, Model> table, DatabaseDisk disk = Model.defaultDisk}) Future<List<T>>

Available on Model, provided by the ModelRelationships extension

Resolves many-to-many related models through a pivot table.
belongsToOne<T extends Model>({DatabaseDisk disk = Model.defaultDisk}) Future<T?>

Available on Model, provided by the ModelRelationships extension

Resolves the parent model for an inverse relationship.
delete({DatabaseDisk? disk}) Future<bool>
Deletes the current instance.
override
detach(Model sibling, {required ModelRelationshipType relationship, PivotTable<Model, Model>? table, DatabaseDisk disk = Model.defaultDisk}) Future<bool>

Available on Model, provided by the ModelRelationshipOps extension

Detaches sibling from this model using the given relationship type.
getInstanceTableName() String
inherited
getInstanceTableSingularName() String
inherited
hasMany<T extends Model>({DatabaseDisk disk = Model.defaultDisk}) Future<List<T>>

Available on Model, provided by the ModelRelationships extension

Resolves all one-to-many related models.
hasOne<T extends Model>({DatabaseDisk disk = Model.defaultDisk}) Future<T?>

Available on Model, provided by the ModelRelationships extension

Resolves a one-to-one related model.
load<T extends Model>(ModelRelationshipType relationship, {PivotTable<Model, Model>? table}) Future<Map<String, dynamic>>

Available on Model, provided by the ModelRelationshipOps extension

Loads a relationship and returns this model serialized with the related data embedded.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save({DatabaseDisk? disk}) Future<bool>
Saves the current instance.
override
toJson() Map<String, dynamic>
Serializes model data (excluding metadata).
inherited
toMetaJson() Map<String, dynamic>
Serializes metadata fields (id, uuid, timestamps).
inherited
toString() String
Human-readable string representation.
inherited
update({required Map<String, dynamic> withJson, DatabaseDisk? disk}) Future<bool>
Updates the current instance with new data.
override

Operators

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