Class
SiblingsProperty
@propertyWrapper final class SiblingsProperty<From, To, Through> where From : Model, To : Model, Through : Model
Topics
Initializers
Instance Properties
let from: KeyPath<Through, Through.Parent<From>>var fromId: From.IDValue?var pivots: [Through]Allows eager loading of pivot objects through the sibling relation. Example:var projectedValue: SiblingsProperty<From, To, Through>let to: KeyPath<Through, Through.Parent<To>>var value: [To]?var wrappedValue: [To]
Instance Methods
func attach(_:method:on:_:)Attach a single model by creating a pivot model and specifying the attachment method.func attach(_:on:_:)Attach a single model by creating a pivot model.func detach(_:on:)Detach a single model by deleting the pivot.func detachAll(on:)Detach all models by deleting all pivots from this model.func isAttached(to:on:)Check whether a specific model is already attached through a sibling relationship.func isAttached(toID:on:)Check whether a specific model ID is already attached through a sibling relationship.func query(on: any Database) -> QueryBuilder<To>Returns aQueryBuilderthat can be used to query the siblings.
Enumerations
Default Implementations
Relationships
Conforms To
AnyCodablePropertyAnyDatabasePropertyAnyPropertyEagerLoadablePropertyRelationSwift.CopyableSwift.CustomStringConvertibleSwift.EscapableSwift.SendableSwift.SendableMetatype