Documentation
¶
Overview ¶
Package orm declares typed tables without generated model adapters. For example: orders := Define("orders", func(b Builder[Order], o *Order) OrderTable { ... }).
Index ¶
- Constants
- Variables
- func All[M any](ctx context.Context, ex database.Executor, q Query[M]) ([]M, error)
- func AllLocked[M any](ctx context.Context, tx *database.Tx, q LockedQuery[M]) ([]M, error)
- func Attach[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], ...) (P, error)
- func AttachMany[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], ...) ([]P, error)
- func Audit[M any, K comparable](table Table[M, K], changes Changes[M], policy AuditPolicy[M]) (auditrecord.Model[M, K], error)
- func AuditRead[M, K, V any](history auditrecord.Model[M, K], field interface{ ... }) (value.Optional[auditrecord.FieldChange[V]], error)
- func AuditReadEncrypted[M, K any, V encrypted.Value[V]](history auditrecord.Model[M, K], field Encrypted[M, V]) (value.Optional[auditrecord.FieldChange[V]], error)
- func AuditReadNullable[M, K, V any](history auditrecord.Model[M, K], field interface{ ... }) (value.Optional[auditrecord.FieldChange[value.Nullable[V]]], error)
- func AuditReadNullableEncrypted[M, K any, V encrypted.Value[V]](history auditrecord.Model[M, K], field NullableEncrypted[M, V]) (value.Optional[auditrecord.FieldChange[value.Nullable[V]]], error)
- func Auditing[M any, K comparable](table Table[M, K], policy AuditPolicy[M]) auditrecord.Declaration
- func ChangeOf[M, V any](changes Changes[M], field interface{ ... }) (lifecycle.FieldChange[V], error)
- func Check(tables ...CheckedTable) error
- func Chunk[M any](ctx context.Context, ex database.Executor, q Query[M], size int, ...) error
- func ChunkByKey[M any, K comparable](ctx context.Context, ex database.Executor, q Query[M], key KeyColumn[M, K], ...) error
- func Count[M any](ctx context.Context, ex database.Executor, q Query[M]) (int64, error)
- func CreateEach[M any](ctx context.Context, writer database.Transactor, q Query[M], ...) ([]M, error)
- func CreateOrFirst[M any](ctx context.Context, writer database.Transactor, q Query[M], ...) (M, error)
- func Define[M any, T CheckedTable](name string, declare func(Builder[M], *M) T, opts ...Option) (result T)
- func Delete[M any, K comparable](ctx context.Context, writer database.Transactor, q Query[M], key Key[M, K], ...) (M, error)
- func DeleteAll[M any](ctx context.Context, tx database.Transactor, q Query[M]) (int64, error)
- func DeleteEach[M any](ctx context.Context, writer database.Transactor, q Query[M], limit int) ([]M, error)
- func Detach[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], ...) ([]P, error)
- func DetachAll[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], ...) ([]P, error)
- func DetachMany[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], ...) ([]P, error)
- func Each[M any](ctx context.Context, ex database.Executor, q Query[M], yield func(M) error) error
- func EachByKey[M any, K comparable](ctx context.Context, ex database.Executor, q Query[M], key KeyColumn[M, K], ...) error
- func EachChunked[M any](ctx context.Context, ex database.Executor, q Query[M], size int, ...) error
- func EachLocked[M any](ctx context.Context, tx *database.Tx, q LockedQuery[M], yield func(M) error) error
- func EncryptedChangeOf[M any, V encrypted.Value[V]](changes Changes[M], field Encrypted[M, V]) (lifecycle.FieldChange[V], error)
- func Exists[M any](ctx context.Context, ex database.Executor, q Query[M]) (bool, error)
- func Find[M any, K comparable](ctx context.Context, ex database.Executor, t Table[M, K], key K) (value.Optional[M], error)
- func First[M any](ctx context.Context, ex database.Executor, q Query[M]) (value.Optional[M], error)
- func FirstLocked[M any](ctx context.Context, tx *database.Tx, q LockedQuery[M]) (value.Optional[M], error)
- func FirstOrCreate[M any](ctx context.Context, writer database.Transactor, q Query[M], ...) (M, error)
- func ForceDelete[M any, K comparable](ctx context.Context, writer database.Transactor, q Query[M], ...) (M, error)
- func ForceDeleteAll[M any](ctx context.Context, tx database.Transactor, q Query[M], soft SoftDeletable[M]) (int64, error)
- func ForceDeleteEach[M any](ctx context.Context, writer database.Transactor, q Query[M], ...) ([]M, error)
- func ForceDetach[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], ...) ([]P, error)
- func ForcePruneBatch[M any](ctx context.Context, writer database.Transactor, q Query[M], ...) (int64, error)
- func FoundryCodec[V any](option ColumnOption[V], seal sqlowner.MetadataSeal) codec.Codec[V]
- func FoundryColumn[M, V, P any](column ExpressionColumn[M, V, P], seal sqlowner.MetadataSeal) (ormcore.Column[V], ormcore.Column[P])
- func FoundryConflictData[M any](policy Conflict[M], seal sqlowner.ExpressionSeal) ormcore.ConflictPolicy
- func FoundryLockedRecord[M any](q LockedQuery[M], seal sqlowner.MetadataSeal) ormcore.RecordSource
- func FoundryModel[M any](q Query[M], seal sqlowner.MetadataSeal) (ormcore.Source, func(database.Row) (M, error))
- func FoundryModelRead[M any](q Query[M], seal sqlowner.MetadataSeal) ormcore.RecordSource
- func FoundryPredicate[M any](p Predicate[M], seal sqlowner.MetadataSeal) ormcore.Predicate
- func FoundryRecord[M any](scope ormcore.Scope, seal sqlowner.MetadataSeal) ormcore.Record
- func FoundryRelatedValue[M, N, V any](source AggregateSource[M, N], expression ormcore.Expression, ...) ormcore.Expression
- func FoundrySlot[M any, K comparable, S any](key Key[M, K], slot Slot[M, S], seal sqlowner.MetadataSeal) (string, func(M) model.Reference[M, K], func(M) S, func(M, S) M, error)
- func FoundrySource[M any](q Query[M], seal sqlowner.MetadataSeal) ormcore.Source
- func Insert[M any, K comparable](ctx context.Context, tx database.Transactor, t Table[M, K], ...) (M, error)
- func InsertEach[M any, K comparable](ctx context.Context, writer database.Transactor, table Table[M, K], ...) ([]M, error)
- func InsertMany[M any, K comparable](ctx context.Context, tx database.Transactor, t Table[M, K], ...) ([]M, error)
- func KeyExpr[M any, K comparable, R columnRole](c keyColumn[M, K, R]) keyColumnAdapter[M, K, R]
- func LoadFrom[M any](ctx context.Context, ex database.Executor, q Query[M], parents []M) ([]M, error)
- func LoadMissingFrom[M any](ctx context.Context, ex database.Executor, q Query[M], parents []M) ([]M, error)
- func NullableChangeOf[M, V any](changes Changes[M], field interface{ ... }) (lifecycle.FieldChange[value.Nullable[V]], error)
- func NullableEncryptedChangeOf[M any, V encrypted.Value[V]](changes Changes[M], field NullableEncrypted[M, V]) (lifecycle.FieldChange[value.Nullable[V]], error)
- func NullableTimeExpr[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R]) nullableTimeColumnAdapter[M, V, R]
- func NumberExpr[M any, V NumberValue, R columnRole](c numberColumn[M, V, R]) numberColumnAdapter[M, V, R]
- func NumberKey[M any, K interface{ ... }, R keyRole](key keyColumn[M, K, R]) numberKeyColumn[M, K, R]
- func NumberKeyExpr[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R]) numberKeyColumnAdapter[M, V, R]
- func PruneBatch[M any](ctx context.Context, writer database.Transactor, q Query[M], size int, ...) (int64, error)
- func Raw[M any, K comparable](ctx context.Context, ex database.Executor, t Table[M, K], sql string, ...) ([]M, error)
- func RegisterObserver[M any](r *foundation.Registrar, pool foundation.Key[*database.DB], ...) error
- func RegisterRetrievalObserver[M any](r *foundation.Registrar, pool foundation.Key[*database.DB], ...) error
- func Require[M any](ctx context.Context, ex database.Executor, q Query[M]) (M, error)
- func RequireKey[M any, K comparable](ctx context.Context, ex database.Executor, t Table[M, K], key K) (M, error)
- func RequireLocked[M any](ctx context.Context, tx *database.Tx, q LockedQuery[M]) (M, error)
- func Restore[M any, K comparable](ctx context.Context, tx database.Transactor, t Table[M, K], key K) (M, error)
- func RestoreEach[M any](ctx context.Context, writer database.Transactor, q Query[M], ...) ([]M, error)
- func TextExpr[M any, V ~string, R columnRole](c textColumn[M, V, R]) textColumnAdapter[M, V, R]
- func TextKey[M any, K ~string, R keyRole](key keyColumn[M, K, R]) textColumn[M, K, R]
- func TimeExpr[M any, V TimeValue, R columnRole](c timeColumn[M, V, R]) timeColumnAdapter[M, V, R]
- func Update[M any, K comparable](ctx context.Context, writer database.Transactor, q Query[M], key Key[M, K], ...) (M, error)
- func UpdateAll[M any](ctx context.Context, tx database.Transactor, q Query[M], as ...Assignment[M]) (int64, error)
- func UpdateEach[M any](ctx context.Context, writer database.Transactor, q Query[M], limit int, ...) ([]M, error)
- func UpdateOrCreate[M any](ctx context.Context, writer database.Transactor, q Query[M], ...) (M, error)
- func UpdatePivot[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], ...) ([]P, error)
- func Upsert[M any](ctx context.Context, writer database.Transactor, q Query[M], ...) (value.Optional[M], error)
- func UpsertMany[M any](ctx context.Context, writer database.Transactor, q Query[M], ...) ([]M, error)
- func WithoutRelationGlobalScope[M, N any, R scopeRelation[M, N, R]](r R, scopes ...GlobalScope[N]) R
- func WithoutRelationGlobalScopes[M, N any, R scopeRelation[M, N, R]](r R) R
- func WriteGet[M, I any](write *Write[M], setter func(I) Assignment[M]) value.Optional[I]
- func WriteIsSet[M, I any](write *Write[M], setter func(I) Assignment[M]) bool
- func WriteNullableGet[M, I any](write *Write[M], setter func(I) Assignment[M]) value.Optional[value.Nullable[I]]
- func WriteSet[M any](write *Write[M], assignments ...Assignment[M]) error
- func WriteUnset[M, I any](write *Write[M], setter func(I) Assignment[M]) error
- type AggregateRelation
- type AggregateSource
- type Assignment
- func ColumnSet[M, V any](c Column[M, V], v V) Assignment[M]
- func EncryptedSet[M any, V encrypted.Value[V]](c Encrypted[M, V], v V) Assignment[M]
- func EnumSet[M any, E enum.Scalar](c Enum[M, E], v E) Assignment[M]
- func InputColumnSet[M, I any, V any](c InputColumn[M, I, V], v I) Assignment[M]
- func InputEnumSet[M, I any, E interface{ ... }](c InputEnum[M, I, E], v I) Assignment[M]
- func InputIntervalSet[M, I any](c InputInterval[M, I], v I) Assignment[M]
- func InputJSONSet[M, I any, T any](c InputJSON[M, I, T], v I) Assignment[M]
- func InputKeySet[M, I any, K comparable](c InputKey[M, I, K], v I) Assignment[M]
- func InputNumberSet[M, I any, V NumberValue](c InputNumber[M, I, V], v I) Assignment[M]
- func InputTextSet[M, I any, V ~string](c InputText[M, I, V], v I) Assignment[M]
- func InputTimeSet[M, I any, V TimeValue](c InputTime[M, I, V], v I) Assignment[M]
- func IntervalSet[M any](c Interval[M], v temporal.Interval) Assignment[M]
- func JSONSet[M, T any](c JSON[M, T], v value.JSON[T]) Assignment[M]
- func KeySet[M any, K comparable, R columnRole](c keyColumn[M, K, R], v K) Assignment[M]
- func NullableColumnSet[M, V any](c NullableColumn[M, V], v V) Assignment[M]
- func NullableColumnSetNull[M, V any](c NullableColumn[M, V]) Assignment[M]
- func NullableEncryptedSet[M any, V encrypted.Value[V]](c NullableEncrypted[M, V], v V) Assignment[M]
- func NullableEncryptedSetNull[M any, V encrypted.Value[V]](c NullableEncrypted[M, V]) Assignment[M]
- func NullableEnumSet[M any, E enum.Scalar](c NullableEnum[M, E], v E) Assignment[M]
- func NullableEnumSetNull[M any, E enum.Scalar](c NullableEnum[M, E]) Assignment[M]
- func NullableInputColumnSet[M, I any, V any](c NullableInputColumn[M, I, V], v I) Assignment[M]
- func NullableInputColumnSetNull[M, I any, V any](c NullableInputColumn[M, I, V]) Assignment[M]
- func NullableInputEnumSet[M, I any, E interface{ ... }](c NullableInputEnum[M, I, E], v I) Assignment[M]
- func NullableInputEnumSetNull[M, I any, E interface{ ... }](c NullableInputEnum[M, I, E]) Assignment[M]
- func NullableInputIntervalSet[M, I any](c NullableInputInterval[M, I], v I) Assignment[M]
- func NullableInputIntervalSetNull[M, I any](c NullableInputInterval[M, I]) Assignment[M]
- func NullableInputJSONSet[M, I any, T any](c NullableInputJSON[M, I, T], v I) Assignment[M]
- func NullableInputJSONSetNull[M, I any, T any](c NullableInputJSON[M, I, T]) Assignment[M]
- func NullableInputNumberSet[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v I) Assignment[M]
- func NullableInputNumberSetNull[M, I any, V NumberValue](c NullableInputNumber[M, I, V]) Assignment[M]
- func NullableInputTextSet[M, I any, V ~string](c NullableInputText[M, I, V], v I) Assignment[M]
- func NullableInputTextSetNull[M, I any, V ~string](c NullableInputText[M, I, V]) Assignment[M]
- func NullableInputTimeSet[M, I any, V TimeValue](c NullableInputTime[M, I, V], v I) Assignment[M]
- func NullableInputTimeSetNull[M, I any, V TimeValue](c NullableInputTime[M, I, V]) Assignment[M]
- func NullableIntervalSet[M any](c NullableInterval[M], v temporal.Interval) Assignment[M]
- func NullableIntervalSetNull[M any](c NullableInterval[M]) Assignment[M]
- func NullableJSONSet[M, T any](c NullableJSON[M, T], v value.JSON[T]) Assignment[M]
- func NullableJSONSetNull[M, T any](c NullableJSON[M, T]) Assignment[M]
- func NullableNumberDecrement[M any, V NumberValue](c NullableNumber[M, V], amount V, bound ...Bound[V]) Assignment[M]
- func NullableNumberIncrement[M any, V NumberValue](c NullableNumber[M, V], amount V, bound ...Bound[V]) Assignment[M]
- func NullableNumberSet[M any, V NumberValue](c NullableNumber[M, V], v V) Assignment[M]
- func NullableNumberSetNull[M any, V NumberValue](c NullableNumber[M, V]) Assignment[M]
- func NullableTextSet[M any, V ~string](c NullableText[M, V], v V) Assignment[M]
- func NullableTextSetNull[M any, V ~string](c NullableText[M, V]) Assignment[M]
- func NullableTimeSet[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v V) Assignment[M]
- func NullableTimeSetNull[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R]) Assignment[M]
- func NumberDecrement[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], amount V, bound ...Bound[V]) Assignment[M]
- func NumberIncrement[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], amount V, bound ...Bound[V]) Assignment[M]
- func NumberKeySet[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v V) Assignment[M]
- func NumberSet[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v V) Assignment[M]
- func TextSet[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Assignment[M]
- func TimeSet[M any, V TimeValue, R columnRole](c timeColumn[M, V, R], v V) Assignment[M]
- type AuditPolicy
- type AuditRule
- func AuditEncryptedField[M any, V encrypted.Value[V]](field Encrypted[M, V], disclosure auditrecord.Disclosure) AuditRule[M]
- func AuditField[M, V any](field interface{ ... }, disclosure auditrecord.Disclosure) AuditRule[M]
- func AuditNullableEncryptedField[M any, V encrypted.Value[V]](field NullableEncrypted[M, V], disclosure auditrecord.Disclosure) AuditRule[M]
- type BelongsTo
- func (r BelongsTo[M, N]) LatestOfMany() BelongsTo[M, N]
- func (r BelongsTo[M, N]) OfMany(orders ...Order[N]) BelongsTo[M, N]
- func (r BelongsTo[M, N]) OldestOfMany() BelongsTo[M, N]
- func (r BelongsTo[M, N]) OnlyTrashed() BelongsTo[M, N]
- func (r BelongsTo[M, N]) OrderBy(os ...Order[N]) BelongsTo[M, N]
- func (r BelongsTo[M, N]) Where(ps ...Predicate[N]) BelongsTo[M, N]
- func (r BelongsTo[M, N]) With(children ...Relation[N]) BelongsTo[M, N]
- func (r BelongsTo[M, N]) WithTrashed() BelongsTo[M, N]
- func (r BelongsTo[M, N]) WithoutTrashed() BelongsTo[M, N]
- type Bound
- type Builder
- type Changes
- func (c Changes[M]) After() value.Optional[M]
- func (c Changes[M]) Assigned() bool
- func (c Changes[M]) Before() value.Optional[M]
- func (c Changes[M]) Changed() bool
- func (Changes[M]) GoString() string
- func (c Changes[M]) Operation() value.Optional[lifecycle.Operation]
- func (Changes[M]) String() string
- type CheckedTable
- type Column
- func BoolOf[M any, V ~bool](b Builder[M], ptr *V, opts ...ColumnOption[V]) Column[M, V]
- func BytesOf[M any, V ~[]byte](b Builder[M], ptr *V, opts ...ColumnOption[V]) Column[M, V]
- func ColumnOf[M, V any](b Builder[M], ptr *V, opts ...ColumnOption[V]) Column[M, V]
- func IDOf[M, T any](b Builder[M], ptr *model.ID[T]) Column[M, model.ID[T]]
- func PasswordOf[M any](b Builder[M], ptr *password.Hash) Column[M, password.Hash]
- type ColumnAdapter
- type ColumnOption
- type Conflict
- func (p Conflict[M]) DoNothing() Conflict[M]
- func (p Conflict[M]) DoUpdate(updates ...ConflictUpdate[M]) Conflict[M]
- func (Conflict[M]) GoString() string
- func (Conflict[M]) String() string
- func (p Conflict[M]) TargetWhere(predicates ...Predicate[M]) Conflict[M]
- func (p Conflict[M]) Where(predicates ...Predicate[M]) Conflict[M]
- type ConflictColumn
- type ConflictUpdate
- func ConflictIncoming[M, V any](field interface{ ... }) ConflictUpdate[M]
- func ConflictNull[M, V any](field ExpressionColumn[M, V, value.Nullable[V]]) ConflictUpdate[M]
- func ConflictSet[M, I, V any, F conflictAssignment[M, I, V]](field F, input I) ConflictUpdate[M]
- func FoundryConflictUpdate[M any](metadata ormcore.ConflictAssignment, seal sqlowner.ExpressionSeal) ConflictUpdate[M]
- type CreatedAt
- type Cursor
- type CursorInputError
- type CursorPage
- type CursorRequest
- type DeleteSource
- func (p DeleteSource[S, M]) Exec(ctx context.Context, writer database.Transactor) (int64, error)
- func (DeleteSource[S, M]) Format(s fmt.State, _ rune)
- func (p DeleteSource[S, M]) Match(key SourceKey[S, M]) DeleteSource[S, M]
- func (p DeleteSource[S, M]) Returning(ctx context.Context, writer database.Transactor, limit int) ([]M, error)
- type DirectRelation
- type Encrypted
- type EncryptedAdapter
- type Enum
- type EnumAdapter
- type ExistenceRelation
- type ExpressionColumn
- type ExtensionRelation
- type GlobalScope
- type HasMany
- func HasManyOf[M, N any, K comparable](slot Many[M, N], local KeyColumn[M, K], foreign KeyColumn[N, K]) HasMany[M, N]
- func HasManyThroughOf[M, I, N any, A, B comparable](slot Many[M, N], local KeyColumn[M, A], first KeyColumn[I, A], ...) HasMany[M, N]
- func MorphManyOf[M model.Morphable, N any, K comparable](slot Many[M, N], local KeyColumn[M, K], id KeyColumn[N, K], ...) HasMany[M, N]
- func (r HasMany[M, N]) OnlyTrashed() HasMany[M, N]
- func (r HasMany[M, N]) OrderBy(os ...Order[N]) HasMany[M, N]
- func (r HasMany[M, N]) Where(ps ...Predicate[N]) HasMany[M, N]
- func (r HasMany[M, N]) With(children ...Relation[N]) HasMany[M, N]
- func (r HasMany[M, N]) WithTrashed() HasMany[M, N]
- func (r HasMany[M, N]) WithoutTrashed() HasMany[M, N]
- type HasOne
- func HasOneOf[M, N any, K comparable](slot One[M, N], local KeyColumn[M, K], foreign KeyColumn[N, K]) HasOne[M, N]
- func HasOneThroughOf[M, I, N any, A, B comparable](slot One[M, N], local KeyColumn[M, A], first KeyColumn[I, A], ...) HasOne[M, N]
- func MorphOneOf[M model.Morphable, N any, K comparable](slot One[M, N], local KeyColumn[M, K], id KeyColumn[N, K], ...) HasOne[M, N]
- func (r HasOne[M, N]) LatestOfMany() HasOne[M, N]
- func (r HasOne[M, N]) OfMany(orders ...Order[N]) HasOne[M, N]
- func (r HasOne[M, N]) OldestOfMany() HasOne[M, N]
- func (r HasOne[M, N]) OnlyTrashed() HasOne[M, N]
- func (r HasOne[M, N]) OrderBy(os ...Order[N]) HasOne[M, N]
- func (r HasOne[M, N]) Where(ps ...Predicate[N]) HasOne[M, N]
- func (r HasOne[M, N]) With(children ...Relation[N]) HasOne[M, N]
- func (r HasOne[M, N]) WithTrashed() HasOne[M, N]
- func (r HasOne[M, N]) WithoutTrashed() HasOne[M, N]
- type Hooks
- type InputColumn
- type InputColumnAdapter
- type InputEnum
- type InputEnumAdapter
- type InputInterval
- type InputIntervalAdapter
- type InputJSON
- type InputJSONAdapter
- type InputKey
- type InputKeyAdapter
- type InputNumber
- type InputNumberAdapter
- type InputText
- type InputTextAdapter
- type InputTime
- type InputTimeAdapter
- type InsertMapping
- type InsertSelect
- func (p InsertSelect[S, M]) Exec(ctx context.Context, writer database.Transactor) (int64, error)
- func (InsertSelect[S, M]) Format(s fmt.State, _ rune)
- func (p InsertSelect[S, M]) Returning(ctx context.Context, writer database.Transactor, limit int) ([]M, error)
- func (p InsertSelect[S, M]) Select(mappings ...InsertMapping[S, M]) InsertSelect[S, M]
- func (p InsertSelect[S, M]) Values(values ...Assignment[M]) InsertSelect[S, M]
- type InsertTarget
- type InstantValue
- type Interval
- type IntervalAdapter
- type JSON
- type JSONAdapter
- type Key
- type KeyColumn
- type KeyLookup
- type LockedQuery
- func (q LockedQuery[M]) Limit(n int) LockedQuery[M]
- func (q LockedQuery[M]) NoWait() LockedQuery[M]
- func (q LockedQuery[M]) Offset(n int) LockedQuery[M]
- func (q LockedQuery[M]) OnlyTrashed() LockedQuery[M]
- func (q LockedQuery[M]) OrderBy(os ...Order[M]) LockedQuery[M]
- func (q LockedQuery[M]) SkipLocked() LockedQuery[M]
- func (q LockedQuery[M]) Wait() LockedQuery[M]
- func (q LockedQuery[M]) Where(ps ...Predicate[M]) LockedQuery[M]
- func (q LockedQuery[M]) WithTrashed() LockedQuery[M]
- func (q LockedQuery[M]) WithoutTrashed() LockedQuery[M]
- type Many
- type ModelIdentity
- func (d ModelIdentity[M, K]) ActiveKeys(ctx context.Context, ex database.Executor, keys []K) ([]K, error)
- func (d ModelIdentity[M, K]) KeyToken(key K) (string, error)
- func (d ModelIdentity[M, K]) LockActive(ctx context.Context, tx *database.Tx, key K) (bool, error)
- func (d ModelIdentity[M, K]) ModelName() string
- func (d ModelIdentity[M, K]) Parse(stored model.Identity) (model.Reference[M, K], error)
- func (d ModelIdentity[M, K]) Reference(key K) model.Reference[M, K]
- func (d ModelIdentity[M, K]) ReferenceOf(m M) model.Reference[M, K]
- func (d ModelIdentity[M, K]) RetainedKeys(ctx context.Context, ex database.Executor, keys []K) ([]K, error)
- func (d ModelIdentity[M, K]) Scope(keys ...K) Predicate[M]
- func (d ModelIdentity[M, K]) Validate() error
- type NullableColumn
- func NullableBytesOf[M any, V ~[]byte](b Builder[M], ptr *value.Nullable[V], opts ...ColumnOption[V]) NullableColumn[M, V]
- func NullableColumnOf[M, V any](b Builder[M], ptr *value.Nullable[V], opts ...ColumnOption[V]) NullableColumn[M, V]
- func NullableIDOf[M, T any](b Builder[M], ptr *value.Nullable[model.ID[T]]) NullableColumn[M, model.ID[T]]
- func NullablePasswordOf[M any](b Builder[M], ptr *value.Nullable[password.Hash]) NullableColumn[M, password.Hash]
- type NullableColumnAdapter
- type NullableEncrypted
- type NullableEncryptedAdapter
- type NullableEnum
- type NullableEnumAdapter
- type NullableInputColumn
- type NullableInputColumnAdapter
- type NullableInputEnum
- type NullableInputEnumAdapter
- type NullableInputInterval
- type NullableInputIntervalAdapter
- type NullableInputJSON
- type NullableInputJSONAdapter
- type NullableInputNumber
- type NullableInputNumberAdapter
- type NullableInputText
- type NullableInputTextAdapter
- type NullableInputTime
- type NullableInputTimeAdapter
- type NullableInterval
- type NullableIntervalAdapter
- type NullableJSON
- type NullableJSONAdapter
- type NullableNumber
- type NullableNumberAdapter
- type NullableText
- type NullableTextAdapter
- type NullableTime
- type Number
- type NumberLookupKey
- type NumberPrimary
- type NumberValue
- type Observer
- type One
- type Option
- type Order
- func ColumnAsc[M, V any](c Column[M, V]) Order[M]
- func ColumnDesc[M, V any](c Column[M, V]) Order[M]
- func EnumAsc[M any, E enum.Scalar](c Enum[M, E]) Order[M]
- func EnumDesc[M any, E enum.Scalar](c Enum[M, E]) Order[M]
- func FoundryRelationOrder[M, N any](r ExistenceRelation[M, N], o ormcore.Order, seal sqlowner.MetadataSeal) Order[N]
- func FoundryRelationPivotOrder[M, N, P any](r ThroughRelation[M, N, P], o ormcore.Order, seal sqlowner.MetadataSeal) Order[P]
- func InputColumnAsc[M, I any, V any](c InputColumn[M, I, V]) Order[M]
- func InputColumnDesc[M, I any, V any](c InputColumn[M, I, V]) Order[M]
- func InputEnumAsc[M, I any, E interface{ ... }](c InputEnum[M, I, E]) Order[M]
- func InputEnumDesc[M, I any, E interface{ ... }](c InputEnum[M, I, E]) Order[M]
- func InputIntervalAsc[M, I any](c InputInterval[M, I]) Order[M]
- func InputIntervalDesc[M, I any](c InputInterval[M, I]) Order[M]
- func InputJSONAsc[M, I any, T any](c InputJSON[M, I, T]) Order[M]
- func InputJSONDesc[M, I any, T any](c InputJSON[M, I, T]) Order[M]
- func InputKeyAsc[M, I any, K comparable](c InputKey[M, I, K]) Order[M]
- func InputKeyDesc[M, I any, K comparable](c InputKey[M, I, K]) Order[M]
- func InputNumberAsc[M, I any, V NumberValue](c InputNumber[M, I, V]) Order[M]
- func InputNumberDesc[M, I any, V NumberValue](c InputNumber[M, I, V]) Order[M]
- func InputTextAsc[M, I any, V ~string](c InputText[M, I, V]) Order[M]
- func InputTextDesc[M, I any, V ~string](c InputText[M, I, V]) Order[M]
- func InputTimeAsc[M, I any, V TimeValue](c InputTime[M, I, V]) Order[M]
- func InputTimeDesc[M, I any, V TimeValue](c InputTime[M, I, V]) Order[M]
- func IntervalAsc[M any](c Interval[M]) Order[M]
- func IntervalDesc[M any](c Interval[M]) Order[M]
- func JSONAsc[M, T any](c JSON[M, T]) Order[M]
- func JSONDesc[M, T any](c JSON[M, T]) Order[M]
- func KeyAsc[M any, K comparable, R columnRole](c keyColumn[M, K, R]) Order[M]
- func KeyDesc[M any, K comparable, R columnRole](c keyColumn[M, K, R]) Order[M]
- func NullableColumnAsc[M, V any](c NullableColumn[M, V]) Order[M]
- func NullableColumnDesc[M, V any](c NullableColumn[M, V]) Order[M]
- func NullableEnumAsc[M any, E enum.Scalar](c NullableEnum[M, E]) Order[M]
- func NullableEnumDesc[M any, E enum.Scalar](c NullableEnum[M, E]) Order[M]
- func NullableInputColumnAsc[M, I any, V any](c NullableInputColumn[M, I, V]) Order[M]
- func NullableInputColumnDesc[M, I any, V any](c NullableInputColumn[M, I, V]) Order[M]
- func NullableInputEnumAsc[M, I any, E interface{ ... }](c NullableInputEnum[M, I, E]) Order[M]
- func NullableInputEnumDesc[M, I any, E interface{ ... }](c NullableInputEnum[M, I, E]) Order[M]
- func NullableInputIntervalAsc[M, I any](c NullableInputInterval[M, I]) Order[M]
- func NullableInputIntervalDesc[M, I any](c NullableInputInterval[M, I]) Order[M]
- func NullableInputJSONAsc[M, I any, T any](c NullableInputJSON[M, I, T]) Order[M]
- func NullableInputJSONDesc[M, I any, T any](c NullableInputJSON[M, I, T]) Order[M]
- func NullableInputNumberAsc[M, I any, V NumberValue](c NullableInputNumber[M, I, V]) Order[M]
- func NullableInputNumberDesc[M, I any, V NumberValue](c NullableInputNumber[M, I, V]) Order[M]
- func NullableInputTextAsc[M, I any, V ~string](c NullableInputText[M, I, V]) Order[M]
- func NullableInputTextDesc[M, I any, V ~string](c NullableInputText[M, I, V]) Order[M]
- func NullableInputTimeAsc[M, I any, V TimeValue](c NullableInputTime[M, I, V]) Order[M]
- func NullableInputTimeDesc[M, I any, V TimeValue](c NullableInputTime[M, I, V]) Order[M]
- func NullableIntervalAsc[M any](c NullableInterval[M]) Order[M]
- func NullableIntervalDesc[M any](c NullableInterval[M]) Order[M]
- func NullableJSONAsc[M, T any](c NullableJSON[M, T]) Order[M]
- func NullableJSONDesc[M, T any](c NullableJSON[M, T]) Order[M]
- func NullableNumberAsc[M any, V NumberValue](c NullableNumber[M, V]) Order[M]
- func NullableNumberDesc[M any, V NumberValue](c NullableNumber[M, V]) Order[M]
- func NullableTextAsc[M any, V ~string](c NullableText[M, V]) Order[M]
- func NullableTextDesc[M any, V ~string](c NullableText[M, V]) Order[M]
- func NullableTimeAsc[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R]) Order[M]
- func NullableTimeDesc[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R]) Order[M]
- func NumberAsc[M any, V NumberValue, R columnRole](c numberColumn[M, V, R]) Order[M]
- func NumberDesc[M any, V NumberValue, R columnRole](c numberColumn[M, V, R]) Order[M]
- func NumberKeyAsc[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R]) Order[M]
- func NumberKeyDesc[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R]) Order[M]
- func TextAsc[M any, V ~string, R columnRole](c textColumn[M, V, R]) Order[M]
- func TextDesc[M any, V ~string, R columnRole](c textColumn[M, V, R]) Order[M]
- func TimeAsc[M any, V TimeValue, R columnRole](c timeColumn[M, V, R]) Order[M]
- func TimeDesc[M any, V TimeValue, R columnRole](c timeColumn[M, V, R]) Order[M]
- type OrderedExpressionColumn
- type PageRequest
- type PageResult
- type PivotChanges
- func Sync[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], ...) (PivotChanges[P], error)
- func SyncWithoutDetaching[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], ...) (PivotChanges[P], error)
- func Toggle[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], ...) (PivotChanges[P], error)
- type Plan
- func Explain[M any](ctx context.Context, ex database.Executor, q Query[M]) (Plan, error)
- func ExplainAnalyze[M any](ctx context.Context, ex database.Executor, q Query[M]) (Plan, error)
- func ExplainAnalyzeLocked[M any](ctx context.Context, tx *database.Tx, q LockedQuery[M]) (Plan, error)
- func ExplainLocked[M any](ctx context.Context, tx *database.Tx, q LockedQuery[M]) (Plan, error)
- type PlanNode
- type Predicate
- func And[M any](ps ...Predicate[M]) Predicate[M]
- func ColumnEq[M, V any](c Column[M, V], v V) Predicate[M]
- func ColumnIn[M, V any](c Column[M, V], v ...V) Predicate[M]
- func ColumnNe[M, V any](c Column[M, V], v V) Predicate[M]
- func ColumnNotIn[M, V any](c Column[M, V], v ...V) Predicate[M]
- func EnumEq[M any, E enum.Scalar](c Enum[M, E], v E) Predicate[M]
- func EnumIn[M any, E enum.Scalar](c Enum[M, E], v ...E) Predicate[M]
- func EnumNe[M any, E enum.Scalar](c Enum[M, E], v E) Predicate[M]
- func EnumNotIn[M any, E enum.Scalar](c Enum[M, E], v ...E) Predicate[M]
- func FoundryRelationFilter[M, N any](r ExistenceRelation[M, N], p ormcore.Predicate, seal sqlowner.MetadataSeal) Predicate[N]
- func FoundryRelationPredicate[M, N any](r ExistenceRelation[M, N], ps []ormcore.Predicate, seal sqlowner.MetadataSeal) Predicate[M]
- func Has[M, N any](r ExistenceRelation[M, N], ps ...Predicate[N]) Predicate[M]
- func InputColumnEq[M, I any, V any](c InputColumn[M, I, V], v V) Predicate[M]
- func InputColumnIn[M, I any, V any](c InputColumn[M, I, V], v ...V) Predicate[M]
- func InputColumnNe[M, I any, V any](c InputColumn[M, I, V], v V) Predicate[M]
- func InputColumnNotIn[M, I any, V any](c InputColumn[M, I, V], v ...V) Predicate[M]
- func InputEnumEq[M, I any, E interface{ ... }](c InputEnum[M, I, E], v E) Predicate[M]
- func InputEnumIn[M, I any, E interface{ ... }](c InputEnum[M, I, E], v ...E) Predicate[M]
- func InputEnumNe[M, I any, E interface{ ... }](c InputEnum[M, I, E], v E) Predicate[M]
- func InputEnumNotIn[M, I any, E interface{ ... }](c InputEnum[M, I, E], v ...E) Predicate[M]
- func InputIntervalBetween[M, I any](c InputInterval[M, I], a, b temporal.Interval) Predicate[M]
- func InputIntervalEq[M, I any](c InputInterval[M, I], v temporal.Interval) Predicate[M]
- func InputIntervalGt[M, I any](c InputInterval[M, I], v temporal.Interval) Predicate[M]
- func InputIntervalGte[M, I any](c InputInterval[M, I], v temporal.Interval) Predicate[M]
- func InputIntervalIn[M, I any](c InputInterval[M, I], v ...temporal.Interval) Predicate[M]
- func InputIntervalLt[M, I any](c InputInterval[M, I], v temporal.Interval) Predicate[M]
- func InputIntervalLte[M, I any](c InputInterval[M, I], v temporal.Interval) Predicate[M]
- func InputIntervalNe[M, I any](c InputInterval[M, I], v temporal.Interval) Predicate[M]
- func InputIntervalNotIn[M, I any](c InputInterval[M, I], v ...temporal.Interval) Predicate[M]
- func InputJSONContainedBy[M, I any, T any](c InputJSON[M, I, T], v value.JSON[T]) Predicate[M]
- func InputJSONContains[M, I any, T any](c InputJSON[M, I, T], v value.JSON[T]) Predicate[M]
- func InputJSONEq[M, I any, T any](c InputJSON[M, I, T], v value.JSON[T]) Predicate[M]
- func InputJSONIn[M, I any, T any](c InputJSON[M, I, T], v ...value.JSON[T]) Predicate[M]
- func InputJSONIsJSONNull[M, I any, T any](c InputJSON[M, I, T]) Predicate[M]
- func InputJSONNe[M, I any, T any](c InputJSON[M, I, T], v value.JSON[T]) Predicate[M]
- func InputJSONNotIn[M, I any, T any](c InputJSON[M, I, T], v ...value.JSON[T]) Predicate[M]
- func InputKeyEq[M, I any, K comparable](c InputKey[M, I, K], v K) Predicate[M]
- func InputKeyIn[M, I any, K comparable](c InputKey[M, I, K], v ...K) Predicate[M]
- func InputKeyNe[M, I any, K comparable](c InputKey[M, I, K], v K) Predicate[M]
- func InputKeyNotIn[M, I any, K comparable](c InputKey[M, I, K], v ...K) Predicate[M]
- func InputNumberBetween[M, I any, V NumberValue](c InputNumber[M, I, V], a, b V) Predicate[M]
- func InputNumberEq[M, I any, V NumberValue](c InputNumber[M, I, V], v V) Predicate[M]
- func InputNumberGt[M, I any, V NumberValue](c InputNumber[M, I, V], v V) Predicate[M]
- func InputNumberGte[M, I any, V NumberValue](c InputNumber[M, I, V], v V) Predicate[M]
- func InputNumberIn[M, I any, V NumberValue](c InputNumber[M, I, V], v ...V) Predicate[M]
- func InputNumberLt[M, I any, V NumberValue](c InputNumber[M, I, V], v V) Predicate[M]
- func InputNumberLte[M, I any, V NumberValue](c InputNumber[M, I, V], v V) Predicate[M]
- func InputNumberNe[M, I any, V NumberValue](c InputNumber[M, I, V], v V) Predicate[M]
- func InputNumberNotIn[M, I any, V NumberValue](c InputNumber[M, I, V], v ...V) Predicate[M]
- func InputTextBetween[M, I any, V ~string](c InputText[M, I, V], a, b V) Predicate[M]
- func InputTextContains[M, I any, V ~string](c InputText[M, I, V], v V) Predicate[M]
- func InputTextEndsWith[M, I any, V ~string](c InputText[M, I, V], v V) Predicate[M]
- func InputTextEq[M, I any, V ~string](c InputText[M, I, V], v V) Predicate[M]
- func InputTextGt[M, I any, V ~string](c InputText[M, I, V], v V) Predicate[M]
- func InputTextGte[M, I any, V ~string](c InputText[M, I, V], v V) Predicate[M]
- func InputTextIContains[M, I any, V ~string](c InputText[M, I, V], v V) Predicate[M]
- func InputTextIEndsWith[M, I any, V ~string](c InputText[M, I, V], v V) Predicate[M]
- func InputTextILike[M, I any, V ~string](c InputText[M, I, V], v V) Predicate[M]
- func InputTextIStartsWith[M, I any, V ~string](c InputText[M, I, V], v V) Predicate[M]
- func InputTextIn[M, I any, V ~string](c InputText[M, I, V], v ...V) Predicate[M]
- func InputTextLike[M, I any, V ~string](c InputText[M, I, V], v V) Predicate[M]
- func InputTextLt[M, I any, V ~string](c InputText[M, I, V], v V) Predicate[M]
- func InputTextLte[M, I any, V ~string](c InputText[M, I, V], v V) Predicate[M]
- func InputTextNe[M, I any, V ~string](c InputText[M, I, V], v V) Predicate[M]
- func InputTextNotIn[M, I any, V ~string](c InputText[M, I, V], v ...V) Predicate[M]
- func InputTextStartsWith[M, I any, V ~string](c InputText[M, I, V], v V) Predicate[M]
- func InputTimeBetween[M, I any, V TimeValue](c InputTime[M, I, V], a, b V) Predicate[M]
- func InputTimeEq[M, I any, V TimeValue](c InputTime[M, I, V], v V) Predicate[M]
- func InputTimeGt[M, I any, V TimeValue](c InputTime[M, I, V], v V) Predicate[M]
- func InputTimeGte[M, I any, V TimeValue](c InputTime[M, I, V], v V) Predicate[M]
- func InputTimeIn[M, I any, V TimeValue](c InputTime[M, I, V], v ...V) Predicate[M]
- func InputTimeLt[M, I any, V TimeValue](c InputTime[M, I, V], v V) Predicate[M]
- func InputTimeLte[M, I any, V TimeValue](c InputTime[M, I, V], v V) Predicate[M]
- func InputTimeNe[M, I any, V TimeValue](c InputTime[M, I, V], v V) Predicate[M]
- func InputTimeNotIn[M, I any, V TimeValue](c InputTime[M, I, V], v ...V) Predicate[M]
- func IntervalBetween[M any](c Interval[M], a, b temporal.Interval) Predicate[M]
- func IntervalEq[M any](c Interval[M], v temporal.Interval) Predicate[M]
- func IntervalGt[M any](c Interval[M], v temporal.Interval) Predicate[M]
- func IntervalGte[M any](c Interval[M], v temporal.Interval) Predicate[M]
- func IntervalIn[M any](c Interval[M], v ...temporal.Interval) Predicate[M]
- func IntervalLt[M any](c Interval[M], v temporal.Interval) Predicate[M]
- func IntervalLte[M any](c Interval[M], v temporal.Interval) Predicate[M]
- func IntervalNe[M any](c Interval[M], v temporal.Interval) Predicate[M]
- func IntervalNotIn[M any](c Interval[M], v ...temporal.Interval) Predicate[M]
- func JSONContainedBy[M, T any](c JSON[M, T], v value.JSON[T]) Predicate[M]
- func JSONContains[M, T any](c JSON[M, T], v value.JSON[T]) Predicate[M]
- func JSONEq[M, T any](c JSON[M, T], v value.JSON[T]) Predicate[M]
- func JSONIn[M, T any](c JSON[M, T], v ...value.JSON[T]) Predicate[M]
- func JSONIsJSONNull[M, T any](c JSON[M, T]) Predicate[M]
- func JSONNe[M, T any](c JSON[M, T], v value.JSON[T]) Predicate[M]
- func JSONNotIn[M, T any](c JSON[M, T], v ...value.JSON[T]) Predicate[M]
- func KeyColumnEq[M any, K comparable](c KeyColumn[M, K], v K) Predicate[M]
- func KeyColumnNe[M any, K comparable](c KeyColumn[M, K], v K) Predicate[M]
- func KeyEq[M any, K comparable, R columnRole](c keyColumn[M, K, R], v K) Predicate[M]
- func KeyIn[M any, K comparable, R columnRole](c keyColumn[M, K, R], v ...K) Predicate[M]
- func KeyNe[M any, K comparable, R columnRole](c keyColumn[M, K, R], v K) Predicate[M]
- func KeyNotIn[M any, K comparable, R columnRole](c keyColumn[M, K, R], v ...K) Predicate[M]
- func Not[M any](p Predicate[M]) Predicate[M]
- func NullableColumnEq[M, V any](c NullableColumn[M, V], v V) Predicate[M]
- func NullableColumnIn[M, V any](c NullableColumn[M, V], v ...V) Predicate[M]
- func NullableColumnIsNotNull[M, V any](c NullableColumn[M, V]) Predicate[M]
- func NullableColumnIsNull[M, V any](c NullableColumn[M, V]) Predicate[M]
- func NullableColumnNe[M, V any](c NullableColumn[M, V], v V) Predicate[M]
- func NullableColumnNotIn[M, V any](c NullableColumn[M, V], v ...V) Predicate[M]
- func NullableEncryptedIsNotNull[M any, V encrypted.Value[V]](c NullableEncrypted[M, V]) Predicate[M]
- func NullableEncryptedIsNull[M any, V encrypted.Value[V]](c NullableEncrypted[M, V]) Predicate[M]
- func NullableEnumEq[M any, E enum.Scalar](c NullableEnum[M, E], v E) Predicate[M]
- func NullableEnumIn[M any, E enum.Scalar](c NullableEnum[M, E], v ...E) Predicate[M]
- func NullableEnumIsNotNull[M any, E enum.Scalar](c NullableEnum[M, E]) Predicate[M]
- func NullableEnumIsNull[M any, E enum.Scalar](c NullableEnum[M, E]) Predicate[M]
- func NullableEnumNe[M any, E enum.Scalar](c NullableEnum[M, E], v E) Predicate[M]
- func NullableEnumNotIn[M any, E enum.Scalar](c NullableEnum[M, E], v ...E) Predicate[M]
- func NullableInputColumnEq[M, I any, V any](c NullableInputColumn[M, I, V], v V) Predicate[M]
- func NullableInputColumnIn[M, I any, V any](c NullableInputColumn[M, I, V], v ...V) Predicate[M]
- func NullableInputColumnIsNotNull[M, I any, V any](c NullableInputColumn[M, I, V]) Predicate[M]
- func NullableInputColumnIsNull[M, I any, V any](c NullableInputColumn[M, I, V]) Predicate[M]
- func NullableInputColumnNe[M, I any, V any](c NullableInputColumn[M, I, V], v V) Predicate[M]
- func NullableInputColumnNotIn[M, I any, V any](c NullableInputColumn[M, I, V], v ...V) Predicate[M]
- func NullableInputEnumEq[M, I any, E interface{ ... }](c NullableInputEnum[M, I, E], v E) Predicate[M]
- func NullableInputEnumIn[M, I any, E interface{ ... }](c NullableInputEnum[M, I, E], v ...E) Predicate[M]
- func NullableInputEnumIsNotNull[M, I any, E interface{ ... }](c NullableInputEnum[M, I, E]) Predicate[M]
- func NullableInputEnumIsNull[M, I any, E interface{ ... }](c NullableInputEnum[M, I, E]) Predicate[M]
- func NullableInputEnumNe[M, I any, E interface{ ... }](c NullableInputEnum[M, I, E], v E) Predicate[M]
- func NullableInputEnumNotIn[M, I any, E interface{ ... }](c NullableInputEnum[M, I, E], v ...E) Predicate[M]
- func NullableInputIntervalBetween[M, I any](c NullableInputInterval[M, I], a, b temporal.Interval) Predicate[M]
- func NullableInputIntervalEq[M, I any](c NullableInputInterval[M, I], v temporal.Interval) Predicate[M]
- func NullableInputIntervalGt[M, I any](c NullableInputInterval[M, I], v temporal.Interval) Predicate[M]
- func NullableInputIntervalGte[M, I any](c NullableInputInterval[M, I], v temporal.Interval) Predicate[M]
- func NullableInputIntervalIn[M, I any](c NullableInputInterval[M, I], v ...temporal.Interval) Predicate[M]
- func NullableInputIntervalIsNotNull[M, I any](c NullableInputInterval[M, I]) Predicate[M]
- func NullableInputIntervalIsNull[M, I any](c NullableInputInterval[M, I]) Predicate[M]
- func NullableInputIntervalLt[M, I any](c NullableInputInterval[M, I], v temporal.Interval) Predicate[M]
- func NullableInputIntervalLte[M, I any](c NullableInputInterval[M, I], v temporal.Interval) Predicate[M]
- func NullableInputIntervalNe[M, I any](c NullableInputInterval[M, I], v temporal.Interval) Predicate[M]
- func NullableInputIntervalNotIn[M, I any](c NullableInputInterval[M, I], v ...temporal.Interval) Predicate[M]
- func NullableInputJSONContainedBy[M, I any, T any](c NullableInputJSON[M, I, T], v value.JSON[T]) Predicate[M]
- func NullableInputJSONContains[M, I any, T any](c NullableInputJSON[M, I, T], v value.JSON[T]) Predicate[M]
- func NullableInputJSONEq[M, I any, T any](c NullableInputJSON[M, I, T], v value.JSON[T]) Predicate[M]
- func NullableInputJSONIn[M, I any, T any](c NullableInputJSON[M, I, T], v ...value.JSON[T]) Predicate[M]
- func NullableInputJSONIsJSONNull[M, I any, T any](c NullableInputJSON[M, I, T]) Predicate[M]
- func NullableInputJSONIsNotNull[M, I any, T any](c NullableInputJSON[M, I, T]) Predicate[M]
- func NullableInputJSONIsNull[M, I any, T any](c NullableInputJSON[M, I, T]) Predicate[M]
- func NullableInputJSONNe[M, I any, T any](c NullableInputJSON[M, I, T], v value.JSON[T]) Predicate[M]
- func NullableInputJSONNotIn[M, I any, T any](c NullableInputJSON[M, I, T], v ...value.JSON[T]) Predicate[M]
- func NullableInputNumberBetween[M, I any, V NumberValue](c NullableInputNumber[M, I, V], a, b V) Predicate[M]
- func NullableInputNumberEq[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v V) Predicate[M]
- func NullableInputNumberGt[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v V) Predicate[M]
- func NullableInputNumberGte[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v V) Predicate[M]
- func NullableInputNumberIn[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v ...V) Predicate[M]
- func NullableInputNumberIsNotNull[M, I any, V NumberValue](c NullableInputNumber[M, I, V]) Predicate[M]
- func NullableInputNumberIsNull[M, I any, V NumberValue](c NullableInputNumber[M, I, V]) Predicate[M]
- func NullableInputNumberLt[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v V) Predicate[M]
- func NullableInputNumberLte[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v V) Predicate[M]
- func NullableInputNumberNe[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v V) Predicate[M]
- func NullableInputNumberNotIn[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v ...V) Predicate[M]
- func NullableInputTextBetween[M, I any, V ~string](c NullableInputText[M, I, V], a, b V) Predicate[M]
- func NullableInputTextContains[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
- func NullableInputTextEndsWith[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
- func NullableInputTextEq[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
- func NullableInputTextGt[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
- func NullableInputTextGte[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
- func NullableInputTextIContains[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
- func NullableInputTextIEndsWith[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
- func NullableInputTextILike[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
- func NullableInputTextIStartsWith[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
- func NullableInputTextIn[M, I any, V ~string](c NullableInputText[M, I, V], v ...V) Predicate[M]
- func NullableInputTextIsNotNull[M, I any, V ~string](c NullableInputText[M, I, V]) Predicate[M]
- func NullableInputTextIsNull[M, I any, V ~string](c NullableInputText[M, I, V]) Predicate[M]
- func NullableInputTextLike[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
- func NullableInputTextLt[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
- func NullableInputTextLte[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
- func NullableInputTextNe[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
- func NullableInputTextNotIn[M, I any, V ~string](c NullableInputText[M, I, V], v ...V) Predicate[M]
- func NullableInputTextStartsWith[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
- func NullableInputTimeBetween[M, I any, V TimeValue](c NullableInputTime[M, I, V], a, b V) Predicate[M]
- func NullableInputTimeEq[M, I any, V TimeValue](c NullableInputTime[M, I, V], v V) Predicate[M]
- func NullableInputTimeGt[M, I any, V TimeValue](c NullableInputTime[M, I, V], v V) Predicate[M]
- func NullableInputTimeGte[M, I any, V TimeValue](c NullableInputTime[M, I, V], v V) Predicate[M]
- func NullableInputTimeIn[M, I any, V TimeValue](c NullableInputTime[M, I, V], v ...V) Predicate[M]
- func NullableInputTimeIsNotNull[M, I any, V TimeValue](c NullableInputTime[M, I, V]) Predicate[M]
- func NullableInputTimeIsNull[M, I any, V TimeValue](c NullableInputTime[M, I, V]) Predicate[M]
- func NullableInputTimeLt[M, I any, V TimeValue](c NullableInputTime[M, I, V], v V) Predicate[M]
- func NullableInputTimeLte[M, I any, V TimeValue](c NullableInputTime[M, I, V], v V) Predicate[M]
- func NullableInputTimeNe[M, I any, V TimeValue](c NullableInputTime[M, I, V], v V) Predicate[M]
- func NullableInputTimeNotIn[M, I any, V TimeValue](c NullableInputTime[M, I, V], v ...V) Predicate[M]
- func NullableIntervalBetween[M any](c NullableInterval[M], a, b temporal.Interval) Predicate[M]
- func NullableIntervalEq[M any](c NullableInterval[M], v temporal.Interval) Predicate[M]
- func NullableIntervalGt[M any](c NullableInterval[M], v temporal.Interval) Predicate[M]
- func NullableIntervalGte[M any](c NullableInterval[M], v temporal.Interval) Predicate[M]
- func NullableIntervalIn[M any](c NullableInterval[M], v ...temporal.Interval) Predicate[M]
- func NullableIntervalIsNotNull[M any](c NullableInterval[M]) Predicate[M]
- func NullableIntervalIsNull[M any](c NullableInterval[M]) Predicate[M]
- func NullableIntervalLt[M any](c NullableInterval[M], v temporal.Interval) Predicate[M]
- func NullableIntervalLte[M any](c NullableInterval[M], v temporal.Interval) Predicate[M]
- func NullableIntervalNe[M any](c NullableInterval[M], v temporal.Interval) Predicate[M]
- func NullableIntervalNotIn[M any](c NullableInterval[M], v ...temporal.Interval) Predicate[M]
- func NullableJSONContainedBy[M, T any](c NullableJSON[M, T], v value.JSON[T]) Predicate[M]
- func NullableJSONContains[M, T any](c NullableJSON[M, T], v value.JSON[T]) Predicate[M]
- func NullableJSONEq[M, T any](c NullableJSON[M, T], v value.JSON[T]) Predicate[M]
- func NullableJSONIn[M, T any](c NullableJSON[M, T], v ...value.JSON[T]) Predicate[M]
- func NullableJSONIsJSONNull[M, T any](c NullableJSON[M, T]) Predicate[M]
- func NullableJSONIsNotNull[M, T any](c NullableJSON[M, T]) Predicate[M]
- func NullableJSONIsNull[M, T any](c NullableJSON[M, T]) Predicate[M]
- func NullableJSONNe[M, T any](c NullableJSON[M, T], v value.JSON[T]) Predicate[M]
- func NullableJSONNotIn[M, T any](c NullableJSON[M, T], v ...value.JSON[T]) Predicate[M]
- func NullableNumberBetween[M any, V NumberValue](c NullableNumber[M, V], a, b V) Predicate[M]
- func NullableNumberEq[M any, V NumberValue](c NullableNumber[M, V], v V) Predicate[M]
- func NullableNumberGt[M any, V NumberValue](c NullableNumber[M, V], v V) Predicate[M]
- func NullableNumberGte[M any, V NumberValue](c NullableNumber[M, V], v V) Predicate[M]
- func NullableNumberIn[M any, V NumberValue](c NullableNumber[M, V], v ...V) Predicate[M]
- func NullableNumberIsNotNull[M any, V NumberValue](c NullableNumber[M, V]) Predicate[M]
- func NullableNumberIsNull[M any, V NumberValue](c NullableNumber[M, V]) Predicate[M]
- func NullableNumberLt[M any, V NumberValue](c NullableNumber[M, V], v V) Predicate[M]
- func NullableNumberLte[M any, V NumberValue](c NullableNumber[M, V], v V) Predicate[M]
- func NullableNumberNe[M any, V NumberValue](c NullableNumber[M, V], v V) Predicate[M]
- func NullableNumberNotIn[M any, V NumberValue](c NullableNumber[M, V], v ...V) Predicate[M]
- func NullableTextBetween[M any, V ~string](c NullableText[M, V], a, b V) Predicate[M]
- func NullableTextContains[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
- func NullableTextEndsWith[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
- func NullableTextEq[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
- func NullableTextGt[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
- func NullableTextGte[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
- func NullableTextIContains[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
- func NullableTextIEndsWith[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
- func NullableTextILike[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
- func NullableTextIStartsWith[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
- func NullableTextIn[M any, V ~string](c NullableText[M, V], v ...V) Predicate[M]
- func NullableTextIsNotNull[M any, V ~string](c NullableText[M, V]) Predicate[M]
- func NullableTextIsNull[M any, V ~string](c NullableText[M, V]) Predicate[M]
- func NullableTextLike[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
- func NullableTextLt[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
- func NullableTextLte[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
- func NullableTextNe[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
- func NullableTextNotIn[M any, V ~string](c NullableText[M, V], v ...V) Predicate[M]
- func NullableTextStartsWith[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
- func NullableTimeBetween[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], a, b V) Predicate[M]
- func NullableTimeEq[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v V) Predicate[M]
- func NullableTimeGt[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v V) Predicate[M]
- func NullableTimeGte[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v V) Predicate[M]
- func NullableTimeIn[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v ...V) Predicate[M]
- func NullableTimeIsNotNull[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R]) Predicate[M]
- func NullableTimeIsNull[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R]) Predicate[M]
- func NullableTimeLt[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v V) Predicate[M]
- func NullableTimeLte[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v V) Predicate[M]
- func NullableTimeNe[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v V) Predicate[M]
- func NullableTimeNotIn[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v ...V) Predicate[M]
- func NumberBetween[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], a, b V) Predicate[M]
- func NumberEq[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v V) Predicate[M]
- func NumberGt[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v V) Predicate[M]
- func NumberGte[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v V) Predicate[M]
- func NumberIn[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v ...V) Predicate[M]
- func NumberKeyBetween[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], a, b V) Predicate[M]
- func NumberKeyEq[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v V) Predicate[M]
- func NumberKeyGt[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v V) Predicate[M]
- func NumberKeyGte[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v V) Predicate[M]
- func NumberKeyIn[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v ...V) Predicate[M]
- func NumberKeyLt[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v V) Predicate[M]
- func NumberKeyLte[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v V) Predicate[M]
- func NumberKeyNe[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v V) Predicate[M]
- func NumberKeyNotIn[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v ...V) Predicate[M]
- func NumberLt[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v V) Predicate[M]
- func NumberLte[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v V) Predicate[M]
- func NumberNe[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v V) Predicate[M]
- func NumberNotIn[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v ...V) Predicate[M]
- func Or[M any](ps ...Predicate[M]) Predicate[M]
- func TextBetween[M any, V ~string, R columnRole](c textColumn[M, V, R], a, b V) Predicate[M]
- func TextContains[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Predicate[M]
- func TextEndsWith[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Predicate[M]
- func TextEq[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Predicate[M]
- func TextGt[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Predicate[M]
- func TextGte[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Predicate[M]
- func TextIContains[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Predicate[M]
- func TextIEndsWith[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Predicate[M]
- func TextILike[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Predicate[M]
- func TextIStartsWith[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Predicate[M]
- func TextIn[M any, V ~string, R columnRole](c textColumn[M, V, R], v ...V) Predicate[M]
- func TextLike[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Predicate[M]
- func TextLt[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Predicate[M]
- func TextLte[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Predicate[M]
- func TextNe[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Predicate[M]
- func TextNotIn[M any, V ~string, R columnRole](c textColumn[M, V, R], v ...V) Predicate[M]
- func TextStartsWith[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Predicate[M]
- func TimeBetween[M any, V TimeValue, R columnRole](c timeColumn[M, V, R], a, b V) Predicate[M]
- func TimeEq[M any, V TimeValue, R columnRole](c timeColumn[M, V, R], v V) Predicate[M]
- func TimeGt[M any, V TimeValue, R columnRole](c timeColumn[M, V, R], v V) Predicate[M]
- func TimeGte[M any, V TimeValue, R columnRole](c timeColumn[M, V, R], v V) Predicate[M]
- func TimeIn[M any, V TimeValue, R columnRole](c timeColumn[M, V, R], v ...V) Predicate[M]
- func TimeLt[M any, V TimeValue, R columnRole](c timeColumn[M, V, R], v V) Predicate[M]
- func TimeLte[M any, V TimeValue, R columnRole](c timeColumn[M, V, R], v V) Predicate[M]
- func TimeNe[M any, V TimeValue, R columnRole](c timeColumn[M, V, R], v V) Predicate[M]
- func TimeNotIn[M any, V TimeValue, R columnRole](c timeColumn[M, V, R], v ...V) Predicate[M]
- func UUIDGreater[M, T any](column KeyColumn[M, model.ID[T]], v model.ID[T]) Predicate[M]
- func UUIDGreaterOrEqual[M, T any](column KeyColumn[M, model.ID[T]], v model.ID[T]) Predicate[M]
- func UUIDLess[M, T any](column KeyColumn[M, model.ID[T]], v model.ID[T]) Predicate[M]
- func UUIDLessOrEqual[M, T any](column KeyColumn[M, model.ID[T]], v model.ID[T]) Predicate[M]
- func WhereRaw[M any](sql string, args ...any) Predicate[M]
- type Primary
- type Query
- func FoundryOrderBy[M any](q Query[M], o ormcore.Order, seal sqlowner.QuerySeal) Query[M]
- func FoundryWhere[M any](q Query[M], p ormcore.Predicate, seal sqlowner.QuerySeal) Query[M]
- func WithRelationLimits[M any](q Query[M], limits RelationLimits) Query[M]
- func WithScopeContext[M any](q Query[M], ctx context.Context) Query[M]
- func WithoutGlobalScope[M any](q Query[M], scopes ...GlobalScope[M]) Query[M]
- func WithoutGlobalScopes[M any](q Query[M]) Query[M]
- func WithoutModelHooks[M any](q Query[M]) Query[M]
- func (q Query[M]) Limit(n int) Query[M]
- func (q Query[M]) Offset(n int) Query[M]
- func (q Query[M]) OnlyTrashed() Query[M]
- func (q Query[M]) OrderBy(os ...Order[M]) Query[M]
- func (q Query[M]) Where(ps ...Predicate[M]) Query[M]
- func (q Query[M]) With(rels ...Relation[M]) Query[M]
- func (q Query[M]) WithTrashed() Query[M]
- func (q Query[M]) WithoutTrashed() Query[M]
- type RelatedLookup
- func (l RelatedLookup[P, M, K]) Find(ctx context.Context, ex database.Executor, parent P, key K) (value.Optional[M], error)
- func (RelatedLookup[P, M, K]) Format(s fmt.State, _ rune)
- func (RelatedLookup[P, M, K]) GoString() string
- func (RelatedLookup[P, M, K]) String() string
- func (l RelatedLookup[P, M, K]) Validate() error
- type Relation
- type RelationLimits
- type RetrievalHooks
- type RetrievalObserver
- type SimplePage
- type Slot
- type SoftDeletable
- type SoftDelete
- type SourceKey
- type Statement
- type Table
- type Text
- type TextExpressionColumn
- type TextLookupKey
- type TextPrimary
- type Through
- type ThroughRelation
- func ManyToManyOf[M, N, P any, A, B comparable](slot Through[M, N, P], local KeyColumn[M, A], pivotLocal KeyColumn[P, A], ...) ThroughRelation[M, N, P]
- func MorphToManyOf[M model.Morphable, N, P any, A, B comparable](slot Through[M, N, P], local KeyColumn[M, A], pivotLocal KeyColumn[P, A], ...) ThroughRelation[M, N, P]
- func MorphedByManyOf[M any, N model.Morphable, P any, A, B comparable](slot Through[M, N, P], local KeyColumn[M, A], pivotLocal KeyColumn[P, A], ...) ThroughRelation[M, N, P]
- func WithRelationWriteLimit[M, N, P any](r ThroughRelation[M, N, P], limit int) ThroughRelation[M, N, P]
- func WithoutPivotGlobalScope[M, N, P any](r ThroughRelation[M, N, P], scopes ...GlobalScope[P]) ThroughRelation[M, N, P]
- func WithoutPivotGlobalScopes[M, N, P any](r ThroughRelation[M, N, P]) ThroughRelation[M, N, P]
- func (r ThroughRelation[M, N, P]) OnlyTrashed() ThroughRelation[M, N, P]
- func (r ThroughRelation[M, N, P]) OnlyTrashedPivot() ThroughRelation[M, N, P]
- func (r ThroughRelation[M, N, P]) OrderBy(orders ...Order[N]) ThroughRelation[M, N, P]
- func (r ThroughRelation[M, N, P]) OrderByPivot(orders ...Order[P]) ThroughRelation[M, N, P]
- func (r ThroughRelation[M, N, P]) Where(ps ...Predicate[N]) ThroughRelation[M, N, P]
- func (r ThroughRelation[M, N, P]) WherePivot(ps ...Predicate[P]) ThroughRelation[M, N, P]
- func (r ThroughRelation[M, N, P]) With(children ...Relation[N]) ThroughRelation[M, N, P]
- func (r ThroughRelation[M, N, P]) WithPivot(children ...Relation[P]) ThroughRelation[M, N, P]
- func (r ThroughRelation[M, N, P]) WithTrashed() ThroughRelation[M, N, P]
- func (r ThroughRelation[M, N, P]) WithTrashedPivot() ThroughRelation[M, N, P]
- func (r ThroughRelation[M, N, P]) WithoutTrashed() ThroughRelation[M, N, P]
- func (r ThroughRelation[M, N, P]) WithoutTrashedPivot() ThroughRelation[M, N, P]
- type Time
- type TimeValue
- type UpdateMapping
- type UpdateSource
- func (p UpdateSource[S, M]) Exec(ctx context.Context, writer database.Transactor) (int64, error)
- func (UpdateSource[S, M]) Format(s fmt.State, _ rune)
- func (p UpdateSource[S, M]) Match(key SourceKey[S, M]) UpdateSource[S, M]
- func (p UpdateSource[S, M]) Returning(ctx context.Context, writer database.Transactor, limit int) ([]M, error)
- func (p UpdateSource[S, M]) Select(mappings ...UpdateMapping[S, M]) UpdateSource[S, M]
- func (p UpdateSource[S, M]) Values(values ...Assignment[M]) UpdateSource[S, M]
- type UpdateTarget
- type UpdatedAt
- type Value
- type ValueLookup
- func (l ValueLookup[M, V]) AllExist(ctx context.Context, ex database.Executor, input []V) (bool, error)
- func (l ValueLookup[M, V]) AnyExist(ctx context.Context, ex database.Executor, input []V) (bool, error)
- func (l ValueLookup[M, V]) Exists(ctx context.Context, ex database.Executor, input V) (bool, error)
- func (l ValueLookup[M, V]) Format(s fmt.State, _ rune)
- func (l ValueLookup[M, V]) GoString() string
- func (ValueLookup[M, V]) String() string
- func (l ValueLookup[M, V]) Validate() error
- type Write
- type WriteError
Constants ¶
const DefaultChunkSize = querycore.DefaultChunkSize
DefaultChunkSize is the closed-batch size used by model iteration with eager relations or retrieval callbacks.
const MaxChunkSize = querycore.MaxChunkSize
MaxChunkSize is the existing bound on one model batch.
const MaxCursorBytes = querycore.MaxCursorBytes
MaxCursorBytes bounds the encoded cursor token accepted by ParseCursor.
const MaxCursorFields = querycore.MaxCursorFields
MaxCursorFields bounds the ordered fields in one cursor key.
const MaxExpressionDepth = querycore.MaxExpressionDepth
MaxExpressionDepth bounds nested expression and SELECT compilation.
const MaxExpressionNodes = querycore.MaxExpressionNodes
MaxExpressionNodes bounds expression and SELECT compilation work.
const MaxIdentityBatch = querycore.MaxIdentityBatch
MaxIdentityBatch bounds keys in one identity observation or extension scope.
const MaxInsertRows = querycore.MaxInsertRows
MaxInsertRows bounds rows in one atomic insert or upsert statement. The statement-wide MaxParameters limit can require smaller batches.
const MaxMembershipValues = querycore.MaxMembershipValues
MaxMembershipValues bounds the values in one membership predicate.
const MaxPageSize = querycore.MaxPageSize
MaxPageSize is the shared pagination bound. Example: size <= orm.MaxPageSize.
const MaxParameters = querycore.MaxParameters
MaxParameters bounds bound parameters across the whole SQL statement.
const MaxPerModelWriteRows = querycore.MaxPerModelWriteRows
MaxPerModelWriteRows bounds one atomic lifecycle batch. Example: limit <= orm.MaxPerModelWriteRows.
const MaxRelationWriteRows = querycore.MaxPerModelWriteRows
MaxRelationWriteRows bounds one atomic relation write. Example: len(targets) <= orm.MaxRelationWriteRows.
const MaxScalarSQLBytes = querycore.MaxScalarSQLBytes
MaxScalarSQLBytes bounds SQL emitted by computed scalar operations.
Variables ¶
var ErrBoundExceeded = safeerror.New("numeric adjustment bound exceeded")
ErrBoundExceeded means a guarded per-key adjustment rejected a visible row. A missing or hidden key returns database.NotFound instead.
Functions ¶
func All ¶ added in v0.2.0
All hydrates complete models, discarding partial results on failure. Example: orm.All(ctx, db, Orders.Query()).
func AllLocked ¶ added in v0.2.0
AllLocked reads locked rows within a transaction. Example: orm.AllLocked(ctx, tx, orm.Lock(Orders.Query())).
func Attach ¶
func Attach[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], source M, target N, create ...Assignment[P]) (P, error)
Attach creates one pivot with omitted endpoint keys supplied from locked models. Example: orm.Attach(ctx,db,UserRelations.Groups,user,group,orm.InputTextSet(Memberships.Role, "member")).
func AttachMany ¶
func AttachMany[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], source M, targets []N, create ...Assignment[P]) ([]P, error)
AttachMany creates one pivot per distinct refreshed target key, retaining duplicate existing links. Example: orm.AttachMany(ctx,db,UserRelations.Groups,user,groups,orm.InputTextSet(Memberships.Role, "member")).
func Audit ¶
func Audit[M any, K comparable](table Table[M, K], changes Changes[M], policy AuditPolicy[M]) (auditrecord.Model[M, K], error)
Audit captures an automatic operation's stored changes without getters, mutators or SQL. Example: history, err := Audit(Orders.Table, changes, AuditPolicy[Order]{}).
func AuditRead ¶
func AuditRead[M, K, V any](history auditrecord.Model[M, K], field interface{ ormColumn(*M) columnData[V] }) (value.Optional[auditrecord.FieldChange[V]], error)
AuditRead reads a required historical field through its stored codec; omitted fields remain absent. Example: field, err := AuditRead(history, NumberExpr(Orders.TotalCents)).
func AuditReadEncrypted ¶
func AuditReadEncrypted[M, K any, V encrypted.Value[V]](history auditrecord.Model[M, K], field Encrypted[M, V]) (value.Optional[auditrecord.FieldChange[V]], error)
AuditReadEncrypted exposes encrypted history's redaction state, never ciphertext or plaintext. Example: field, err := AuditReadEncrypted(history, Vaults.Secret).
func AuditReadNullable ¶
func AuditReadNullable[M, K, V any](history auditrecord.Model[M, K], field interface{ ormColumn(*M) columnData[V] }) (value.Optional[auditrecord.FieldChange[value.Nullable[V]]], error)
AuditReadNullable keeps SQL NULL separate from an omitted field or absent model. Example: field, err := AuditReadNullable(history, NullableTextExpr(Orders.Note)).
func AuditReadNullableEncrypted ¶
func AuditReadNullableEncrypted[M, K any, V encrypted.Value[V]](history auditrecord.Model[M, K], field NullableEncrypted[M, V]) (value.Optional[auditrecord.FieldChange[value.Nullable[V]]], error)
AuditReadNullableEncrypted reads nullable encrypted history without fabricating a value for redaction. Example: field, err := AuditReadNullableEncrypted(history, Vaults.Backup).
func Auditing ¶
func Auditing[M any, K comparable](table Table[M, K], policy AuditPolicy[M]) auditrecord.Declaration
Auditing registers an instance-owned observer through audit.Register, inside the business transaction. Example: audit.Register(r, pool, recorderKey, config, Auditing(Orders.Table, policy)).
func ChangeOf ¶
func ChangeOf[M, V any](changes Changes[M], field interface{ ormColumn(*M) columnData[V] }) (lifecycle.FieldChange[V], error)
ChangeOf selects a required persisted field with its stored type. Example: ChangeOf(changes, NumberExpr(Orders.TotalCents)).
func Check ¶
func Check(tables ...CheckedTable) error
Check reports every declaration error. Example: if err := Check(Orders); err != nil { return err }.
func Chunk ¶ added in v0.2.0
func Chunk[M any](ctx context.Context, ex database.Executor, q Query[M], size int, yield func([]M) error) error
Chunk reads stable, bounded batches, closing rows before each callback. It preserves the query window and advances by keyset when ordering permits; explicit NULL placement falls back to offsets. It does not create a snapshot.
func ChunkByKey ¶
func ChunkByKey[M any, K comparable](ctx context.Context, ex database.Executor, q Query[M], key KeyColumn[M, K], size int, yield func([]M) error) error
ChunkByKey advances by the declared primary key, with rows closed before each callback. Only key ordering and zero Offset are accepted; Limit bounds total delivery. Keys are captured before callbacks. Keep keys stable: batches do not share a snapshot. Example: orm.ChunkByKey(ctx, db, Orders.Query(), Orders.ID, 500, visit).
func Count ¶ added in v0.2.0
Count counts the selected window. Example: orm.Count(ctx, db, Orders.Query()).
func CreateEach ¶
func CreateEach[M any](ctx context.Context, writer database.Transactor, q Query[M], drafts [][]Assignment[M]) ([]M, error)
CreateEach runs each creation lifecycle in one bounded atomic transaction. Unlike InsertMany, callbacks run per model; a valid empty batch performs no SQL. Example: orm.CreateEach(ctx, db, Users.Query(), [][]orm.Assignment[User]{{orm.TextSet(Users.Name, "Ada")}}).
func CreateOrFirst ¶
func CreateOrFirst[M any](ctx context.Context, writer database.Transactor, q Query[M], create ...Assignment[M]) (M, error)
CreateOrFirst creates through the model lifecycle in a savepoint, then reads the first primary-ordered match only if its own INSERT violates a unique index on this table. Failed hooks and uncertain outcomes never trigger recovery or retries. At snapshot isolation a competitor may be invisible; the original violation is then returned. Internal hydration skips Retrieved callbacks. Example: orm.CreateOrFirst(ctx, db, Users.Query().Where(orm.TextEq(Users.Email, email)), orm.TextSet(Users.Name, name)).
func Define ¶
func Define[M any, T CheckedTable](name string, declare func(Builder[M], *M) T, opts ...Option) (result T)
Define binds and seals one table, collecting errors for Check. Example: Define("orders", declare).
func Delete ¶
func Delete[M any, K comparable](ctx context.Context, writer database.Transactor, q Query[M], key Key[M, K], id K) (M, error)
Delete removes one primary key within the query's current visibility and returns its complete model. Declared soft deletion retains the physical row; otherwise deletion is physical. Example: orm.Delete(ctx, db, visible, Users.Key(), id).
func DeleteAll ¶ added in v0.2.0
DeleteAll removes matching rows, respecting soft deletion. Example: orm.DeleteAll(ctx, tx, Orders.Query().Where(orm.KeyEq(Orders.ID, id))).
func DeleteEach ¶
func DeleteEach[M any](ctx context.Context, writer database.Transactor, q Query[M], limit int) ([]M, error)
DeleteEach removes each active candidate through ordinary delete/soft-delete lifecycle callbacks. Overflow fails before callbacks, and later failures roll back the complete batch and its after-commit work. Results follow primary keys. Example: orm.DeleteEach(ctx,db,Notifications.Query().Where(orm.ColumnEq(Notifications.Read, true)),100).
func Detach ¶
func Detach[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], source M, target N) ([]P, error)
Detach removes matching active pivots, retaining soft-delete behavior and lifecycle. Example: orm.Detach(ctx,db,UserRelations.Groups,user,group).
func DetachAll ¶
func DetachAll[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], source M) ([]P, error)
DetachAll removes the source's links selected by pivot filters. Example: orm.DetachAll(ctx,db,UserRelations.Groups,user).
func DetachMany ¶
func DetachMany[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], source M, targets []N) ([]P, error)
DetachMany removes all links to the requested targets within pivot filters. Example: orm.DetachMany(ctx,db,UserRelations.Groups,user,groups).
func Each ¶ added in v0.2.0
Each streams models while rows remain open when retrieval cannot run. Otherwise it uses closed complete batches, dispatching Retrieved before yielding models. Rows yielded before a later failed batch remain yielded.
func EachByKey ¶
func EachByKey[M any, K comparable](ctx context.Context, ex database.Executor, q Query[M], key KeyColumn[M, K], size int, yield func(M) error) error
EachByKey yields individual models from complete primary-key batches. Example: orm.EachByKey(ctx, db, Orders.Query(), Orders.ID, 500, visit).
func EachChunked ¶ added in v0.2.0
func EachChunked[M any](ctx context.Context, ex database.Executor, q Query[M], size int, yield func(M) error) error
EachChunked yields individual models from fully read and closed batches.
func EachLocked ¶ added in v0.2.0
func EachLocked[M any](ctx context.Context, tx *database.Tx, q LockedQuery[M], yield func(M) error) error
EachLocked streams locked models in the transaction.
func EncryptedChangeOf ¶
func EncryptedChangeOf[M any, V encrypted.Value[V]](changes Changes[M], field Encrypted[M, V]) (lifecycle.FieldChange[V], error)
EncryptedChangeOf selects an encrypted field using decoded equality, without binding ciphertext. Example: EncryptedChangeOf(changes, Vaults.Secret).
func Exists ¶ added in v0.2.0
Exists checks the selected window. Example: orm.Exists(ctx, db, Orders.Query()).
func Find ¶ added in v0.2.0
func Find[M any, K comparable](ctx context.Context, ex database.Executor, t Table[M, K], key K) (value.Optional[M], error)
Find selects by a typed primary key. Example: orm.Find(ctx, db, Orders.Table, id).
func First ¶ added in v0.2.0
First returns an omitted Optional on no match. Example: orm.First(ctx, db, Orders.Query()).
func FirstLocked ¶ added in v0.2.0
func FirstLocked[M any](ctx context.Context, tx *database.Tx, q LockedQuery[M]) (value.Optional[M], error)
FirstLocked reads at most one locked row. Example: orm.FirstLocked(ctx, tx, orm.ForShare(Orders.Query())).
func FirstOrCreate ¶
func FirstOrCreate[M any](ctx context.Context, writer database.Transactor, q Query[M], create ...Assignment[M]) (M, error)
FirstOrCreate locks the first primary-ordered match or creates through its lifecycle. Equality filters and scopes default omitted stored fields; mutator inputs need explicit assignments. Concurrent absence relies on unique constraints, without retries. Internal reads skip Retrieved. Example: orm.FirstOrCreate(ctx, db, Users.Query().Where(orm.TextEq(Users.Email, email)), orm.TextSet(Users.Name, name)).
func ForceDelete ¶
func ForceDelete[M any, K comparable](ctx context.Context, writer database.Transactor, q Query[M], soft SoftDeletable[M], key Key[M, K], id K) (M, error)
ForceDelete physically deletes one key within the query's current visibility. Example: ForceDelete(ctx,db,Orders.Query().WithTrashed(),Orders.Soft,Orders.Key(),id).
func ForceDeleteAll ¶ added in v0.2.0
func ForceDeleteAll[M any](ctx context.Context, tx database.Transactor, q Query[M], soft SoftDeletable[M]) (int64, error)
ForceDeleteAll physically deletes matching rows within the selected scope.
func ForceDeleteEach ¶
func ForceDeleteEach[M any](ctx context.Context, writer database.Transactor, q Query[M], soft SoftDeletable[M], limit int) ([]M, error)
ForceDeleteEach physically deletes selected soft-delete models in one bounded transaction, preserving the query's visibility and running each force-delete lifecycle. Returned models describe their persisted state before deletion. Example: orm.ForceDeleteEach(ctx, db, Users.Query().OnlyTrashed(), Users.Soft, 100).
func ForceDetach ¶
func ForceDetach[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], soft SoftDeletable[P], source M, target N) ([]P, error)
ForceDetach physically removes matching soft-delete pivots in the selected visibility. Example: orm.ForceDetach(ctx,db,UserRelations.Groups.WithTrashedPivot(),Memberships.Soft,user,group).
func ForcePruneBatch ¶
func ForcePruneBatch[M any](ctx context.Context, writer database.Transactor, q Query[M], soft SoftDeletable[M], size int, mass bool) (int64, error)
ForcePruneBatch physically removes a bounded soft-model batch within its visibility. Mass acknowledges skipping hooks, observers and change capture; selection still locks rows. Example: orm.ForcePruneBatch(ctx, db, Users.Query().OnlyTrashed(), Users.Soft, 100, false).
func FoundryCodec ¶
func FoundryCodec[V any](option ColumnOption[V], seal sqlowner.MetadataSeal) codec.Codec[V]
FoundryCodec supplies an explicit codec option to the row declaration package. Example: FoundryCodec(option, sqlowner.Metadata()).
func FoundryColumn ¶
func FoundryColumn[M, V, P any](column ExpressionColumn[M, V, P], seal sqlowner.MetadataSeal) (ormcore.Column[V], ormcore.Column[P])
FoundryColumn supplies comparison and projection codecs to expr/rows.
func FoundryConflictData ¶
func FoundryConflictData[M any](policy Conflict[M], seal sqlowner.ExpressionSeal) ormcore.ConflictPolicy
FoundryConflictData supplies policy data to the expression owner. Example: FoundryConflictData(policy,sqlowner.Expressions()).
func FoundryLockedRecord ¶
func FoundryLockedRecord[M any](q LockedQuery[M], seal sqlowner.MetadataSeal) ormcore.RecordSource
FoundryLockedRecord retains the model's lock inside a transaction-only record. Example: FoundryLockedRecord(orm.Lock(Orders.Query()),sqlowner.Metadata()).
func FoundryModel ¶
func FoundryModel[M any](q Query[M], seal sqlowner.MetadataSeal) (ormcore.Source, func(database.Row) (M, error))
FoundryModel supplies a validated model source and its existing hydration codec. Example: FoundryModel(q,sqlowner.Metadata()).
func FoundryModelRead ¶
func FoundryModelRead[M any](q Query[M], seal sqlowner.MetadataSeal) ormcore.RecordSource
FoundryModelRead retains complete hydration, retrieval and eager-load ownership. Example: FoundryModelRead(Users.Query().With(UserRelations.Orders),sqlowner.Metadata()).
func FoundryPredicate ¶
FoundryPredicate retains model declaration ownership in a projection. Example: FoundryPredicate(p,sqlowner.Metadata()).
func FoundryRecord ¶
FoundryRecord supplies complete model metadata through the validated metadata family. Example: FoundryRecord[Order](scope,sqlowner.Metadata()).
func FoundryRelatedValue ¶
func FoundryRelatedValue[M, N, V any](source AggregateSource[M, N], expression ormcore.Expression, column ormcore.Column[V], seal sqlowner.ExpressionSeal) ormcore.Expression
FoundryRelatedValue retains validated relation ownership in a row expression. Example: FoundryRelatedValue(source,expression,column,sqlowner.Expressions()).
func FoundrySlot ¶
func FoundrySlot[M any, K comparable, S any](key Key[M, K], slot Slot[M, S], seal sqlowner.MetadataSeal) (string, func(M) model.Reference[M, K], func(M) S, func(M, S) M, error)
FoundrySlot provides typed accessors only to framework metadata adapters. Example: orm.FoundrySlot(Articles.Key(),Articles.Title,sqlowner.Metadata()).
func FoundrySource ¶
FoundrySource supplies sealed model AST metadata to rows. Example: FoundrySource(Orders.Query(),sqlowner.Metadata()).
func Insert ¶ added in v0.2.0
func Insert[M any, K comparable](ctx context.Context, tx database.Transactor, t Table[M, K], as ...Assignment[M]) (M, error)
Insert creates and hydrates one model. Example: orm.Insert(ctx, tx, Orders.Table, orm.NumberSet(Orders.TotalCents, 10), orm.ColumnSet(Orders.BuyerID, buyer)).
func InsertEach ¶
func InsertEach[M any, K comparable](ctx context.Context, writer database.Transactor, table Table[M, K], rows [][]Assignment[M]) ([]M, error)
InsertEach runs each row's ordinary lifecycle in one bounded transaction. A nested caller gets one savepoint for the batch, never one per row. Example: orm.InsertEach(ctx,db,Users.Table,[][]orm.Assignment[User]{{orm.TextSet(Users.Name, "Ada")}}).
func InsertMany ¶ added in v0.2.0
func InsertMany[M any, K comparable](ctx context.Context, tx database.Transactor, t Table[M, K], rows [][]Assignment[M]) ([]M, error)
InsertMany inserts one bounded atomic batch and hydrates RETURNING rows.
func KeyExpr ¶ added in v0.2.0
func KeyExpr[M any, K comparable, R columnRole](c keyColumn[M, K, R]) keyColumnAdapter[M, K, R]
KeyExpr opts into the column's sealed expression/source capabilities. Example: KeyExpr(column).
func LoadFrom ¶
func LoadFrom[M any](ctx context.Context, ex database.Executor, q Query[M], parents []M) ([]M, error)
LoadFrom loads the query's relations onto copies of existing parents using its relation limits. Parent filters and windows are validated but do not re-fetch or filter supplied models. Errors publish no partial result. Example: loaded, err := orm.LoadFrom(ctx, db, q.With(OrderRelations.Buyer), orders).
func LoadMissingFrom ¶
func LoadMissingFrom[M any](ctx context.Context, ex database.Executor, q Query[M], parents []M) ([]M, error)
LoadMissingFrom uses the query's relation limits while preserving loaded slots, including loaded-empty slots. It performs no parent statement. Example: loaded, err := orm.LoadMissingFrom(ctx, db, q.With(OrderRelations.Buyer), orders).
func NullableChangeOf ¶
func NullableChangeOf[M, V any](changes Changes[M], field interface{ ormColumn(*M) columnData[V] }) (lifecycle.FieldChange[value.Nullable[V]], error)
NullableChangeOf retains SQL NULL independently of model existence. Example: NullableChangeOf(changes, NullableInputTextExpr(Members.Note)).
func NullableEncryptedChangeOf ¶
func NullableEncryptedChangeOf[M any, V encrypted.Value[V]](changes Changes[M], field NullableEncrypted[M, V]) (lifecycle.FieldChange[value.Nullable[V]], error)
NullableEncryptedChangeOf retains nullable encrypted snapshots without exposing predicates. Example: NullableEncryptedChangeOf(changes, Vaults.Backup).
func NullableTimeExpr ¶ added in v0.2.0
func NullableTimeExpr[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R]) nullableTimeColumnAdapter[M, V, R]
NullableTimeExpr opts into the column's sealed expression/source capabilities. Example: NullableTimeExpr(column).
func NumberExpr ¶ added in v0.2.0
func NumberExpr[M any, V NumberValue, R columnRole](c numberColumn[M, V, R]) numberColumnAdapter[M, V, R]
NumberExpr opts into the column's sealed expression/source capabilities. Example: NumberExpr(column).
func NumberKey ¶
func NumberKey[M any, K interface { NumberValue comparable }, R keyRole](key keyColumn[M, K, R]) numberKeyColumn[M, K, R]
NumberKey derives numeric capabilities without binding the field again.
func NumberKeyExpr ¶ added in v0.2.0
func NumberKeyExpr[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R]) numberKeyColumnAdapter[M, V, R]
NumberKeyExpr opts into the column's sealed expression/source capabilities. Example: NumberKeyExpr(column).
func PruneBatch ¶
func PruneBatch[M any](ctx context.Context, writer database.Transactor, q Query[M], size int, mass bool) (int64, error)
PruneBatch physically removes at most size ordinary models in primary-key order. Mass explicitly skips per-model callbacks; otherwise ordinary deletion lifecycle runs. Soft-delete declarations require ForcePruneBatch and their declaration token. Example: orm.PruneBatch(ctx, db, Logs.Query().Where(orm.ColumnEq(Logs.Expired, true)), 100, false).
func Raw ¶ added in v0.2.0
func Raw[M any, K comparable](ctx context.Context, ex database.Executor, t Table[M, K], sql string, args ...any) ([]M, error)
Raw hydrates the exact declared column set, matched by name in any order. It applies NO scopes, including soft-delete and tenant/global scopes, and uses ex directly without read routing: raw SQL may write. Supply bound arguments. Example: orm.Raw(ctx, tx, Orders.Table, "UPDATE orders SET total_cents=$1 RETURNING *", cents). Retrieved hooks and observers run after complete hydration and row closure. Decode/open/hook failure discards results; this does not imply a raw write rolled back.
func RegisterObserver ¶
func RegisterObserver[M any](r *foundation.Registrar, pool foundation.Key[*database.DB], observer Observer[M], construct func(foundation.Resolver) (func() Hooks[M], error)) error
RegisterObserver installs instance-owned dependencies through a database Module. Example: RegisterObserver(r, pool, NewObserver[Order]("orders.audit"), constructOrderAudit).
func RegisterRetrievalObserver ¶
func RegisterRetrievalObserver[M any](r *foundation.Registrar, pool foundation.Key[*database.DB], observer RetrievalObserver[M], construct func(foundation.Resolver) (func() RetrievalHooks[M], error)) error
RegisterRetrievalObserver constructs dependencies once during application assembly. Example: RegisterRetrievalObserver(r, pool, NewRetrievalObserver[Order]("orders.read"), constructOrderReads).
func Require ¶ added in v0.2.0
Require returns database.NotFound on no match. Example: orm.Require(ctx, db, Orders.Query()).
func RequireKey ¶ added in v0.2.0
func RequireKey[M any, K comparable](ctx context.Context, ex database.Executor, t Table[M, K], key K) (M, error)
RequireKey selects a key or returns database.NotFound. Example: orm.RequireKey(ctx, db, Orders.Table, id).
func RequireLocked ¶ added in v0.2.0
RequireLocked reads one locked row or fails. Example: orm.RequireLocked(ctx, tx, orm.Lock(Orders.Query())).
func Restore ¶ added in v0.2.0
func Restore[M any, K comparable](ctx context.Context, tx database.Transactor, t Table[M, K], key K) (M, error)
Restore clears the deletion instant of one deleted key.
func RestoreEach ¶
func RestoreEach[M any](ctx context.Context, writer database.Transactor, q Query[M], soft SoftDeletable[M], limit int) ([]M, error)
RestoreEach restores the selected deleted models in one bounded transaction. It retains predicates, selects only trashed rows, and runs each restore lifecycle. Example: orm.RestoreEach(ctx, db, Users.Query(), Users.Soft, 100).
func TextExpr ¶ added in v0.2.0
TextExpr opts into the column's sealed expression/source capabilities. Example: TextExpr(column).
func TimeExpr ¶ added in v0.2.0
TimeExpr opts into the column's sealed expression/source capabilities. Example: TimeExpr(column).
func Update ¶
func Update[M any, K comparable](ctx context.Context, writer database.Transactor, q Query[M], key Key[M, K], id K, assignments ...Assignment[M]) (M, error)
Update patches one primary key within the query's current visibility and hydrates its complete returned model. Scope predicates, lifecycle and cardinality checks remain active. Example: orm.Update(ctx, db, visible, Users.Key(), id, orm.TextSet(Users.Name, "Ada")).
func UpdateAll ¶ added in v0.2.0
func UpdateAll[M any](ctx context.Context, tx database.Transactor, q Query[M], as ...Assignment[M]) (int64, error)
UpdateAll patches every matching row. Example: orm.UpdateAll(ctx, tx, Orders.Query().Where(orm.NumberEq(Orders.TotalCents, 0)), orm.NumberSet(Orders.TotalCents, 1)).
func UpdateEach ¶
func UpdateEach[M any](ctx context.Context, writer database.Transactor, q Query[M], limit int, draft func(context.Context, *database.Tx, M) ([]Assignment[M], error)) ([]M, error)
UpdateEach locks the complete candidate set in primary-key order, then derives typed assignments and runs each ordinary model lifecycle in one transaction. Read ordering, pagination, eager loading and WithoutModelHooks are rejected. The callback gets the actual transaction; propagate its context to nested work. Example: orm.UpdateEach(ctx,db,Users.Query(),100,func(ctx context.Context,tx *database.Tx,u User)([]orm.Assignment[User],error){return []orm.Assignment[User]{orm.TextSet(Users.Name, u.Name)},nil}).
func UpdateOrCreate ¶
func UpdateOrCreate[M any](ctx context.Context, writer database.Transactor, q Query[M], create []Assignment[M], update func(context.Context, *database.Tx, M) ([]Assignment[M], error)) (M, error)
UpdateOrCreate patches the first locked match or creates from separate inputs. Only the chosen branch prepares its assignments. Read windows and eager loads are rejected. Example: orm.UpdateOrCreate(ctx,db,Users.Query(),create,func(ctx context.Context,tx *database.Tx,u User)([]orm.Assignment[User],error){return []orm.Assignment[User]{orm.TextSet(Users.Name, "Ada")},nil}).
func UpdatePivot ¶
func UpdatePivot[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], source M, target N, update ...Assignment[P]) ([]P, error)
UpdatePivot patches every matching pivot to one target, including duplicate links. Example: orm.UpdatePivot(ctx,db,links,user,group,orm.InputTextSet(Memberships.Role, "admin")).
func Upsert ¶
func Upsert[M any](ctx context.Context, writer database.Transactor, q Query[M], policy Conflict[M], assignments ...Assignment[M]) (value.Optional[M], error)
Upsert inserts or applies a conflict policy. Skipped rows return an omitted value. Like the old upsert API, it transforms inputs but skips per-model hooks and observers. Example: orm.Upsert(ctx,db,Users.Query(),policy,orm.TextSet(Users.Email, "ada@example.test")).
func UpsertMany ¶
func UpsertMany[M any](ctx context.Context, writer database.Transactor, q Query[M], policy Conflict[M], rows [][]Assignment[M]) ([]M, error)
UpsertMany applies one reusable policy to a bounded atomic batch. Skipped rows are absent; RETURNING order is not an input-row mapping. Per-model callbacks are skipped. Example: orm.UpsertMany(ctx,db,Users.Query(),policy,[][]orm.Assignment[User]{{orm.TextSet(Users.Email, "ada@example.test")}}).
func WithoutRelationGlobalScope ¶
func WithoutRelationGlobalScope[M, N any, R scopeRelation[M, N, R]](r R, scopes ...GlobalScope[N]) R
WithoutRelationGlobalScope removes named target defaults without changing the relation kind or its pivot defaults. Example: WithoutRelationGlobalScope(UserRelations.Orders, orderTenantScope).Where(orm.ColumnEq(Orders.Active, true)).
func WithoutRelationGlobalScopes ¶
func WithoutRelationGlobalScopes[M, N any, R scopeRelation[M, N, R]](r R) R
WithoutRelationGlobalScopes removes all target defaults from this descriptor. Example: WithoutRelationGlobalScopes(UserRelations.Orders).
func WriteGet ¶
func WriteGet[M, I any](write *Write[M], setter func(I) Assignment[M]) value.Optional[I]
WriteGet reads a required field's input without running its mutator. Example: input, supplied := WriteGet(write, func(v EmailInput) Assignment[Member] { return InputTextSet(Members.Email, v) }).Get().
func WriteIsSet ¶
func WriteIsSet[M, I any](write *Write[M], setter func(I) Assignment[M]) bool
WriteIsSet reports assignment independently of input value or NULL. Example: WriteIsSet(write, func(v LabelInput) Assignment[Member] { return NullableInputTextSet(Members.Note, v) }).
func WriteNullableGet ¶
func WriteNullableGet[M, I any](write *Write[M], setter func(I) Assignment[M]) value.Optional[value.Nullable[I]]
WriteNullableGet preserves omission, SQL NULL and the distinct mutation input. Example: input := WriteNullableGet(write, func(v LabelInput) Assignment[Member] { return NullableInputTextSet(Members.Note, v) }).
func WriteSet ¶
func WriteSet[M any](write *Write[M], assignments ...Assignment[M]) error
WriteSet replaces assigned fields; omission remains distinct from zero and NULL. Example: WriteSet(write, InputTextSet(Members.Name, ""), NullableInputTextSetNull(Members.Note)).
func WriteUnset ¶
func WriteUnset[M, I any](write *Write[M], setter func(I) Assignment[M]) error
WriteUnset removes a pending assignment; the field becomes omitted, not NULL or zero. Unsetting an omitted field is a no-op. Later hooks may assign it again, and conventions may supply an automatic value. Use only during a before-write callback. Example: WriteUnset(write, func(v EmailInput) Assignment[Member] { return InputTextSet(Members.Email, v) }).
Types ¶
type AggregateRelation ¶
type AggregateRelation[M, V any] struct { // contains filtered or unexported fields }
AggregateRelation loads a typed computation into a model slot. Example: Users.Query().With(UserAggregates.OrdersCount).
func FoundryRelated ¶
func FoundryRelated[M, N, V any](source AggregateSource[M, N], expression ormcore.Expression, column ormcore.Column[V], seal sqlowner.ExpressionSeal) AggregateRelation[M, V]
FoundryRelated binds validated expression metadata to a sealed relation source. Example: orm.FoundryRelated(source,expression,column,sqlowner.Expressions()).
func (AggregateRelation[M, V]) Using ¶
func (r AggregateRelation[M, V]) Using(computation AggregateRelation[M, V]) AggregateRelation[M, V]
Using replaces the computation while retaining this descriptor's slot. Example: UserAggregates.OrdersCount.Using(expr.Related(filtered,expr.Count[Order]())).
type AggregateSource ¶
type AggregateSource[M, N any] interface { // contains filtered or unexported methods }
AggregateSource seals the parent and measured model of a relation computation. Example: func count[M,N any](r orm.AggregateSource[M,N]).
func Pivot ¶
func Pivot[M, N, P any](r ThroughRelation[M, N, P]) AggregateSource[M, P]
Pivot measures a relation's pivot while preserving both sides' scopes. Example: expr.Related(orm.Pivot(UserRelations.Groups),expr.Count[Membership]()).
type Assignment ¶
type Assignment[M any] struct { // contains filtered or unexported fields }
Assignment preserves omitted/null/value semantics. Example: orm.NumberSet(Orders.TotalCents, 0).
func ColumnSet ¶ added in v0.2.0
func ColumnSet[M, V any](c Column[M, V], v V) Assignment[M]
ColumnSet assigns a value, including zero. Example: ColumnSet(Orders.BuyerID, userID).
func EncryptedSet ¶ added in v0.2.0
func EncryptedSet[M any, V encrypted.Value[V]](c Encrypted[M, V], v V) Assignment[M]
EncryptedSet captures a typed value for sealing inside the write transaction. Example: EncryptedSet(Vaults.Secret, encrypted.NewText("private")).
func EnumSet ¶ added in v0.2.0
func EnumSet[M any, E enum.Scalar](c Enum[M, E], v E) Assignment[M]
EnumSet assigns a value, including zero. Example: EnumSet(Users.Status, StatusActive).
func InputColumnSet ¶ added in v0.2.0
func InputColumnSet[M, I any, V any](c InputColumn[M, I, V], v I) Assignment[M]
InputColumnSet captures a typed input without invoking its transform. Example: InputColumnSet(members.Email, EmailInput{Address: "ada@example.test"}).
func InputEnumSet ¶ added in v0.2.0
func InputEnumSet[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c InputEnum[M, I, E], v I) Assignment[M]
InputEnumSet captures a typed input without invoking its transform. Example: InputEnumSet(members.Status, StatusInput{Value: StatusActive}).
func InputIntervalSet ¶ added in v0.2.0
func InputIntervalSet[M, I any](c InputInterval[M, I], v I) Assignment[M]
InputIntervalSet captures a typed input without invoking its transform. Example: InputIntervalSet(bookings.Period, PeriodInput{Days: 1}).
func InputJSONSet ¶ added in v0.2.0
func InputJSONSet[M, I any, T any](c InputJSON[M, I, T], v I) Assignment[M]
InputJSONSet captures a typed input without invoking its transform. Example: InputJSONSet(members.Settings, PreferencesInput{Theme: "dark"}).
func InputKeySet ¶ added in v0.2.0
func InputKeySet[M, I any, K comparable](c InputKey[M, I, K], v I) Assignment[M]
InputKeySet captures fresh input. Example: InputKeySet(users.ID, FreshID{Value: storedID}).
func InputNumberSet ¶ added in v0.2.0
func InputNumberSet[M, I any, V NumberValue](c InputNumber[M, I, V], v I) Assignment[M]
InputNumberSet captures a typed input without invoking its transform. Example: InputNumberSet(invoices.Amount, AmountInput{Cents: 100}).
func InputTextSet ¶ added in v0.2.0
func InputTextSet[M, I any, V ~string](c InputText[M, I, V], v I) Assignment[M]
InputTextSet captures a typed input without invoking its transform. Example: InputTextSet(members.Email, EmailInput{Address: "ada@example.test"}).
func InputTimeSet ¶ added in v0.2.0
func InputTimeSet[M, I any, V TimeValue](c InputTime[M, I, V], v I) Assignment[M]
InputTimeSet captures a typed input without invoking its transform. Example: InputTimeSet(events.StartsAt, TimestampInput{Time: startsAt}).
func IntervalSet ¶ added in v0.2.0
func IntervalSet[M any](c Interval[M], v temporal.Interval) Assignment[M]
IntervalSet assigns a value, including zero. Example: IntervalSet(Records.Period, period).
func JSONSet ¶ added in v0.2.0
func JSONSet[M, T any](c JSON[M, T], v value.JSON[T]) Assignment[M]
JSONSet assigns a valid JSON document; zero value.JSON is rejected without sending SQL. Example: JSONSet(Records.Settings, settings).
func KeySet ¶ added in v0.2.0
func KeySet[M any, K comparable, R columnRole](c keyColumn[M, K, R], v K) Assignment[M]
KeySet assigns a value, including zero. Example: KeySet(Orders.ID, id).
func NullableColumnSet ¶ added in v0.2.0
func NullableColumnSet[M, V any](c NullableColumn[M, V], v V) Assignment[M]
NullableColumnSet assigns a value, including zero. Example: NullableColumnSet(Users.IntroducerID, userID).
func NullableColumnSetNull ¶ added in v0.2.0
func NullableColumnSetNull[M, V any](c NullableColumn[M, V]) Assignment[M]
NullableColumnSetNull explicitly clears this field. Example: NullableColumnSetNull(Users.IntroducerID).
func NullableEncryptedSet ¶ added in v0.2.0
func NullableEncryptedSet[M any, V encrypted.Value[V]](c NullableEncrypted[M, V], v V) Assignment[M]
NullableEncryptedSet captures a present encrypted value. Example: NullableEncryptedSet(Vaults.Backup, encrypted.NewText("private")).
func NullableEncryptedSetNull ¶ added in v0.2.0
func NullableEncryptedSetNull[M any, V encrypted.Value[V]](c NullableEncrypted[M, V]) Assignment[M]
NullableEncryptedSetNull clears the encrypted column inside a keyed write. Example: NullableEncryptedSetNull(Vaults.Backup).
func NullableEnumSet ¶ added in v0.2.0
func NullableEnumSet[M any, E enum.Scalar](c NullableEnum[M, E], v E) Assignment[M]
NullableEnumSet assigns a value, including zero. Example: NullableEnumSet(optionalStatus, StatusActive) (optionalStatus is orm.NullableEnum[User, Status]).
func NullableEnumSetNull ¶ added in v0.2.0
func NullableEnumSetNull[M any, E enum.Scalar](c NullableEnum[M, E]) Assignment[M]
NullableEnumSetNull explicitly clears this field. Example: NullableEnumSetNull(optionalStatus) (optionalStatus is orm.NullableEnum[User, Status]).
func NullableInputColumnSet ¶ added in v0.2.0
func NullableInputColumnSet[M, I any, V any](c NullableInputColumn[M, I, V], v I) Assignment[M]
NullableInputColumnSet captures a typed input without invoking its transform. Example: NullableInputColumnSet(members.Note, LabelInput{Text: "ada@example.test"}).
func NullableInputColumnSetNull ¶ added in v0.2.0
func NullableInputColumnSetNull[M, I any, V any](c NullableInputColumn[M, I, V]) Assignment[M]
NullableInputColumnSetNull retains the stored column operation; Set alone accepts I. Example: NullableInputColumnSetNull(members.Note).
func NullableInputEnumSet ¶ added in v0.2.0
func NullableInputEnumSet[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c NullableInputEnum[M, I, E], v I) Assignment[M]
NullableInputEnumSet captures a typed input without invoking its transform. Example: NullableInputEnumSet(members.OptionalStatus, StatusInput{Value: StatusActive}).
func NullableInputEnumSetNull ¶ added in v0.2.0
func NullableInputEnumSetNull[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c NullableInputEnum[M, I, E]) Assignment[M]
NullableInputEnumSetNull retains the stored enum operation; Set alone accepts I. Example: NullableInputEnumSetNull(members.OptionalStatus).
func NullableInputIntervalSet ¶ added in v0.2.0
func NullableInputIntervalSet[M, I any](c NullableInputInterval[M, I], v I) Assignment[M]
NullableInputIntervalSet captures a typed input without invoking its transform. Example: NullableInputIntervalSet(bookings.OptionalPeriod, PeriodInput{Days: 1}).
func NullableInputIntervalSetNull ¶ added in v0.2.0
func NullableInputIntervalSetNull[M, I any](c NullableInputInterval[M, I]) Assignment[M]
NullableInputIntervalSetNull retains the stored interval operation; Set alone accepts I. Example: NullableInputIntervalSetNull(bookings.OptionalPeriod).
func NullableInputJSONSet ¶ added in v0.2.0
func NullableInputJSONSet[M, I any, T any](c NullableInputJSON[M, I, T], v I) Assignment[M]
NullableInputJSONSet captures a typed input without invoking its transform. Example: NullableInputJSONSet(members.BackupSettings, PreferencesInput{Theme: "dark"}).
func NullableInputJSONSetNull ¶ added in v0.2.0
func NullableInputJSONSetNull[M, I any, T any](c NullableInputJSON[M, I, T]) Assignment[M]
NullableInputJSONSetNull retains the stored json operation; Set alone accepts I. Example: NullableInputJSONSetNull(members.BackupSettings).
func NullableInputNumberSet ¶ added in v0.2.0
func NullableInputNumberSet[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v I) Assignment[M]
NullableInputNumberSet captures a typed input without invoking its transform. Example: NullableInputNumberSet(invoices.OptionalAmount, AmountInput{Cents: 100}).
func NullableInputNumberSetNull ¶ added in v0.2.0
func NullableInputNumberSetNull[M, I any, V NumberValue](c NullableInputNumber[M, I, V]) Assignment[M]
NullableInputNumberSetNull retains the stored number operation; Set alone accepts I. Example: NullableInputNumberSetNull(invoices.OptionalAmount).
func NullableInputTextSet ¶ added in v0.2.0
func NullableInputTextSet[M, I any, V ~string](c NullableInputText[M, I, V], v I) Assignment[M]
NullableInputTextSet captures a typed input without invoking its transform. Example: NullableInputTextSet(members.Note, LabelInput{Text: "ada@example.test"}).
func NullableInputTextSetNull ¶ added in v0.2.0
func NullableInputTextSetNull[M, I any, V ~string](c NullableInputText[M, I, V]) Assignment[M]
NullableInputTextSetNull retains the stored text operation; Set alone accepts I. Example: NullableInputTextSetNull(members.Note).
func NullableInputTimeSet ¶ added in v0.2.0
func NullableInputTimeSet[M, I any, V TimeValue](c NullableInputTime[M, I, V], v I) Assignment[M]
NullableInputTimeSet captures a typed input without invoking its transform. Example: NullableInputTimeSet(events.OptionalStartsAt, TimestampInput{Time: startsAt}).
func NullableInputTimeSetNull ¶ added in v0.2.0
func NullableInputTimeSetNull[M, I any, V TimeValue](c NullableInputTime[M, I, V]) Assignment[M]
NullableInputTimeSetNull retains the stored time operation; Set alone accepts I. Example: NullableInputTimeSetNull(events.OptionalStartsAt).
func NullableIntervalSet ¶ added in v0.2.0
func NullableIntervalSet[M any](c NullableInterval[M], v temporal.Interval) Assignment[M]
NullableIntervalSet assigns a value, including zero. Example: NullableIntervalSet(Records.MaybePeriod, period).
func NullableIntervalSetNull ¶ added in v0.2.0
func NullableIntervalSetNull[M any](c NullableInterval[M]) Assignment[M]
NullableIntervalSetNull explicitly clears this field. Example: NullableIntervalSetNull(Records.MaybePeriod).
func NullableJSONSet ¶ added in v0.2.0
func NullableJSONSet[M, T any](c NullableJSON[M, T], v value.JSON[T]) Assignment[M]
NullableJSONSet assigns a valid JSON document; zero value.JSON is rejected without sending SQL. Example: NullableJSONSet(Records.MaybeSettings, settings).
func NullableJSONSetNull ¶ added in v0.2.0
func NullableJSONSetNull[M, T any](c NullableJSON[M, T]) Assignment[M]
NullableJSONSetNull explicitly clears this field. Example: NullableJSONSetNull(Records.MaybeSettings).
func NullableNumberDecrement ¶ added in v0.2.0
func NullableNumberDecrement[M any, V NumberValue](c NullableNumber[M, V], amount V, bound ...Bound[V]) Assignment[M]
NullableNumberDecrement subtracts a strictly positive amount; SQL NULL remains NULL. Example: NullableNumberDecrement(LedgerEntries.Balance, amount, orm.AtLeast(floor)).
func NullableNumberIncrement ¶ added in v0.2.0
func NullableNumberIncrement[M any, V NumberValue](c NullableNumber[M, V], amount V, bound ...Bound[V]) Assignment[M]
NullableNumberIncrement adds a strictly positive amount; SQL NULL remains NULL. Example: NullableNumberIncrement(LedgerEntries.Balance, amount, orm.AtMost(ceiling)).
func NullableNumberSet ¶ added in v0.2.0
func NullableNumberSet[M any, V NumberValue](c NullableNumber[M, V], v V) Assignment[M]
NullableNumberSet assigns a value, including zero. Example: NullableNumberSet(LedgerEntries.Balance, amount).
func NullableNumberSetNull ¶ added in v0.2.0
func NullableNumberSetNull[M any, V NumberValue](c NullableNumber[M, V]) Assignment[M]
NullableNumberSetNull explicitly clears this field. Example: NullableNumberSetNull(LedgerEntries.Balance).
func NullableTextSet ¶ added in v0.2.0
func NullableTextSet[M any, V ~string](c NullableText[M, V], v V) Assignment[M]
NullableTextSet assigns a value, including zero. Example: NullableTextSet(Users.Nickname, "Ada").
func NullableTextSetNull ¶ added in v0.2.0
func NullableTextSetNull[M any, V ~string](c NullableText[M, V]) Assignment[M]
NullableTextSetNull explicitly clears this field. Example: NullableTextSetNull(Users.Nickname).
func NullableTimeSet ¶ added in v0.2.0
func NullableTimeSet[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v V) Assignment[M]
NullableTimeSet assigns a value, including zero. Example: NullableTimeSet(Users.Birthday, birthday).
func NullableTimeSetNull ¶ added in v0.2.0
func NullableTimeSetNull[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R]) Assignment[M]
NullableTimeSetNull explicitly clears this field. Example: NullableTimeSetNull(Users.Birthday).
func NumberDecrement ¶ added in v0.2.0
func NumberDecrement[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], amount V, bound ...Bound[V]) Assignment[M]
NumberDecrement subtracts a strictly positive amount in the UPDATE statement. Example: NumberDecrement(Orders.TotalCents, 50, orm.AtLeast[int64](0)).
func NumberIncrement ¶ added in v0.2.0
func NumberIncrement[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], amount V, bound ...Bound[V]) Assignment[M]
NumberIncrement adds a strictly positive amount in the UPDATE statement. Example: NumberIncrement(Orders.TotalCents, 100, orm.AtMost[int64](1000)).
func NumberKeySet ¶ added in v0.2.0
func NumberKeySet[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v V) Assignment[M]
NumberKeySet assigns a value, including zero. Example: NumberKeySet(Orders.ID, 100).
func NumberSet ¶ added in v0.2.0
func NumberSet[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v V) Assignment[M]
NumberSet assigns a value, including zero. Example: NumberSet(Orders.TotalCents, 100).
func TextSet ¶ added in v0.2.0
func TextSet[M any, V ~string, R columnRole](c textColumn[M, V, R], v V) Assignment[M]
TextSet assigns a value, including zero. Example: TextSet(Users.Email, "@example.com").
func TimeSet ¶ added in v0.2.0
func TimeSet[M any, V TimeValue, R columnRole](c timeColumn[M, V, R], v V) Assignment[M]
TimeSet assigns a value, including zero. Example: TimeSet(createdAt, at) (createdAt is orm.Time[User, time.Time]).
func (Assignment[M]) GoString ¶
func (Assignment[M]) GoString() string
GoString redacts pending values in diagnostics. Example: fmt.Sprintf("%#v", assignment).
func (Assignment[M]) String ¶
func (Assignment[M]) String() string
String redacts pending values. Example: fmt.Sprint(orm.NumberSet(Orders.TotalCents, 10)).
type AuditPolicy ¶
type AuditPolicy[M any] struct { // contains filtered or unexported fields }
AuditPolicy is an immutable model-owned disclosure policy; zero means Automatic for every field. Example: AuditPolicyOf(Orders.Table, AuditField(NullableTextExpr(Orders.Note), record.Exclude)).
func AuditPolicyOf ¶
func AuditPolicyOf[M any, K comparable](table Table[M, K], rules ...AuditRule[M]) AuditPolicy[M]
AuditPolicyOf snapshots field policies; duplicates, foreign fields and hidden primary keys fail registration or capture. Example: AuditPolicyOf(Orders.Table, AuditField(NullableTextExpr(Orders.Note), record.Exclude)).
type AuditRule ¶
type AuditRule[M any] struct { // contains filtered or unexported fields }
AuditRule retains the model owner of a field disclosure. Example: AuditField(NullableTextExpr(Orders.Note), record.Exclude).
func AuditEncryptedField ¶
func AuditEncryptedField[M any, V encrypted.Value[V]](field Encrypted[M, V], disclosure auditrecord.Disclosure) AuditRule[M]
AuditEncryptedField selects exclusion or redaction for an encrypted field; Automatic always redacts. Example: AuditEncryptedField(Vaults.Secret, record.Exclude).
func AuditField ¶
func AuditField[M, V any](field interface{ ormColumn(*M) columnData[V] }, disclosure auditrecord.Disclosure) AuditRule[M]
AuditField selects disclosure for a declared stored column, including nullable and distinct-input columns. Example: AuditField(NullableTextExpr(Orders.Note), record.Redact).
func AuditNullableEncryptedField ¶
func AuditNullableEncryptedField[M any, V encrypted.Value[V]](field NullableEncrypted[M, V], disclosure auditrecord.Disclosure) AuditRule[M]
AuditNullableEncryptedField selects disclosure for a nullable encrypted field. Example: AuditNullableEncryptedField(Vaults.Backup, record.Exclude).
type BelongsTo ¶
type BelongsTo[M, N any] struct { // contains filtered or unexported fields }
BelongsTo loads a singular target using a local FK. Example: OrderRelations.Buyer.
func BelongsToOf ¶
func BelongsToOf[M, N any, K comparable](slot One[M, N], local KeyColumn[M, K], foreign KeyColumn[N, K]) BelongsTo[M, N]
BelongsToOf unifies local and target key types. Example: BelongsToOf(Orders.Buyer,ColumnExpr(Orders.BuyerID),KeyExpr(Users.ID)).
func MorphToOf ¶
func MorphToOf[M any, N model.Morphable, K comparable](slot One[M, N], id KeyColumn[M, K], kind KeyColumn[M, model.MorphName], key KeyColumn[N, K]) BelongsTo[M, N]
MorphToOf loads one concrete target only for matching source rows. Declare one slot per target type. Example: orm.MorphToOf(Notes.Office,orm.TextExpr(Notes.SubjectID),orm.ColumnExpr(Notes.SubjectType),orm.TextExpr(Offices.Code)).
func (BelongsTo[M, N]) LatestOfMany ¶
LatestOfMany chooses the highest target primary key. Example: OrderRelations.Buyer.LatestOfMany().
func (BelongsTo[M, N]) OfMany ¶
OfMany chooses one target per local key using these orders and the primary key. Example: OrderRelations.Buyer.OfMany(orm.KeyAsc(Users.ID)).
func (BelongsTo[M, N]) OldestOfMany ¶
OldestOfMany chooses the lowest target primary key. Example: OrderRelations.Buyer.OldestOfMany().
func (BelongsTo[M, N]) OnlyTrashed ¶
OnlyTrashed sets target soft-delete visibility. Example: UserRelations.Orders.OnlyTrashed().
func (BelongsTo[M, N]) OrderBy ¶
OrderBy orders related rows with a primary-key tie-breaker. Example: OrderRelations.Buyer.OrderBy(orm.TextAsc(Users.Email)).
func (BelongsTo[M, N]) Where ¶
Where constrains related rows. Example: OrderRelations.Buyer.Where(orm.NumberGt(Users.Age, 18)).
func (BelongsTo[M, N]) With ¶
With batches nested branches over all fetched targets. Example: OrderRelations.Buyer.With(UserRelations.Orders).
func (BelongsTo[M, N]) WithTrashed ¶
WithTrashed sets target soft-delete visibility. Example: UserRelations.Orders.WithTrashed().
func (BelongsTo[M, N]) WithoutTrashed ¶
WithoutTrashed sets target soft-delete visibility. Example: UserRelations.Orders.WithoutTrashed().
type Bound ¶
type Bound[V NumberValue] struct { // contains filtered or unexported fields }
Bound constrains the result of an atomic numeric adjustment. Construct bounds with AtLeast or AtMost; the zero value is invalid. The database evaluates column +/- amount before comparing the bound. int64/float64 overflow returns a database out-of-range error; it never silently passes the guard.
func AtLeast ¶
func AtLeast[V NumberValue](floor V) Bound[V]
AtLeast requires the decremented value to remain at or above floor.
func AtMost ¶
func AtMost[V NumberValue](ceiling V) Bound[V]
AtMost requires the incremented value to remain at or below ceiling.
type Builder ¶
type Builder[M any] struct { // contains filtered or unexported fields }
Builder binds fields during Define. Example: TextOf(b, &o.Email).
type Changes ¶
type Changes[M any] struct { // contains filtered or unexported fields }
Changes contains persisted snapshots, excluding relations and ignored fields. Example: original, exists := changes.Before().Get().
func Compare ¶
func Compare[M any, K comparable](table Table[M, K], before, after value.Optional[M], assigned ...Assignment[M]) (Changes[M], error)
Compare compares stored snapshots without running hooks, accessors or mutators. Example: Compare(Orders.Table, value.Set(before), value.Set(after), orm.NumberSet(Orders.TotalCents, 0)).
func (Changes[M]) After ¶
After returns an owned stored result, absent for physical deletion. Example: changes.After().Get().
func (Changes[M]) Assigned ¶
Assigned reports effective assignments, including managed fields. Example: changes.Assigned().
func (Changes[M]) Before ¶
Before returns an owned persisted original, absent for creation. Example: changes.Before().Get().
func (Changes[M]) Changed ¶
Changed reports canonical stored differences. Example: changes.Changed().
type CheckedTable ¶
type CheckedTable interface {
// contains filtered or unexported methods
}
CheckedTable is implemented by embedded tables. Example: Check(Orders, Users).
type Column ¶
type Column[M, V any] struct { // contains filtered or unexported fields }
Column exposes equality, ordering and assignments. Example: orm.ColumnEq(Orders.BuyerID, id).
func BoolOf ¶
func BoolOf[M any, V ~bool](b Builder[M], ptr *V, opts ...ColumnOption[V]) Column[M, V]
BoolOf binds a Boolean field, including defined Boolean types. Example: BoolOf(b, &u.Enabled).
func BytesOf ¶
func BytesOf[M any, V ~[]byte](b Builder[M], ptr *V, opts ...ColumnOption[V]) Column[M, V]
BytesOf binds owned byte buffers. Example: BytesOf(b,&o.Payload).
func ColumnOf ¶
func ColumnOf[M, V any](b Builder[M], ptr *V, opts ...ColumnOption[V]) Column[M, V]
ColumnOf binds an ordinary field or explicit custom codec. Example: ColumnOf(b,&o.BuyerID).
type ColumnAdapter ¶ added in v0.2.0
ColumnAdapter retains the column's typed, sealed expression/source capabilities. Example: ColumnExpr(column).
func ColumnExpr ¶ added in v0.2.0
func ColumnExpr[M, V any](c Column[M, V]) ColumnAdapter[M, V]
ColumnExpr opts into the column's sealed expression/source capabilities. Example: ColumnExpr(column).
type ColumnOption ¶
type ColumnOption[V any] struct { // contains filtered or unexported fields }
ColumnOption supplies a typed custom codec. Example: ColumnOf(b, &o.Code, Codec(custom)).
type Conflict ¶
type Conflict[M any] struct { // contains filtered or unexported fields }
Conflict is an immutable model-owned upsert policy; its zero value is invalid. Example: orm.OnConflict(orm.ConflictKey(orm.TextExpr(Users.Email))).DoUpdate(orm.ConflictIncoming(orm.TextExpr(Users.Name))).
func FoundryConflict ¶
func FoundryConflict[M any](metadata ormcore.ConflictPolicy, seal sqlowner.ExpressionSeal) Conflict[M]
FoundryConflict binds a framework-built policy to its declaration. Example: FoundryConflict[User](metadata,sqlowner.Expressions()).
func OnConflict ¶
func OnConflict[M any](fields ...ConflictColumn[M]) Conflict[M]
OnConflict infers a unique index from typed columns. Empty targets support DO NOTHING. Example: orm.OnConflict(orm.ConflictKey(orm.TextExpr(Users.Email))).DoNothing().
func OnConflictConstraint ¶
OnConflictConstraint selects a named database constraint; PostgreSQL owns its existence. Example: orm.OnConflictConstraint[User]("users_email_key").DoNothing().
func (Conflict[M]) DoNothing ¶
DoNothing skips conflicting rows; skipped rows have no result. Example: orm.OnConflict[User]().DoNothing().
func (Conflict[M]) DoUpdate ¶
func (p Conflict[M]) DoUpdate(updates ...ConflictUpdate[M]) Conflict[M]
DoUpdate replaces the policy's update assignments. Primary-key updates are rejected. Example: policy.DoUpdate(orm.ConflictIncoming(orm.TextExpr(Users.Name))).
func (Conflict[M]) GoString ¶
GoString omits captured conflict values. Example: fmt.Sprintf("%#v",policy).
func (Conflict[M]) TargetWhere ¶
TargetWhere declares a partial unique index predicate, separate from update conditions. Fixed target values are rendered as schema constants. Example: policy.TargetWhere(orm.ColumnEq(Users.Active, true)).
type ConflictColumn ¶
type ConflictColumn[M any] struct { // contains filtered or unexported fields }
ConflictColumn is a model-owned unique-index column. Example: orm.ConflictKey(orm.TextExpr(Users.Email)).
func ConflictKey ¶
func ConflictKey[M, V any](field interface{ ormColumn(*M) columnData[V] }) ConflictColumn[M]
ConflictKey selects a declared column for unique-index inference. Example: orm.OnConflict(orm.ConflictKey(orm.TextExpr(Users.Email))).DoNothing().
type ConflictUpdate ¶
type ConflictUpdate[M any] struct { // contains filtered or unexported fields }
ConflictUpdate is a model-owned assignment in DO UPDATE. Example: orm.ConflictIncoming(orm.TextExpr(Users.Email)).
func ConflictIncoming ¶
func ConflictIncoming[M, V any](field interface{ ormColumn(*M) columnData[V] }) ConflictUpdate[M]
ConflictIncoming copies the destination's own EXCLUDED value, already transformed. Omitted insert values copy the database default or NULL. Encrypted fields are excluded. Example: orm.ConflictIncoming(orm.TextExpr(Users.Email)).
func ConflictNull ¶
func ConflictNull[M, V any](field ExpressionColumn[M, V, value.Nullable[V]]) ConflictUpdate[M]
ConflictNull clears a nullable field without invoking its mutator. Example: orm.ConflictNull(orm.NullableTextExpr(Users.Nickname)).
func ConflictSet ¶
func ConflictSet[M, I, V any, F conflictAssignment[M, I, V]](field F, input I) ConflictUpdate[M]
ConflictSet captures the column's write input, including distinct mutator inputs. Encrypted fields have no conflict assignment capability. Example: orm.ConflictSet(orm.InputTextExpr(Members.Email),EmailInput{Address:"ada@example.test"}).
func FoundryConflictUpdate ¶
func FoundryConflictUpdate[M any](metadata ormcore.ConflictAssignment, seal sqlowner.ExpressionSeal) ConflictUpdate[M]
FoundryConflictUpdate binds a framework-built calculation to its destination. Example: FoundryConflictUpdate[User](metadata,sqlowner.Expressions()).
func (ConflictUpdate[M]) GoString ¶
func (ConflictUpdate[M]) GoString() string
GoString redacts literal inputs. Example: fmt.Sprintf("%#v",update).
func (ConflictUpdate[M]) String ¶
func (ConflictUpdate[M]) String() string
String redacts literal inputs. Example: fmt.Sprint(orm.ConflictSet(orm.TextExpr(Users.Email),"ada@example.test")).
type CreatedAt ¶
type CreatedAt[M any, V InstantValue] = timeColumn[M, V, createdRole]
CreatedAt is an explicitly managed creation instant. Example: CreatedAtOf(b,&o.CreatedAt).
func CreatedAtOf ¶
func CreatedAtOf[M any, V InstantValue](b Builder[M], ptr *V) CreatedAt[M, V]
CreatedAtOf explicitly marks a creation timestamp. Example: CreatedAtOf(b,&o.CreatedAt).
type Cursor ¶
Cursor is the existing owner-typed position token, preserving its wire identity. Example: var next orm.Cursor[User].
type CursorInputError ¶
type CursorInputError = querycore.CursorInputError
CursorInputError preserves typed cursor error classification. Example: var invalid *orm.CursorInputError.
type CursorPage ¶
type CursorPage[M any] = querycore.CursorPage[M]
CursorPage preserves the existing keyset response. Example: page.Next.Get().
func CursorPaginate ¶
func CursorPaginate[M any](ctx context.Context, ex database.Executor, q Query[M], request CursorRequest[M]) (CursorPage[M], error)
CursorPaginate reads a bounded keyset page using the existing HTTP pagination request/result adapters. Tokens are scoped positions, not authorization or a snapshot. Example: orm.CursorPaginate(ctx, db, Orders.Query(), request.Page).
type CursorRequest ¶
type CursorRequest[M any] = querycore.CursorRequest[M]
CursorRequest preserves the existing bounded keyset request. Example: orm.CursorRequest[User]{Size:20}.
type DeleteSource ¶
type DeleteSource[S, M any] struct { // contains filtered or unexported fields }
DeleteSource removes matching models using declared soft-delete conventions. Example: rows.DeleteUsing(Users.Query(),rows.From(Archives.Query())).
func FoundryDeleteUsing ¶
func FoundryDeleteUsing[S, M any](q Query[M], source ormcore.Source, force bool, soft SoftDeletable[M], seal sqlowner.QuerySeal) DeleteSource[S, M]
FoundryDeleteUsing creates a source removal plan with explicit visibility. Example: FoundryDeleteUsing[Archive](Users.Query(),source,false,SoftDeletable[User]{},sqlowner.Queries()).
func (DeleteSource[S, M]) Exec ¶
func (p DeleteSource[S, M]) Exec(ctx context.Context, writer database.Transactor) (int64, error)
Exec affects each matching destination once. Example: plan.Exec(ctx,db).
func (DeleteSource[S, M]) Format ¶
func (DeleteSource[S, M]) Format(s fmt.State, _ rune)
Format hides captured source values. Example: fmt.Sprintf("%#v",plan).
func (DeleteSource[S, M]) Match ¶
func (p DeleteSource[S, M]) Match(key SourceKey[S, M]) DeleteSource[S, M]
Match replaces the source-to-primary match. Example: plan.Match(rows.MatchSource(orm.KeyExpr(Users.ID),expr.Value(orm.ColumnExpr(Archives.UserID)))).
func (DeleteSource[S, M]) Returning ¶
func (p DeleteSource[S, M]) Returning(ctx context.Context, writer database.Transactor, limit int) ([]M, error)
Returning returns complete affected models; physical deletion returns old values. Example: plan.Returning(ctx,db,100).
type DirectRelation ¶
type DirectRelation[P, M any] interface { BelongsTo[P, M] | HasOne[P, M] | HasMany[P, M] AggregateSource[P, M] }
DirectRelation restricts scoped binding to direct relationships. Example: func bind[R orm.DirectRelation[Team,Project]](r R).
type Encrypted ¶
Encrypted exposes only typed assignment; ciphertext has no predicate or ordering capabilities. Example: EncryptedSet(Vaults.Secret, encrypted.NewText("private")).
type EncryptedAdapter ¶ added in v0.2.0
EncryptedAdapter retains the column's typed, sealed expression/source capabilities. Example: EncryptedExpr(column).
func EncryptedExpr ¶ added in v0.2.0
func EncryptedExpr[M any, V encrypted.Value[V]](c Encrypted[M, V]) EncryptedAdapter[M, V]
EncryptedExpr opts into the column's sealed expression/source capabilities. Example: EncryptedExpr(column).
type Enum ¶
Enum restricts values to an enum's descriptor. Example: orm.EnumEq(Users.Status, StatusActive).
func EnumOf ¶
func EnumOf[M any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](b Builder[M], ptr *E, opts ...ColumnOption[E]) Enum[M, E]
EnumOf uses generated enum metadata. Example: EnumOf(b,&o.Status).
type EnumAdapter ¶ added in v0.2.0
EnumAdapter retains the column's typed, sealed expression/source capabilities. Example: EnumExpr(column).
type ExistenceRelation ¶
type ExistenceRelation[M, N any] interface { Relation[M] // contains filtered or unexported methods }
ExistenceRelation retains both source and target owners for predicate inference. Example: orm.Has(UserRelations.Orders, orm.NumberGt(Orders.TotalCents, 100)).
type ExpressionColumn ¶
type ExpressionColumn[M, V, P any] interface { // contains filtered or unexported methods }
ExpressionColumn preserves a column's model and SQL value type. Example: rows.SelectValue(Orders.Query(),orm.NumberExpr(Orders.TotalCents)).
type ExtensionRelation ¶
type ExtensionRelation[M any] struct { // contains filtered or unexported fields }
ExtensionRelation is a model-owned external-store loader. Example: Articles.Query().With(title).
func FoundryExtension ¶
func FoundryExtension[M, S any](slot Slot[M, S], source extensionslot.Slot[M], seal sqlowner.QuerySeal) ExtensionRelation[M]
FoundryExtension binds a shared external loader using a validated framework capability. Example: orm.FoundryExtension(Articles.Title,loader,sqlowner.Queries()).
type GlobalScope ¶
type GlobalScope[M any] struct { // contains filtered or unexported fields }
GlobalScope is a model-owned, additive default predicate. Keep its value for query-local removal. Example: var tenantScope orm.GlobalScope[Order].
func Scope ¶
func Scope[M any, K comparable](table Table[M, K], name string, resolve func(context.Context) (Predicate[M], error)) GlobalScope[M]
Scope resolves a predicate with the executing context on every statement. A missing tenant must return an error. Example: orm.Scope(Orders.Table, "tenant", func(ctx context.Context) (orm.Predicate[Order], error) { id, err := tenantID(ctx); return orm.NumberEq(Orders.TenantID, id), err }).
func (GlobalScope[M]) Name ¶
func (s GlobalScope[M]) Name() string
Name returns the declared identifier. Example: tenantScope.Name().
type HasMany ¶
type HasMany[M, N any] struct { // contains filtered or unexported fields }
HasMany loads target collections by their FK. Example: UserRelations.Orders.
func HasManyOf ¶
func HasManyOf[M, N any, K comparable](slot Many[M, N], local KeyColumn[M, K], foreign KeyColumn[N, K]) HasMany[M, N]
HasManyOf unifies parent keys with target FKs. Example: HasManyOf(Users.Orders,KeyExpr(Users.ID),ColumnExpr(Orders.BuyerID)).
func HasManyThroughOf ¶
func HasManyThroughOf[M, I, N any, A, B comparable](slot Many[M, N], local KeyColumn[M, A], first KeyColumn[I, A], second KeyColumn[I, B], foreign KeyColumn[N, B]) HasMany[M, N]
HasManyThroughOf unifies both key pairs via an intermediate model. Example: orm.HasManyThroughOf(Countries.Posts, Countries.ID, Users.CountryID, orm.KeyExpr(Users.ID), Posts.UserID).
func MorphManyOf ¶
func MorphManyOf[M model.Morphable, N any, K comparable](slot Many[M, N], local KeyColumn[M, K], id KeyColumn[N, K], kind KeyColumn[N, model.MorphName]) HasMany[M, N]
MorphManyOf filters targets by the source discriminator. Example: orm.MorphManyOf(Offices.Notes,orm.TextExpr(Offices.Code),orm.TextExpr(Notes.SubjectID),orm.ColumnExpr(Notes.SubjectType)).
func (HasMany[M, N]) OnlyTrashed ¶
OnlyTrashed sets target soft-delete visibility. Example: UserRelations.Orders.OnlyTrashed().
func (HasMany[M, N]) OrderBy ¶
OrderBy orders related collections. Example: UserRelations.Orders.OrderBy(orm.NumberDesc(Orders.TotalCents)).
func (HasMany[M, N]) Where ¶
Where constrains related rows. Example: UserRelations.Orders.Where(orm.NumberGt(Orders.TotalCents, 100)).
func (HasMany[M, N]) With ¶
With batches nested branches over all fetched targets. Example: UserRelations.Orders.With(OrderRelations.Buyer).
func (HasMany[M, N]) WithTrashed ¶
WithTrashed sets target soft-delete visibility. Example: UserRelations.Orders.WithTrashed().
func (HasMany[M, N]) WithoutTrashed ¶
WithoutTrashed sets target soft-delete visibility. Example: UserRelations.Orders.WithoutTrashed().
type HasOne ¶
type HasOne[M, N any] struct { // contains filtered or unexported fields }
HasOne loads at most one target by its FK. Example: UserRelations.Profile.
func HasOneOf ¶
func HasOneOf[M, N any, K comparable](slot One[M, N], local KeyColumn[M, K], foreign KeyColumn[N, K]) HasOne[M, N]
HasOneOf unifies the parent key and target FK and rejects multiple matches. Example: HasOneOf(Users.Profile,KeyExpr(Users.ID),ColumnExpr(Profiles.UserID)).
func HasOneThroughOf ¶
func HasOneThroughOf[M, I, N any, A, B comparable](slot One[M, N], local KeyColumn[M, A], first KeyColumn[I, A], second KeyColumn[I, B], foreign KeyColumn[N, B]) HasOne[M, N]
HasOneThroughOf loads at most one target per source via an intermediate. Example: orm.HasOneThroughOf(Countries.LatestPost, Countries.ID, Users.CountryID, orm.KeyExpr(Users.ID), Posts.UserID).
func MorphOneOf ¶
func MorphOneOf[M model.Morphable, N any, K comparable](slot One[M, N], local KeyColumn[M, K], id KeyColumn[N, K], kind KeyColumn[N, model.MorphName]) HasOne[M, N]
MorphOneOf loads at most one target of the source discriminator. Example: orm.MorphOneOf(slot,orm.TextExpr(Offices.Code),orm.TextExpr(Notes.SubjectID),orm.ColumnExpr(Notes.SubjectType)).
func (HasOne[M, N]) LatestOfMany ¶
LatestOfMany chooses the highest target primary key. Example: UserRelations.LatestOrder.LatestOfMany().
func (HasOne[M, N]) OfMany ¶
OfMany chooses the first target per parent in these orders, then primary key. Example: UserRelations.LatestOrder.OfMany(orm.NumberDesc(Orders.TotalCents)).
func (HasOne[M, N]) OldestOfMany ¶
OldestOfMany chooses the lowest target primary key. Example: UserRelations.LatestOrder.OldestOfMany().
func (HasOne[M, N]) OnlyTrashed ¶
OnlyTrashed sets target soft-delete visibility. Example: UserRelations.Orders.OnlyTrashed().
func (HasOne[M, N]) OrderBy ¶
OrderBy orders related rows without hiding cardinality errors. Example: UserRelations.Profile.OrderBy(orm.KeyAsc(Profiles.ID)).
func (HasOne[M, N]) Where ¶
Where constrains related rows. Example: UserRelations.Profile.Where(orm.ColumnEq(Profiles.Active, true)).
func (HasOne[M, N]) With ¶
With batches nested branches over all fetched targets. Example: UserRelations.Profile.With(ProfileRelations.Photo).
func (HasOne[M, N]) WithTrashed ¶
WithTrashed sets target soft-delete visibility. Example: UserRelations.Orders.WithTrashed().
func (HasOne[M, N]) WithoutTrashed ¶
WithoutTrashed sets target soft-delete visibility. Example: UserRelations.Orders.WithoutTrashed().
type Hooks ¶
type Hooks[M any] struct { // Saving precedes Creating/Updating. Example: Saving: validateOrder. Saving func(context.Context, *database.Tx, value.Optional[M], *Write[M]) error // Creating can supply omitted required fields. Example: Creating: initializeOrder. Creating func(context.Context, *database.Tx, *Write[M]) error // Updating receives the locked original. Example: Updating: reviseOrder. Updating func(context.Context, *database.Tx, M, *Write[M]) error // Deleting precedes soft and physical deletion. Example: Deleting: authorizeRemoval. Deleting func(context.Context, *database.Tx, M) error // Restoring precedes restoring a deleted row. Example: Restoring: authorizeRestore. Restoring func(context.Context, *database.Tx, M) error // ForceDeleting precedes Deleting. Example: ForceDeleting: authorizePurge. ForceDeleting func(context.Context, *database.Tx, M) error // Created runs after RETURNING, inside the transaction. Example: Created: recordCreation. Created func(context.Context, *database.Tx, Changes[M]) error // Updated runs after RETURNING, inside the transaction. Example: Updated: recordRevision. Updated func(context.Context, *database.Tx, Changes[M]) error // Deleted runs after soft or physical deletion. Example: Deleted: recordRemoval. Deleted func(context.Context, *database.Tx, Changes[M]) error // Saved follows Created/Updated. Example: Saved: writeOutbox. Saved func(context.Context, *database.Tx, Changes[M]) error // Restored runs after restoration. Example: Restored: recordRestore. Restored func(context.Context, *database.Tx, Changes[M]) error // ForceDeleted follows Deleted. Example: ForceDeleted: recordPurge. ForceDeleted func(context.Context, *database.Tx, Changes[M]) error // AfterCommit runs after the outer commit; it is not crash durable. Example: AfterCommit: invalidateCache. AfterCommit func(context.Context, lifecycle.Operation, Changes[M]) error }
Hooks declares operation-local write callbacks; nil callbacks are skipped. Example: Hooks[Order]{Creating: func(ctx context.Context, tx *database.Tx, w *Write[Order]) error { return WriteSet(w, orm.NumberSet(Orders.TotalCents, 0)) }}.
type InputColumn ¶
InputColumn accepts I for writes and retains V for stored operations. Example: InputColumn[Member, EmailInput, StoredEmail].
func InputBytesOf ¶
func InputBytesOf[M, I any, V ~[]byte](b Builder[M], ptr *V, transform func(I) (V, error)) InputColumn[M, I, V]
InputBytesOf binds owned stored bytes and a concrete input. Example: InputBytesOf[Document, BodyInput](b, &document.Body, encodeBody).
func InputColumnOf ¶
func InputColumnOf[M, I any, V any](b Builder[M], ptr *V, transform func(I) (V, error), opts ...ColumnOption[V]) InputColumn[M, I, V]
InputColumnOf binds a distinct input. A nil transform selects the model Mutate method. Example: InputColumnOf[Member, EmailInput](b, &member.Email, nil).
type InputColumnAdapter ¶ added in v0.2.0
type InputColumnAdapter[M, I any, V any] InputColumn[M, I, V]
InputColumnAdapter retains the column's typed, sealed expression/source capabilities. Example: InputColumnExpr(column).
func InputColumnExpr ¶ added in v0.2.0
func InputColumnExpr[M, I any, V any](c InputColumn[M, I, V]) InputColumnAdapter[M, I, V]
InputColumnExpr opts into the column's sealed expression/source capabilities. Example: InputColumnExpr(column).
type InputEnum ¶
type InputEnum[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }] struct { // contains filtered or unexported fields }
InputEnum accepts I for writes and retains E for stored operations. Example: InputEnum[Member, StatusInput, Status].
func InputEnumOf ¶
func InputEnumOf[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](b Builder[M], ptr *E, transform func(I) (E, error), opts ...ColumnOption[E]) InputEnum[M, I, E]
InputEnumOf binds a distinct input. A nil transform selects the model Mutate method. Example: InputEnumOf[Member, StatusInput](b, &member.Status, nil).
type InputEnumAdapter ¶ added in v0.2.0
type InputEnumAdapter[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }] InputEnum[M, I, E]
InputEnumAdapter retains the column's typed, sealed expression/source capabilities. Example: InputEnumExpr(column).
func InputEnumExpr ¶ added in v0.2.0
func InputEnumExpr[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c InputEnum[M, I, E]) InputEnumAdapter[M, I, E]
InputEnumExpr opts into the column's sealed expression/source capabilities. Example: InputEnumExpr(column).
type InputInterval ¶
type InputInterval[M, I any] struct { // contains filtered or unexported fields }
InputInterval accepts I for writes and retains temporal.Interval for stored operations. Example: InputInterval[Booking, PeriodInput].
func InputIntervalOf ¶
func InputIntervalOf[M, I any](b Builder[M], ptr *temporal.Interval, transform func(I) (temporal.Interval, error), opts ...ColumnOption[temporal.Interval]) InputInterval[M, I]
InputIntervalOf binds a distinct input. A nil transform selects the model Mutate method. Example: InputIntervalOf[Booking, PeriodInput](b, &booking.Period, nil).
type InputIntervalAdapter ¶ added in v0.2.0
type InputIntervalAdapter[M, I any] InputInterval[M, I]
InputIntervalAdapter retains the column's typed, sealed expression/source capabilities. Example: InputIntervalExpr(column).
func InputIntervalExpr ¶ added in v0.2.0
func InputIntervalExpr[M, I any](c InputInterval[M, I]) InputIntervalAdapter[M, I]
InputIntervalExpr opts into the column's sealed expression/source capabilities. Example: InputIntervalExpr(column).
type InputJSON ¶
InputJSON accepts I for writes and retains value.JSON[T] for stored operations. Example: InputJSON[Member, PreferencesInput, Preferences].
func InputJSONOf ¶
func InputJSONOf[M, I any, T any](b Builder[M], ptr *value.JSON[T], transform func(I) (value.JSON[T], error), opts ...ColumnOption[value.JSON[T]]) InputJSON[M, I, T]
InputJSONOf binds a distinct input. A nil transform selects the model Mutate method. Example: InputJSONOf[Member, PreferencesInput](b, &member.Settings, nil).
type InputJSONAdapter ¶ added in v0.2.0
InputJSONAdapter retains the column's typed, sealed expression/source capabilities. Example: InputJSONExpr(column).
func InputJSONExpr ¶ added in v0.2.0
func InputJSONExpr[M, I any, T any](c InputJSON[M, I, T]) InputJSONAdapter[M, I, T]
InputJSONExpr opts into the column's sealed expression/source capabilities. Example: InputJSONExpr(column).
type InputKey ¶
type InputKey[M, I any, K comparable] struct { // contains filtered or unexported fields }
InputKey retains stored K for lookup and accepts I for primary-key assignment. Example: InputKey[User, FreshID, model.ID[User]].
func InputKeyOf ¶
func InputKeyOf[M, I any, K comparable](b Builder[M], key Key[M, K], transform func(I) (K, error)) InputKey[M, I, K]
InputKeyOf adds a typed input to the primary key already declared by TableOf. A nil transform selects the matching Mutate<Field> method; distinct inputs disable automatic UUID creation. Call inside Define. Example: InputKeyOf[User, FreshID](b, table.Key(), nil).
type InputKeyAdapter ¶ added in v0.2.0
type InputKeyAdapter[M, I any, K comparable] InputKey[M, I, K]
InputKeyAdapter retains the column's typed, sealed expression/source capabilities. Example: InputKeyExpr(column).
func InputKeyExpr ¶ added in v0.2.0
func InputKeyExpr[M, I any, K comparable](c InputKey[M, I, K]) InputKeyAdapter[M, I, K]
InputKeyExpr opts into the column's sealed expression/source capabilities. Example: InputKeyExpr(column).
type InputNumber ¶
type InputNumber[M, I any, V NumberValue] struct { // contains filtered or unexported fields }
InputNumber accepts I for writes and retains V for stored operations. Example: InputNumber[Invoice, AmountInput, int64].
func InputNumberOf ¶
func InputNumberOf[M, I any, V NumberValue](b Builder[M], ptr *V, transform func(I) (V, error), opts ...ColumnOption[V]) InputNumber[M, I, V]
InputNumberOf binds a distinct input. A nil transform selects the model Mutate method. Example: InputNumberOf[Invoice, AmountInput](b, &invoice.Amount, nil).
type InputNumberAdapter ¶ added in v0.2.0
type InputNumberAdapter[M, I any, V NumberValue] InputNumber[M, I, V]
InputNumberAdapter retains the column's typed, sealed expression/source capabilities. Example: InputNumberExpr(column).
func InputNumberExpr ¶ added in v0.2.0
func InputNumberExpr[M, I any, V NumberValue](c InputNumber[M, I, V]) InputNumberAdapter[M, I, V]
InputNumberExpr opts into the column's sealed expression/source capabilities. Example: InputNumberExpr(column).
type InputText ¶
InputText accepts I for writes and retains V for stored operations. Example: InputText[Member, EmailInput, StoredEmail].
func InputTextOf ¶
func InputTextOf[M, I any, V ~string](b Builder[M], ptr *V, transform func(I) (V, error), opts ...ColumnOption[V]) InputText[M, I, V]
InputTextOf binds a distinct input. A nil transform selects the model Mutate method. Example: InputTextOf[Member, EmailInput](b, &member.Email, nil).
type InputTextAdapter ¶ added in v0.2.0
InputTextAdapter retains the column's typed, sealed expression/source capabilities. Example: InputTextExpr(column).
func InputTextExpr ¶ added in v0.2.0
func InputTextExpr[M, I any, V ~string](c InputText[M, I, V]) InputTextAdapter[M, I, V]
InputTextExpr opts into the column's sealed expression/source capabilities. Example: InputTextExpr(column).
type InputTime ¶
InputTime accepts I for writes and retains V for stored operations. Example: InputTime[Event, TimestampInput, time.Time].
func InputTimeOf ¶
func InputTimeOf[M, I any, V TimeValue](b Builder[M], ptr *V, transform func(I) (V, error), opts ...ColumnOption[V]) InputTime[M, I, V]
InputTimeOf binds a distinct input. A nil transform selects the model Mutate method. Example: InputTimeOf[Event, TimestampInput](b, &event.StartsAt, nil).
type InputTimeAdapter ¶ added in v0.2.0
InputTimeAdapter retains the column's typed, sealed expression/source capabilities. Example: InputTimeExpr(column).
func InputTimeExpr ¶ added in v0.2.0
func InputTimeExpr[M, I any, V TimeValue](c InputTime[M, I, V]) InputTimeAdapter[M, I, V]
InputTimeExpr opts into the column's sealed expression/source capabilities. Example: InputTimeExpr(column).
type InsertMapping ¶
type InsertMapping[S, M any] struct { // contains filtered or unexported fields }
InsertMapping maps one exact stored source value. Example: rows.MapInsert(orm.TextExpr(Archives.Name), expr.Value(orm.TextExpr(Users.Name))).
func FoundryInsertMapping ¶
func FoundryInsertMapping[S, M any](m ormcore.ModelMapping, seal sqlowner.ExpressionSeal) InsertMapping[S, M]
FoundryInsertMapping binds a framework expression to its destination. Example: FoundryInsertMapping[User,Archive](mapping,sqlowner.Expressions()).
type InsertSelect ¶
type InsertSelect[S, M any] struct { // contains filtered or unexported fields }
InsertSelect inserts a complete source window without per-model callbacks. Example: rows.InsertFrom(rows.From(Users.Query()),Archives.Query()).
func FoundryInsertFrom ¶
func FoundryInsertFrom[S, M any](q Query[M], source ormcore.Source, seal sqlowner.QuerySeal) InsertSelect[S, M]
FoundryInsertFrom creates a source insertion plan. Example: FoundryInsertFrom[User](Archives.Query(),source,sqlowner.Queries()).
func (InsertSelect[S, M]) Exec ¶
func (p InsertSelect[S, M]) Exec(ctx context.Context, writer database.Transactor) (int64, error)
Exec returns the affected count without collecting models. Example: plan.Exec(ctx,db).
func (InsertSelect[S, M]) Format ¶
func (InsertSelect[S, M]) Format(s fmt.State, _ rune)
Format hides captured source values. Example: fmt.Sprintf("%#v",plan).
func (InsertSelect[S, M]) Returning ¶
func (p InsertSelect[S, M]) Returning(ctx context.Context, writer database.Transactor, limit int) ([]M, error)
Returning collects at most limit complete models; overflow rolls back, never truncates. Example: plan.Returning(ctx,db,100).
func (InsertSelect[S, M]) Select ¶
func (p InsertSelect[S, M]) Select(mappings ...InsertMapping[S, M]) InsertSelect[S, M]
Select appends mappings; duplicates and overlap with Values are rejected. Example: plan.Select(rows.MapInsert(orm.TextExpr(Archives.Name), expr.Value(orm.TextExpr(Users.Name)))).
func (InsertSelect[S, M]) Values ¶
func (p InsertSelect[S, M]) Values(values ...Assignment[M]) InsertSelect[S, M]
Values replaces literal inputs, normalized once per statement. Example: plan.Values(orm.TextSet(Archives.Tag, input)).
type InsertTarget ¶
type InsertTarget[M, V, P any] interface { ExpressionColumn[M, V, P] ordinaryLayouts[M, V] | createdLayouts[M, V] | primaryLayouts[M, V] }
InsertTarget admits unmutated stored assignments, creation timestamps and declared primary mappings. Example: rows.MapInsert(orm.KeyExpr(Archives.ID), expr.Value(orm.KeyExpr(Users.ID))).
type InstantValue ¶
InstantValue permits managed timestamp fields. Example: CreatedAtOf(b, &o.CreatedAt).
type Interval ¶
type Interval[M any] struct { // contains filtered or unexported fields }
Interval supports ordered interval predicates and assignments, retaining calendar components. PostgreSQL compares using 30-day months and 24-hour days: Eq(temporal.Months(1)) also matches 30 days. Hydration preserves distinct calendar and elapsed components. Example: orm.IntervalGt(Records.Period, temporal.Days(1)).
func IntervalOf ¶
func IntervalOf[M any](b Builder[M], ptr *temporal.Interval, opts ...ColumnOption[temporal.Interval]) Interval[M]
IntervalOf binds an interval without enabling numeric adjustments or text patterns. Example: IntervalOf(b, &m.Period).
type IntervalAdapter ¶ added in v0.2.0
IntervalAdapter retains the column's typed, sealed expression/source capabilities. Example: IntervalExpr(column).
func IntervalExpr ¶ added in v0.2.0
func IntervalExpr[M any](c Interval[M]) IntervalAdapter[M]
IntervalExpr opts into the column's sealed expression/source capabilities. Example: IntervalExpr(column).
type JSON ¶
type JSON[M, T any] struct { // contains filtered or unexported fields }
JSON binds a typed JSON document with sorting but without range comparisons or text patterns. Example: orm.JSONEq(Records.Settings, settings).
type JSONAdapter ¶ added in v0.2.0
JSONAdapter retains the column's typed, sealed expression/source capabilities. Example: JSONExpr(column).
func JSONExpr ¶ added in v0.2.0
func JSONExpr[M, T any](c JSON[M, T]) JSONAdapter[M, T]
JSONExpr opts into the column's sealed expression/source capabilities. Example: JSONExpr(column).
type Key ¶
type Key[M any, K comparable] = keyColumn[M, K, lookupKeyRole]
Key identifies a table's primary column. Example: orm.KeyEq(Orders.Key(), id).
type KeyColumn ¶
type KeyColumn[M any, K comparable] interface { // contains filtered or unexported methods }
KeyColumn retains comparable relation key types, including nullable FKs. Example: BelongsToOf(Orders.Buyer,ColumnExpr(Orders.BuyerID),KeyExpr(Users.ID)).
type KeyLookup ¶
type KeyLookup[M any, K comparable] struct { // contains filtered or unexported fields }
KeyLookup retains a filtered declaration and a typed lookup key. Example: orm.Keyed(Users.Query(),Users.Key()).Find(ctx,db,id).
func Keyed ¶
func Keyed[M any, K comparable](q Query[M], key Key[M, K]) KeyLookup[M, K]
Keyed retains filters, eager loads, soft-delete scope and retrieval hooks. Example: modelbinding.ByKey(db,orm.Keyed(Users.Query(),Users.Key()),pathKey).
func Unique ¶
func Unique[M any, K comparable](q Query[M], field KeyColumn[M, K]) KeyLookup[M, K]
Unique binds a stored alternate key, rejecting a second matching row. Example: orm.Unique(Users.Query(),orm.TextExpr(Users.Email)).Find(ctx,db,email).
func (KeyLookup[M, K]) Find ¶
func (l KeyLookup[M, K]) Find(ctx context.Context, ex database.Executor, key K) (value.Optional[M], error)
Find performs one parameterized SELECT; only unique results receive eager loads. Example: lookup.Find(ctx,db,key).
func (KeyLookup[M, K]) Format ¶
Format redacts scope literals and model metadata. Example: fmt.Sprintf("%+v", lookup).
func (KeyLookup[M, K]) GoString ¶
GoString redacts Go-syntax diagnostics. Example: fmt.Sprintf("%#v", lookup).
type LockedQuery ¶
type LockedQuery[M any] struct { // contains filtered or unexported fields }
LockedQuery requires a transaction for every terminal. Example: orm.AllLocked(ctx, tx, orm.Lock(Orders.Query())).
func ForKeyShare ¶ added in v0.2.0
func ForKeyShare[M any](q Query[M]) LockedQuery[M]
ForKeyShare protects selected keys against deletion and key changes.
func ForNoKeyUpdate ¶ added in v0.2.0
func ForNoKeyUpdate[M any](q Query[M]) LockedQuery[M]
ForNoKeyUpdate requests a lock compatible with key-share locks.
func ForShare ¶ added in v0.2.0
func ForShare[M any](q Query[M]) LockedQuery[M]
ForShare requests share locks. Example: orm.AllLocked(ctx, tx, orm.ForShare(Orders.Query())).
func Lock ¶ added in v0.2.0
func Lock[M any](q Query[M]) LockedQuery[M]
Lock requests update locks. Example: orm.AllLocked(ctx, tx, orm.Lock(Orders.Query())).
func (LockedQuery[M]) Limit ¶
func (q LockedQuery[M]) Limit(n int) LockedQuery[M]
Limit bounds locked rows.
func (LockedQuery[M]) NoWait ¶
func (q LockedQuery[M]) NoWait() LockedQuery[M]
NoWait fails instead of waiting for conflicting locks.
func (LockedQuery[M]) Offset ¶
func (q LockedQuery[M]) Offset(n int) LockedQuery[M]
Offset skips matching rows before locking.
func (LockedQuery[M]) OnlyTrashed ¶
func (q LockedQuery[M]) OnlyTrashed() LockedQuery[M]
OnlyTrashed selects deleted rows.
func (LockedQuery[M]) OrderBy ¶
func (q LockedQuery[M]) OrderBy(os ...Order[M]) LockedQuery[M]
OrderBy appends locked-row ordering.
func (LockedQuery[M]) SkipLocked ¶
func (q LockedQuery[M]) SkipLocked() LockedQuery[M]
SkipLocked skips rows held by conflicting locks.
func (LockedQuery[M]) Wait ¶
func (q LockedQuery[M]) Wait() LockedQuery[M]
Wait restores the default waiting behavior.
func (LockedQuery[M]) Where ¶
func (q LockedQuery[M]) Where(ps ...Predicate[M]) LockedQuery[M]
Where adds conditions to a locked query.
func (LockedQuery[M]) WithTrashed ¶
func (q LockedQuery[M]) WithTrashed() LockedQuery[M]
WithTrashed includes deleted rows.
func (LockedQuery[M]) WithoutTrashed ¶
func (q LockedQuery[M]) WithoutTrashed() LockedQuery[M]
WithoutTrashed selects active rows.
type Many ¶
type Many[M, N any] struct { // contains filtered or unexported fields }
Many identifies a collection slot. Example: Orders Many[User,Order].
type ModelIdentity ¶
type ModelIdentity[M any, K comparable] struct { // contains filtered or unexported fields }
ModelIdentity retains a declaration's concrete primary key without model methods. Identity reads select keys only and do not run retrieval hooks. Example: orm.IdentityOf(Users.Table, Users.Key()).
func IdentityOf ¶
func IdentityOf[M any, K comparable](table Table[M, K], key Key[M, K]) ModelIdentity[M, K]
IdentityOf binds the model's own primary handle. Example: orm.IdentityOf(Users.Table, Users.Key()).
func (ModelIdentity[M, K]) ActiveKeys ¶
func (d ModelIdentity[M, K]) ActiveKeys(ctx context.Context, ex database.Executor, keys []K) ([]K, error)
ActiveKeys selects currently visible keys in one bounded statement. Example: identity.ActiveKeys(ctx,db,ids).
func (ModelIdentity[M, K]) KeyToken ¶
func (d ModelIdentity[M, K]) KeyToken(key K) (string, error)
KeyToken preserves SQL equality canonicalization for extension storage. Example: identity.KeyToken(id).
func (ModelIdentity[M, K]) LockActive ¶
LockActive locks one visible owner in the caller's transaction. Example: identity.LockActive(ctx,tx,id).
func (ModelIdentity[M, K]) ModelName ¶
func (d ModelIdentity[M, K]) ModelName() string
ModelName returns the persisted table name. Example: identity.ModelName().
func (ModelIdentity[M, K]) Parse ¶
Parse restores a reference with the same model and codec. Example: identity.Parse(stored).
func (ModelIdentity[M, K]) Reference ¶
func (d ModelIdentity[M, K]) Reference(key K) model.Reference[M, K]
Reference builds a typed reference using the stored key codec. Example: identity.Reference(id).
func (ModelIdentity[M, K]) ReferenceOf ¶
func (d ModelIdentity[M, K]) ReferenceOf(m M) model.Reference[M, K]
ReferenceOf reads the model's stored primary key without I/O. Example: identity.ReferenceOf(user).
func (ModelIdentity[M, K]) RetainedKeys ¶
func (d ModelIdentity[M, K]) RetainedKeys(ctx context.Context, ex database.Executor, keys []K) ([]K, error)
RetainedKeys includes soft-deleted owners for orphan inspection. Example: identity.RetainedKeys(ctx,db,ids).
func (ModelIdentity[M, K]) Scope ¶
func (d ModelIdentity[M, K]) Scope(keys ...K) Predicate[M]
Scope retains model and key ownership for bounded membership. Example: Users.Query().Where(identity.Scope(ids...)).
func (ModelIdentity[M, K]) Validate ¶
func (d ModelIdentity[M, K]) Validate() error
Validate rejects zero declarations and keys from another declaration. Example: identity.Validate().
type NullableColumn ¶
type NullableColumn[M, V any] struct { // contains filtered or unexported fields }
NullableColumn exposes explicit NULL. Example: orm.NullableColumnSetNull(Users.IntroducerID).
func NullableBytesOf ¶
func NullableBytesOf[M any, V ~[]byte](b Builder[M], ptr *value.Nullable[V], opts ...ColumnOption[V]) NullableColumn[M, V]
NullableBytesOf binds nullable binary values. Example: NullableBytesOf(b,&o.Payload).
func NullableColumnOf ¶
func NullableColumnOf[M, V any](b Builder[M], ptr *value.Nullable[V], opts ...ColumnOption[V]) NullableColumn[M, V]
NullableColumnOf binds nullable scalar values. Example: NullableColumnOf(b,&o.IntroducerID).
type NullableColumnAdapter ¶ added in v0.2.0
type NullableColumnAdapter[M, V any] NullableColumn[M, V]
NullableColumnAdapter retains the column's typed, sealed expression/source capabilities. Example: NullableColumnExpr(column).
func NullableColumnExpr ¶ added in v0.2.0
func NullableColumnExpr[M, V any](c NullableColumn[M, V]) NullableColumnAdapter[M, V]
NullableColumnExpr opts into the column's sealed expression/source capabilities. Example: NullableColumnExpr(column).
type NullableEncrypted ¶
type NullableEncrypted[M any, V encrypted.Value[V]] struct { // contains filtered or unexported fields }
NullableEncrypted adds only SQL NULL predicates and assignments. Example: NullableEncryptedIsNull(Vaults.Backup).
type NullableEncryptedAdapter ¶ added in v0.2.0
type NullableEncryptedAdapter[M any, V encrypted.Value[V]] NullableEncrypted[M, V]
NullableEncryptedAdapter retains the column's typed, sealed expression/source capabilities. Example: NullableEncryptedExpr(column).
func NullableEncryptedExpr ¶ added in v0.2.0
func NullableEncryptedExpr[M any, V encrypted.Value[V]](c NullableEncrypted[M, V]) NullableEncryptedAdapter[M, V]
NullableEncryptedExpr opts into the column's sealed expression/source capabilities. Example: NullableEncryptedExpr(column).
type NullableEnum ¶
NullableEnum exposes nullable enums. Example: orm.NullableEnumSetNull(records.Status).
func NullableEnumOf ¶
func NullableEnumOf[M any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](b Builder[M], ptr *value.Nullable[E], opts ...ColumnOption[E]) NullableEnum[M, E]
NullableEnumOf binds nullable enums. Example: NullableEnumOf(b,&o.Status).
type NullableEnumAdapter ¶ added in v0.2.0
type NullableEnumAdapter[M any, E enum.Scalar] NullableEnum[M, E]
NullableEnumAdapter retains the column's typed, sealed expression/source capabilities. Example: NullableEnumExpr(column).
func NullableEnumExpr ¶ added in v0.2.0
func NullableEnumExpr[M any, E enum.Scalar](c NullableEnum[M, E]) NullableEnumAdapter[M, E]
NullableEnumExpr opts into the column's sealed expression/source capabilities. Example: NullableEnumExpr(column).
type NullableInputColumn ¶
NullableInputColumn accepts I for writes and retains V for stored operations. Example: NullableInputColumn[Member, LabelInput, StoredLabel].
func NullableInputBytesOf ¶
func NullableInputBytesOf[M, I any, V ~[]byte](b Builder[M], ptr *value.Nullable[V], transform func(I) (V, error)) NullableInputColumn[M, I, V]
NullableInputBytesOf binds owned stored bytes and a concrete input. Example: NullableInputBytesOf[Document, BodyInput](b, &document.Body, encodeBody).
func NullableInputColumnOf ¶
func NullableInputColumnOf[M, I any, V any](b Builder[M], ptr *value.Nullable[V], transform func(I) (V, error), opts ...ColumnOption[V]) NullableInputColumn[M, I, V]
NullableInputColumnOf binds a distinct input. A nil transform selects the model Mutate method. Example: NullableInputColumnOf[Member, LabelInput](b, &member.Note, nil).
type NullableInputColumnAdapter ¶ added in v0.2.0
type NullableInputColumnAdapter[M, I any, V any] NullableInputColumn[M, I, V]
NullableInputColumnAdapter retains the column's typed, sealed expression/source capabilities. Example: NullableInputColumnExpr(column).
func NullableInputColumnExpr ¶ added in v0.2.0
func NullableInputColumnExpr[M, I any, V any](c NullableInputColumn[M, I, V]) NullableInputColumnAdapter[M, I, V]
NullableInputColumnExpr opts into the column's sealed expression/source capabilities. Example: NullableInputColumnExpr(column).
type NullableInputEnum ¶
type NullableInputEnum[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }] struct { // contains filtered or unexported fields }
NullableInputEnum accepts I for writes and retains E for stored operations. Example: NullableInputEnum[Member, StatusInput, Status].
func NullableInputEnumOf ¶
func NullableInputEnumOf[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](b Builder[M], ptr *value.Nullable[E], transform func(I) (E, error), opts ...ColumnOption[E]) NullableInputEnum[M, I, E]
NullableInputEnumOf binds a distinct input. A nil transform selects the model Mutate method. Example: NullableInputEnumOf[Member, StatusInput](b, &member.Status, nil).
type NullableInputEnumAdapter ¶ added in v0.2.0
type NullableInputEnumAdapter[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }] NullableInputEnum[M, I, E]
NullableInputEnumAdapter retains the column's typed, sealed expression/source capabilities. Example: NullableInputEnumExpr(column).
func NullableInputEnumExpr ¶ added in v0.2.0
func NullableInputEnumExpr[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c NullableInputEnum[M, I, E]) NullableInputEnumAdapter[M, I, E]
NullableInputEnumExpr opts into the column's sealed expression/source capabilities. Example: NullableInputEnumExpr(column).
type NullableInputInterval ¶
type NullableInputInterval[M, I any] struct { // contains filtered or unexported fields }
NullableInputInterval accepts I for writes and retains temporal.Interval for stored operations. Example: NullableInputInterval[Booking, PeriodInput].
func NullableInputIntervalOf ¶
func NullableInputIntervalOf[M, I any](b Builder[M], ptr *value.Nullable[temporal.Interval], transform func(I) (temporal.Interval, error), opts ...ColumnOption[temporal.Interval]) NullableInputInterval[M, I]
NullableInputIntervalOf binds a distinct input. A nil transform selects the model Mutate method. Example: NullableInputIntervalOf[Booking, PeriodInput](b, &booking.Period, nil).
type NullableInputIntervalAdapter ¶ added in v0.2.0
type NullableInputIntervalAdapter[M, I any] NullableInputInterval[M, I]
NullableInputIntervalAdapter retains the column's typed, sealed expression/source capabilities. Example: NullableInputIntervalExpr(column).
func NullableInputIntervalExpr ¶ added in v0.2.0
func NullableInputIntervalExpr[M, I any](c NullableInputInterval[M, I]) NullableInputIntervalAdapter[M, I]
NullableInputIntervalExpr opts into the column's sealed expression/source capabilities. Example: NullableInputIntervalExpr(column).
type NullableInputJSON ¶
NullableInputJSON accepts I for writes and retains value.JSON[T] for stored operations. Example: NullableInputJSON[Member, PreferencesInput, Preferences].
func NullableInputJSONOf ¶
func NullableInputJSONOf[M, I any, T any](b Builder[M], ptr *value.Nullable[value.JSON[T]], transform func(I) (value.JSON[T], error), opts ...ColumnOption[value.JSON[T]]) NullableInputJSON[M, I, T]
NullableInputJSONOf binds a distinct input. A nil transform selects the model Mutate method. Example: NullableInputJSONOf[Member, PreferencesInput](b, &member.Settings, nil).
type NullableInputJSONAdapter ¶ added in v0.2.0
type NullableInputJSONAdapter[M, I any, T any] NullableInputJSON[M, I, T]
NullableInputJSONAdapter retains the column's typed, sealed expression/source capabilities. Example: NullableInputJSONExpr(column).
func NullableInputJSONExpr ¶ added in v0.2.0
func NullableInputJSONExpr[M, I any, T any](c NullableInputJSON[M, I, T]) NullableInputJSONAdapter[M, I, T]
NullableInputJSONExpr opts into the column's sealed expression/source capabilities. Example: NullableInputJSONExpr(column).
type NullableInputNumber ¶
type NullableInputNumber[M, I any, V NumberValue] struct { // contains filtered or unexported fields }
NullableInputNumber accepts I for writes and retains V for stored operations. Example: NullableInputNumber[Invoice, AmountInput, int64].
func NullableInputNumberOf ¶
func NullableInputNumberOf[M, I any, V NumberValue](b Builder[M], ptr *value.Nullable[V], transform func(I) (V, error), opts ...ColumnOption[V]) NullableInputNumber[M, I, V]
NullableInputNumberOf binds a distinct input. A nil transform selects the model Mutate method. Example: NullableInputNumberOf[Invoice, AmountInput](b, &invoice.Amount, nil).
type NullableInputNumberAdapter ¶ added in v0.2.0
type NullableInputNumberAdapter[M, I any, V NumberValue] NullableInputNumber[M, I, V]
NullableInputNumberAdapter retains the column's typed, sealed expression/source capabilities. Example: NullableInputNumberExpr(column).
func NullableInputNumberExpr ¶ added in v0.2.0
func NullableInputNumberExpr[M, I any, V NumberValue](c NullableInputNumber[M, I, V]) NullableInputNumberAdapter[M, I, V]
NullableInputNumberExpr opts into the column's sealed expression/source capabilities. Example: NullableInputNumberExpr(column).
type NullableInputText ¶
NullableInputText accepts I for writes and retains V for stored operations. Example: NullableInputText[Member, LabelInput, StoredLabel].
func NullableInputTextOf ¶
func NullableInputTextOf[M, I any, V ~string](b Builder[M], ptr *value.Nullable[V], transform func(I) (V, error), opts ...ColumnOption[V]) NullableInputText[M, I, V]
NullableInputTextOf binds a distinct input. A nil transform selects the model Mutate method. Example: NullableInputTextOf[Member, LabelInput](b, &member.Note, nil).
type NullableInputTextAdapter ¶ added in v0.2.0
type NullableInputTextAdapter[M, I any, V ~string] NullableInputText[M, I, V]
NullableInputTextAdapter retains the column's typed, sealed expression/source capabilities. Example: NullableInputTextExpr(column).
func NullableInputTextExpr ¶ added in v0.2.0
func NullableInputTextExpr[M, I any, V ~string](c NullableInputText[M, I, V]) NullableInputTextAdapter[M, I, V]
NullableInputTextExpr opts into the column's sealed expression/source capabilities. Example: NullableInputTextExpr(column).
type NullableInputTime ¶
NullableInputTime accepts I for writes and retains V for stored operations. Example: NullableInputTime[Event, TimestampInput, time.Time].
func NullableInputTimeOf ¶
func NullableInputTimeOf[M, I any, V TimeValue](b Builder[M], ptr *value.Nullable[V], transform func(I) (V, error), opts ...ColumnOption[V]) NullableInputTime[M, I, V]
NullableInputTimeOf binds a distinct input. A nil transform selects the model Mutate method. Example: NullableInputTimeOf[Event, TimestampInput](b, &event.StartsAt, nil).
type NullableInputTimeAdapter ¶ added in v0.2.0
type NullableInputTimeAdapter[M, I any, V TimeValue] NullableInputTime[M, I, V]
NullableInputTimeAdapter retains the column's typed, sealed expression/source capabilities. Example: NullableInputTimeExpr(column).
func NullableInputTimeExpr ¶ added in v0.2.0
func NullableInputTimeExpr[M, I any, V TimeValue](c NullableInputTime[M, I, V]) NullableInputTimeAdapter[M, I, V]
NullableInputTimeExpr opts into the column's sealed expression/source capabilities. Example: NullableInputTimeExpr(column).
type NullableInterval ¶
type NullableInterval[M any] struct { // contains filtered or unexported fields }
NullableInterval adds SQL NULL to interval predicates and assignments. PostgreSQL compares using 30-day months and 24-hour days: Eq(temporal.Months(1)) also matches 30 days. Hydration preserves distinct calendar and elapsed components. Example: orm.NullableIntervalIsNull(Records.MaybePeriod).
func NullableIntervalOf ¶
func NullableIntervalOf[M any](b Builder[M], ptr *value.Nullable[temporal.Interval], opts ...ColumnOption[temporal.Interval]) NullableInterval[M]
NullableIntervalOf binds nullable intervals. Example: NullableIntervalOf(b, &m.MaybePeriod).
type NullableIntervalAdapter ¶ added in v0.2.0
type NullableIntervalAdapter[M any] NullableInterval[M]
NullableIntervalAdapter retains the column's typed, sealed expression/source capabilities. Example: NullableIntervalExpr(column).
func NullableIntervalExpr ¶ added in v0.2.0
func NullableIntervalExpr[M any](c NullableInterval[M]) NullableIntervalAdapter[M]
NullableIntervalExpr opts into the column's sealed expression/source capabilities. Example: NullableIntervalExpr(column).
type NullableJSON ¶
type NullableJSON[M, T any] struct { // contains filtered or unexported fields }
NullableJSON distinguishes SQL NULL from a typed JSON document, including JSON null. Example: orm.NullableJSONIsNull(Records.MaybeSettings).
func NullableJSONOf ¶
func NullableJSONOf[M, T any](b Builder[M], ptr *value.Nullable[value.JSON[T]], opts ...ColumnOption[value.JSON[T]]) NullableJSON[M, T]
NullableJSONOf binds nullable typed JSON. Example: NullableJSONOf(b,&m.MaybeSettings).
type NullableJSONAdapter ¶ added in v0.2.0
type NullableJSONAdapter[M, T any] NullableJSON[M, T]
NullableJSONAdapter retains the column's typed, sealed expression/source capabilities. Example: NullableJSONExpr(column).
func NullableJSONExpr ¶ added in v0.2.0
func NullableJSONExpr[M, T any](c NullableJSON[M, T]) NullableJSONAdapter[M, T]
NullableJSONExpr opts into the column's sealed expression/source capabilities. Example: NullableJSONExpr(column).
type NullableNumber ¶
type NullableNumber[M any, V NumberValue] struct { // contains filtered or unexported fields }
NullableNumber exposes nullable numeric values. Example: orm.NullableNumberIsNull(LedgerEntries.Balance).
func NullableNumberOf ¶
func NullableNumberOf[M any, V NumberValue](b Builder[M], ptr *value.Nullable[V], opts ...ColumnOption[V]) NullableNumber[M, V]
NullableNumberOf binds nullable numeric values. Example: NullableNumberOf(b,&o.Balance).
type NullableNumberAdapter ¶ added in v0.2.0
type NullableNumberAdapter[M any, V NumberValue] NullableNumber[M, V]
NullableNumberAdapter retains the column's typed, sealed expression/source capabilities. Example: NullableNumberExpr(column).
func NullableNumberExpr ¶ added in v0.2.0
func NullableNumberExpr[M any, V NumberValue](c NullableNumber[M, V]) NullableNumberAdapter[M, V]
NullableNumberExpr opts into the column's sealed expression/source capabilities. Example: NullableNumberExpr(column).
type NullableText ¶
NullableText exposes nullable text. Example: orm.NullableTextSetNull(Users.Nickname).
func NullableTextOf ¶
func NullableTextOf[M any, V ~string](b Builder[M], ptr *value.Nullable[V], opts ...ColumnOption[V]) NullableText[M, V]
NullableTextOf binds nullable text. Example: NullableTextOf(b,&o.Nickname).
type NullableTextAdapter ¶ added in v0.2.0
type NullableTextAdapter[M any, V ~string] NullableText[M, V]
NullableTextAdapter retains the column's typed, sealed expression/source capabilities. Example: NullableTextExpr(column).
func NullableTextExpr ¶ added in v0.2.0
func NullableTextExpr[M any, V ~string](c NullableText[M, V]) NullableTextAdapter[M, V]
NullableTextExpr opts into the column's sealed expression/source capabilities. Example: NullableTextExpr(column).
type NullableTime ¶
NullableTime exposes nullable temporal values. Example: orm.NullableTimeIsNull(Users.Birthday).
func NullableTimeOf ¶
func NullableTimeOf[M any, V TimeValue](b Builder[M], ptr *value.Nullable[V], opts ...ColumnOption[V]) NullableTime[M, V]
NullableTimeOf binds nullable temporal values. Example: NullableTimeOf(b,&o.Birthday).
type Number ¶
type Number[M any, V NumberValue] = numberColumn[M, V, ordinaryRole]
Number exposes ordered numeric comparisons. Example: Number[Order,int64].
func NumberOf ¶
func NumberOf[M any, V NumberValue](b Builder[M], ptr *V, opts ...ColumnOption[V]) Number[M, V]
NumberOf selects a numeric codec at startup. Example: NumberOf(b,&o.TotalCents).
type NumberLookupKey ¶
type NumberLookupKey[M any, K interface { NumberValue comparable }] = numberKeyColumn[M, K, lookupKeyRole]
NumberLookupKey retains the primary lookup role. Example: NumberKey(table.Key()).
type NumberPrimary ¶
type NumberPrimary[M any, K interface { NumberValue comparable }] = numberKeyColumn[M, K, primaryRole]
NumberPrimary preserves numeric primary capabilities. Example: NumberKey(PrimaryOf(b, table.Key())).
type NumberValue ¶
type NumberValue interface {
~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~float32 | ~float64 | decimal.Decimal
}
NumberValue permits exact and approximate numeric fields. Example: Number[Order, int64].
type Observer ¶
type Observer[M any] struct { // contains filtered or unexported fields }
Observer fixes registration to this model's Hooks type. Example: NewObserver[Order]("orders.audit").
func NewDeletionObserver ¶
NewDeletionObserver observes only delete/soft-delete/force-delete writes. Example: NewDeletionObserver[Order]("orders.removal").
func NewObserver ¶
NewObserver declares a write observer without invoking its factory. Example: NewObserver[Order]("orders.audit").
func (Observer[M]) Declare ¶
func (o Observer[M]) Declare(factory func() Hooks[M]) (lifecycle.Declaration, error)
Declare captures a typed per-operation factory. Example: NewObserver[Order]("orders.audit").Declare(orderAuditHooks).
type One ¶
type One[M, N any] struct { // contains filtered or unexported fields }
One identifies a singular model slot. Example: Buyer One[Order,User].
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
Option configures a declaration. Example: Define("logs", declare, NoTimestamps()).
func NoSoftDeletes ¶
func NoSoftDeletes() Option
NoSoftDeletes disables the DeletedAt convention. Explicit SoftDeleteOf conflicts with this option.
func NoTimestamps ¶
func NoTimestamps() Option
NoTimestamps disables CreatedAt/UpdatedAt conventions. Example: NoTimestamps().
func WithGlobalScopes ¶
func WithGlobalScopes[M any, T CheckedTable](source func(T) []GlobalScope[M]) Option
WithGlobalScopes attaches a lazy immutable source, evaluated once when needed. The source receives an owned copy of the completed declaration, avoiding Go initialization cycles. It may reference relations; it must not execute or compile queries. Example: WithGlobalScopes(func(t OrderTable) []GlobalScope[Order] { return []GlobalScope[Order]{Scope(t.Table, "tenant", tenantPredicate(t))} }).
func WithHooks ¶
WithHooks installs a factory invoked once per normal write, after row locking. Example: Define("orders", declareOrders, WithHooks(func() Hooks[Order] { return Hooks[Order]{} })).
func WithRetrievalHooks ¶
func WithRetrievalHooks[M any](factory func() RetrievalHooks[M]) Option
WithRetrievalHooks installs a factory run once per nonempty complete batch. Example: WithRetrievalHooks(func() RetrievalHooks[Order] { return orderReadHooks() }).
type Order ¶
type Order[M any] struct { // contains filtered or unexported fields }
Order is a model-owned sort direction. Example: orm.KeyAsc(Orders.ID).
func ColumnDesc ¶ added in v0.2.0
ColumnDesc sorts descending. Example: ColumnDesc(Orders.BuyerID).
func FoundryRelationOrder ¶
func FoundryRelationOrder[M, N any](r ExistenceRelation[M, N], o ormcore.Order, seal sqlowner.MetadataSeal) Order[N]
FoundryRelationOrder validates a computed order against the actual relation target. Example: FoundryRelationOrder(r,o,sqlowner.Metadata()).
func FoundryRelationPivotOrder ¶
func FoundryRelationPivotOrder[M, N, P any](r ThroughRelation[M, N, P], o ormcore.Order, seal sqlowner.MetadataSeal) Order[P]
FoundryRelationPivotOrder validates both relation owners and the concrete pivot. Example: FoundryRelationPivotOrder(r,o,sqlowner.Metadata()).
func InputColumnAsc ¶ added in v0.2.0
func InputColumnAsc[M, I any, V any](c InputColumn[M, I, V]) Order[M]
InputColumnAsc retains the stored column operation; Set alone accepts I. Example: InputColumnAsc(members.Email).
func InputColumnDesc ¶ added in v0.2.0
func InputColumnDesc[M, I any, V any](c InputColumn[M, I, V]) Order[M]
InputColumnDesc retains the stored column operation; Set alone accepts I. Example: InputColumnDesc(members.Email).
func InputEnumAsc ¶ added in v0.2.0
func InputEnumAsc[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c InputEnum[M, I, E]) Order[M]
InputEnumAsc retains the stored enum operation; Set alone accepts I. Example: InputEnumAsc(members.Status).
func InputEnumDesc ¶ added in v0.2.0
func InputEnumDesc[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c InputEnum[M, I, E]) Order[M]
InputEnumDesc retains the stored enum operation; Set alone accepts I. Example: InputEnumDesc(members.Status).
func InputIntervalAsc ¶ added in v0.2.0
func InputIntervalAsc[M, I any](c InputInterval[M, I]) Order[M]
InputIntervalAsc retains the stored interval operation; Set alone accepts I. Example: InputIntervalAsc(bookings.Period).
func InputIntervalDesc ¶ added in v0.2.0
func InputIntervalDesc[M, I any](c InputInterval[M, I]) Order[M]
InputIntervalDesc retains the stored interval operation; Set alone accepts I. Example: InputIntervalDesc(bookings.Period).
func InputJSONAsc ¶ added in v0.2.0
InputJSONAsc retains the stored json operation; Set alone accepts I. Example: InputJSONAsc(members.Settings).
func InputJSONDesc ¶ added in v0.2.0
InputJSONDesc retains the stored json operation; Set alone accepts I. Example: InputJSONDesc(members.Settings).
func InputKeyAsc ¶ added in v0.2.0
func InputKeyAsc[M, I any, K comparable](c InputKey[M, I, K]) Order[M]
InputKeyAsc orders by stored key. Example: InputKeyAsc(users.ID).
func InputKeyDesc ¶ added in v0.2.0
func InputKeyDesc[M, I any, K comparable](c InputKey[M, I, K]) Order[M]
InputKeyDesc orders by stored key. Example: InputKeyDesc(users.ID).
func InputNumberAsc ¶ added in v0.2.0
func InputNumberAsc[M, I any, V NumberValue](c InputNumber[M, I, V]) Order[M]
InputNumberAsc retains the stored number operation; Set alone accepts I. Example: InputNumberAsc(invoices.Amount).
func InputNumberDesc ¶ added in v0.2.0
func InputNumberDesc[M, I any, V NumberValue](c InputNumber[M, I, V]) Order[M]
InputNumberDesc retains the stored number operation; Set alone accepts I. Example: InputNumberDesc(invoices.Amount).
func InputTextAsc ¶ added in v0.2.0
InputTextAsc retains the stored text operation; Set alone accepts I. Example: InputTextAsc(members.Email).
func InputTextDesc ¶ added in v0.2.0
InputTextDesc retains the stored text operation; Set alone accepts I. Example: InputTextDesc(members.Email).
func InputTimeAsc ¶ added in v0.2.0
InputTimeAsc retains the stored time operation; Set alone accepts I. Example: InputTimeAsc(events.StartsAt).
func InputTimeDesc ¶ added in v0.2.0
InputTimeDesc retains the stored time operation; Set alone accepts I. Example: InputTimeDesc(events.StartsAt).
func IntervalAsc ¶ added in v0.2.0
IntervalAsc sorts ascending. Example: IntervalAsc(Records.Period).
func IntervalDesc ¶ added in v0.2.0
IntervalDesc sorts descending. Example: IntervalDesc(Records.Period).
func KeyAsc ¶ added in v0.2.0
func KeyAsc[M any, K comparable, R columnRole](c keyColumn[M, K, R]) Order[M]
KeyAsc sorts ascending. Example: KeyAsc(Orders.ID).
func KeyDesc ¶ added in v0.2.0
func KeyDesc[M any, K comparable, R columnRole](c keyColumn[M, K, R]) Order[M]
KeyDesc sorts descending. Example: KeyDesc(Orders.ID).
func NullableColumnAsc ¶ added in v0.2.0
func NullableColumnAsc[M, V any](c NullableColumn[M, V]) Order[M]
NullableColumnAsc sorts ascending. Example: NullableColumnAsc(Users.IntroducerID).
func NullableColumnDesc ¶ added in v0.2.0
func NullableColumnDesc[M, V any](c NullableColumn[M, V]) Order[M]
NullableColumnDesc sorts descending. Example: NullableColumnDesc(Users.IntroducerID).
func NullableEnumAsc ¶ added in v0.2.0
func NullableEnumAsc[M any, E enum.Scalar](c NullableEnum[M, E]) Order[M]
NullableEnumAsc sorts ascending. Example: NullableEnumAsc(optionalStatus) (optionalStatus is orm.NullableEnum[User, Status]).
func NullableEnumDesc ¶ added in v0.2.0
func NullableEnumDesc[M any, E enum.Scalar](c NullableEnum[M, E]) Order[M]
NullableEnumDesc sorts descending. Example: NullableEnumDesc(optionalStatus) (optionalStatus is orm.NullableEnum[User, Status]).
func NullableInputColumnAsc ¶ added in v0.2.0
func NullableInputColumnAsc[M, I any, V any](c NullableInputColumn[M, I, V]) Order[M]
NullableInputColumnAsc retains the stored column operation; Set alone accepts I. Example: NullableInputColumnAsc(members.Note).
func NullableInputColumnDesc ¶ added in v0.2.0
func NullableInputColumnDesc[M, I any, V any](c NullableInputColumn[M, I, V]) Order[M]
NullableInputColumnDesc retains the stored column operation; Set alone accepts I. Example: NullableInputColumnDesc(members.Note).
func NullableInputEnumAsc ¶ added in v0.2.0
func NullableInputEnumAsc[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c NullableInputEnum[M, I, E]) Order[M]
NullableInputEnumAsc retains the stored enum operation; Set alone accepts I. Example: NullableInputEnumAsc(members.OptionalStatus).
func NullableInputEnumDesc ¶ added in v0.2.0
func NullableInputEnumDesc[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c NullableInputEnum[M, I, E]) Order[M]
NullableInputEnumDesc retains the stored enum operation; Set alone accepts I. Example: NullableInputEnumDesc(members.OptionalStatus).
func NullableInputIntervalAsc ¶ added in v0.2.0
func NullableInputIntervalAsc[M, I any](c NullableInputInterval[M, I]) Order[M]
NullableInputIntervalAsc retains the stored interval operation; Set alone accepts I. Example: NullableInputIntervalAsc(bookings.OptionalPeriod).
func NullableInputIntervalDesc ¶ added in v0.2.0
func NullableInputIntervalDesc[M, I any](c NullableInputInterval[M, I]) Order[M]
NullableInputIntervalDesc retains the stored interval operation; Set alone accepts I. Example: NullableInputIntervalDesc(bookings.OptionalPeriod).
func NullableInputJSONAsc ¶ added in v0.2.0
func NullableInputJSONAsc[M, I any, T any](c NullableInputJSON[M, I, T]) Order[M]
NullableInputJSONAsc retains the stored json operation; Set alone accepts I. Example: NullableInputJSONAsc(members.BackupSettings).
func NullableInputJSONDesc ¶ added in v0.2.0
func NullableInputJSONDesc[M, I any, T any](c NullableInputJSON[M, I, T]) Order[M]
NullableInputJSONDesc retains the stored json operation; Set alone accepts I. Example: NullableInputJSONDesc(members.BackupSettings).
func NullableInputNumberAsc ¶ added in v0.2.0
func NullableInputNumberAsc[M, I any, V NumberValue](c NullableInputNumber[M, I, V]) Order[M]
NullableInputNumberAsc retains the stored number operation; Set alone accepts I. Example: NullableInputNumberAsc(invoices.OptionalAmount).
func NullableInputNumberDesc ¶ added in v0.2.0
func NullableInputNumberDesc[M, I any, V NumberValue](c NullableInputNumber[M, I, V]) Order[M]
NullableInputNumberDesc retains the stored number operation; Set alone accepts I. Example: NullableInputNumberDesc(invoices.OptionalAmount).
func NullableInputTextAsc ¶ added in v0.2.0
func NullableInputTextAsc[M, I any, V ~string](c NullableInputText[M, I, V]) Order[M]
NullableInputTextAsc retains the stored text operation; Set alone accepts I. Example: NullableInputTextAsc(members.Note).
func NullableInputTextDesc ¶ added in v0.2.0
func NullableInputTextDesc[M, I any, V ~string](c NullableInputText[M, I, V]) Order[M]
NullableInputTextDesc retains the stored text operation; Set alone accepts I. Example: NullableInputTextDesc(members.Note).
func NullableInputTimeAsc ¶ added in v0.2.0
func NullableInputTimeAsc[M, I any, V TimeValue](c NullableInputTime[M, I, V]) Order[M]
NullableInputTimeAsc retains the stored time operation; Set alone accepts I. Example: NullableInputTimeAsc(events.OptionalStartsAt).
func NullableInputTimeDesc ¶ added in v0.2.0
func NullableInputTimeDesc[M, I any, V TimeValue](c NullableInputTime[M, I, V]) Order[M]
NullableInputTimeDesc retains the stored time operation; Set alone accepts I. Example: NullableInputTimeDesc(events.OptionalStartsAt).
func NullableIntervalAsc ¶ added in v0.2.0
func NullableIntervalAsc[M any](c NullableInterval[M]) Order[M]
NullableIntervalAsc sorts ascending. Example: NullableIntervalAsc(Records.MaybePeriod).
func NullableIntervalDesc ¶ added in v0.2.0
func NullableIntervalDesc[M any](c NullableInterval[M]) Order[M]
NullableIntervalDesc sorts descending. Example: NullableIntervalDesc(Records.MaybePeriod).
func NullableJSONAsc ¶ added in v0.2.0
func NullableJSONAsc[M, T any](c NullableJSON[M, T]) Order[M]
NullableJSONAsc sorts ascending. Example: NullableJSONAsc(Records.MaybeSettings).
func NullableJSONDesc ¶ added in v0.2.0
func NullableJSONDesc[M, T any](c NullableJSON[M, T]) Order[M]
NullableJSONDesc sorts descending. Example: NullableJSONDesc(Records.MaybeSettings).
func NullableNumberAsc ¶ added in v0.2.0
func NullableNumberAsc[M any, V NumberValue](c NullableNumber[M, V]) Order[M]
NullableNumberAsc sorts ascending. Example: NullableNumberAsc(LedgerEntries.Balance).
func NullableNumberDesc ¶ added in v0.2.0
func NullableNumberDesc[M any, V NumberValue](c NullableNumber[M, V]) Order[M]
NullableNumberDesc sorts descending. Example: NullableNumberDesc(LedgerEntries.Balance).
func NullableTextAsc ¶ added in v0.2.0
func NullableTextAsc[M any, V ~string](c NullableText[M, V]) Order[M]
NullableTextAsc sorts ascending. Example: NullableTextAsc(Users.Nickname).
func NullableTextDesc ¶ added in v0.2.0
func NullableTextDesc[M any, V ~string](c NullableText[M, V]) Order[M]
NullableTextDesc sorts descending. Example: NullableTextDesc(Users.Nickname).
func NullableTimeAsc ¶ added in v0.2.0
NullableTimeAsc sorts ascending. Example: NullableTimeAsc(Users.Birthday).
func NullableTimeDesc ¶ added in v0.2.0
NullableTimeDesc sorts descending. Example: NullableTimeDesc(Users.Birthday).
func NumberAsc ¶ added in v0.2.0
func NumberAsc[M any, V NumberValue, R columnRole](c numberColumn[M, V, R]) Order[M]
NumberAsc sorts ascending. Example: NumberAsc(Orders.TotalCents).
func NumberDesc ¶ added in v0.2.0
func NumberDesc[M any, V NumberValue, R columnRole](c numberColumn[M, V, R]) Order[M]
NumberDesc sorts descending. Example: NumberDesc(Orders.TotalCents).
func NumberKeyAsc ¶ added in v0.2.0
func NumberKeyAsc[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R]) Order[M]
NumberKeyAsc sorts ascending. Example: NumberKeyAsc(Orders.ID).
func NumberKeyDesc ¶ added in v0.2.0
func NumberKeyDesc[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R]) Order[M]
NumberKeyDesc sorts descending. Example: NumberKeyDesc(Orders.ID).
func TimeAsc ¶ added in v0.2.0
TimeAsc sorts ascending. Example: TimeAsc(createdAt) (createdAt is orm.Time[User, time.Time]).
func TimeDesc ¶ added in v0.2.0
TimeDesc sorts descending. Example: TimeDesc(createdAt) (createdAt is orm.Time[User, time.Time]).
func (Order[M]) NullsFirst ¶
NullsFirst places NULL before concrete values.
type OrderedExpressionColumn ¶
type OrderedExpressionColumn[M, V, P any] interface { ExpressionColumn[M, V, P] // contains filtered or unexported methods }
OrderedExpressionColumn is the sealed capability for ordered stored fields. The private marker also covers input handles: aggregates read their stored value. Example: func minimum[M,V,P any,C orm.OrderedExpressionColumn[M,V,P]](c C).
type PageRequest ¶
type PageRequest = querycore.PageRequest
PageRequest retains the existing pagination validation contract. Example: Page(2,20).
func Page ¶
func Page(number, size int) PageRequest
Page selects a one-based page. Example: orm.Paginate(ctx, db, Orders.Query(), Page(2,20)).
type PageResult ¶
PageResult retains the existing pagination response contract. Example: page.Items.
type PivotChanges ¶
type PivotChanges[P any] struct { // Attached contains newly inserted pivots. Example: changes.Attached[0].ID // identifies the membership created by Sync or Toggle. Attached []P // Detached contains pivots removed by Sync or Toggle. Soft-delete models // remain stored with DeletedAt set; ordinary models are physically deleted. // Example: changes.Detached[0].ID identifies the removed membership in either case. Detached []P // Updated contains retained pivots patched by Sync or SyncWithoutDetaching. // Example: changes.Updated[0].Role is the membership role after its update. Updated []P }
PivotChanges contains reconciliation-ready concrete pivot models. Example: changes.Attached[0].ID.
func Sync ¶
func Sync[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], source M, targets []N, create, update []Assignment[P]) (PivotChanges[P], error)
Sync creates missing links, removes others and optionally updates retained links. A nil update leaves retained links unchanged. Example: orm.Sync(ctx,db,links,user,groups,create,nil).
func SyncWithoutDetaching ¶
func SyncWithoutDetaching[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], source M, targets []N, create, update []Assignment[P]) (PivotChanges[P], error)
SyncWithoutDetaching creates missing links and optionally updates retained links. Example: orm.SyncWithoutDetaching(ctx,db,links,user,groups,create,nil).
func Toggle ¶
func Toggle[M, N, P any](ctx context.Context, writer database.Transactor, r ThroughRelation[M, N, P], source M, targets []N, create ...Assignment[P]) (PivotChanges[P], error)
Toggle removes linked targets and attaches unlinked targets atomically. Example: orm.Toggle(ctx,db,links,user,groups,orm.InputTextSet(Memberships.Role, "member")).
type Plan ¶
Plan owns bounded PostgreSQL plan data; formatting omits predicates and values. Example: plan.Root().TotalCost.
func Explain ¶
Explain plans a SELECT without hydration, retrieval callbacks or eager loads. Example: orm.Explain(ctx, db, Users.Query()).
func ExplainAnalyze ¶
ExplainAnalyze executes the SELECT and includes actual measurements. Example: orm.ExplainAnalyze(ctx, db, Users.Query().Limit(10)).
func ExplainAnalyzeLocked ¶
func ExplainAnalyzeLocked[M any](ctx context.Context, tx *database.Tx, q LockedQuery[M]) (Plan, error)
ExplainAnalyzeLocked takes the SELECT locks in the caller's transaction. Example: orm.ExplainAnalyzeLocked(ctx, tx, orm.Lock(Users.Query())).
func ExplainLocked ¶
ExplainLocked plans a locked SELECT using its required transaction. Example: orm.ExplainLocked(ctx, tx, orm.Lock(Users.Query())).
type Predicate ¶
type Predicate[M any] struct { // contains filtered or unexported fields }
Predicate is a model-owned SQL condition. Example: orm.KeyEq(Orders.ID, id).
func And ¶
And combines model-owned conditions. Example: And(orm.KeyEq(Orders.ID, id),orm.NumberGt(Orders.TotalCents, 0)).
func ColumnEq ¶ added in v0.2.0
ColumnEq compares a concrete value. Example: ColumnEq(Orders.BuyerID, userID).
func ColumnNe ¶ added in v0.2.0
ColumnNe excludes a concrete value. Example: ColumnNe(Orders.BuyerID, userID).
func ColumnNotIn ¶ added in v0.2.0
ColumnNotIn excludes membership. Example: ColumnNotIn(Orders.BuyerID, a, b).
func EnumEq ¶ added in v0.2.0
EnumEq compares a concrete value. Example: EnumEq(Users.Status, StatusActive).
func EnumNe ¶ added in v0.2.0
EnumNe excludes a concrete value. Example: EnumNe(Users.Status, StatusActive).
func EnumNotIn ¶ added in v0.2.0
EnumNotIn excludes membership. Example: EnumNotIn(Users.Status, a, b).
func FoundryRelationFilter ¶
func FoundryRelationFilter[M, N any](r ExistenceRelation[M, N], p ormcore.Predicate, seal sqlowner.MetadataSeal) Predicate[N]
FoundryRelationFilter validates expression conditions for a relation target. Example: FoundryRelationFilter(r,p,sqlowner.Metadata()).
func FoundryRelationPredicate ¶
func FoundryRelationPredicate[M, N any](r ExistenceRelation[M, N], ps []ormcore.Predicate, seal sqlowner.MetadataSeal) Predicate[M]
FoundryRelationPredicate validates projected child conditions at the relation owner. Example: FoundryRelationPredicate(r,ps,sqlowner.Metadata()).
func Has ¶
func Has[M, N any](r ExistenceRelation[M, N], ps ...Predicate[N]) Predicate[M]
Has matches parents with related rows satisfying the target predicates and related scopes, without eager loading. Example: Users.Query().Where(orm.Has(UserRelations.Orders)).
func InputColumnEq ¶ added in v0.2.0
func InputColumnEq[M, I any, V any](c InputColumn[M, I, V], v V) Predicate[M]
InputColumnEq retains the stored column operation; Set alone accepts I. Example: InputColumnEq(members.Email, StoredEmail("ada@example.test")).
func InputColumnIn ¶ added in v0.2.0
func InputColumnIn[M, I any, V any](c InputColumn[M, I, V], v ...V) Predicate[M]
InputColumnIn retains the stored column operation; Set alone accepts I. Example: InputColumnIn(members.Email, StoredEmail("ada@example.test")).
func InputColumnNe ¶ added in v0.2.0
func InputColumnNe[M, I any, V any](c InputColumn[M, I, V], v V) Predicate[M]
InputColumnNe retains the stored column operation; Set alone accepts I. Example: InputColumnNe(members.Email, StoredEmail("ada@example.test")).
func InputColumnNotIn ¶ added in v0.2.0
func InputColumnNotIn[M, I any, V any](c InputColumn[M, I, V], v ...V) Predicate[M]
InputColumnNotIn retains the stored column operation; Set alone accepts I. Example: InputColumnNotIn(members.Email, StoredEmail("ada@example.test")).
func InputEnumEq ¶ added in v0.2.0
func InputEnumEq[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c InputEnum[M, I, E], v E) Predicate[M]
InputEnumEq retains the stored enum operation; Set alone accepts I. Example: InputEnumEq(members.Status, StatusActive).
func InputEnumIn ¶ added in v0.2.0
func InputEnumIn[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c InputEnum[M, I, E], v ...E) Predicate[M]
InputEnumIn retains the stored enum operation; Set alone accepts I. Example: InputEnumIn(members.Status, StatusActive).
func InputEnumNe ¶ added in v0.2.0
func InputEnumNe[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c InputEnum[M, I, E], v E) Predicate[M]
InputEnumNe retains the stored enum operation; Set alone accepts I. Example: InputEnumNe(members.Status, StatusActive).
func InputEnumNotIn ¶ added in v0.2.0
func InputEnumNotIn[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c InputEnum[M, I, E], v ...E) Predicate[M]
InputEnumNotIn retains the stored enum operation; Set alone accepts I. Example: InputEnumNotIn(members.Status, StatusActive).
func InputIntervalBetween ¶ added in v0.2.0
func InputIntervalBetween[M, I any](c InputInterval[M, I], a, b temporal.Interval) Predicate[M]
InputIntervalBetween retains the stored interval operation; Set alone accepts I. Example: InputIntervalBetween(bookings.Period, temporal.Days(1), temporal.Days(7)).
func InputIntervalEq ¶ added in v0.2.0
func InputIntervalEq[M, I any](c InputInterval[M, I], v temporal.Interval) Predicate[M]
InputIntervalEq retains the stored interval operation; Set alone accepts I. Example: InputIntervalEq(bookings.Period, temporal.Days(1)).
func InputIntervalGt ¶ added in v0.2.0
func InputIntervalGt[M, I any](c InputInterval[M, I], v temporal.Interval) Predicate[M]
InputIntervalGt retains the stored interval operation; Set alone accepts I. Example: InputIntervalGt(bookings.Period, temporal.Days(1)).
func InputIntervalGte ¶ added in v0.2.0
func InputIntervalGte[M, I any](c InputInterval[M, I], v temporal.Interval) Predicate[M]
InputIntervalGte retains the stored interval operation; Set alone accepts I. Example: InputIntervalGte(bookings.Period, temporal.Days(1)).
func InputIntervalIn ¶ added in v0.2.0
func InputIntervalIn[M, I any](c InputInterval[M, I], v ...temporal.Interval) Predicate[M]
InputIntervalIn retains the stored interval operation; Set alone accepts I. Example: InputIntervalIn(bookings.Period, temporal.Days(1)).
func InputIntervalLt ¶ added in v0.2.0
func InputIntervalLt[M, I any](c InputInterval[M, I], v temporal.Interval) Predicate[M]
InputIntervalLt retains the stored interval operation; Set alone accepts I. Example: InputIntervalLt(bookings.Period, temporal.Days(1)).
func InputIntervalLte ¶ added in v0.2.0
func InputIntervalLte[M, I any](c InputInterval[M, I], v temporal.Interval) Predicate[M]
InputIntervalLte retains the stored interval operation; Set alone accepts I. Example: InputIntervalLte(bookings.Period, temporal.Days(1)).
func InputIntervalNe ¶ added in v0.2.0
func InputIntervalNe[M, I any](c InputInterval[M, I], v temporal.Interval) Predicate[M]
InputIntervalNe retains the stored interval operation; Set alone accepts I. Example: InputIntervalNe(bookings.Period, temporal.Days(1)).
func InputIntervalNotIn ¶ added in v0.2.0
func InputIntervalNotIn[M, I any](c InputInterval[M, I], v ...temporal.Interval) Predicate[M]
InputIntervalNotIn retains the stored interval operation; Set alone accepts I. Example: InputIntervalNotIn(bookings.Period, temporal.Days(1)).
func InputJSONContainedBy ¶ added in v0.2.0
InputJSONContainedBy retains the stored json operation; Set alone accepts I. Example: InputJSONContainedBy(members.Settings, storedPreferences).
func InputJSONContains ¶ added in v0.2.0
InputJSONContains retains the stored json operation; Set alone accepts I. Example: InputJSONContains(members.Settings, storedPreferences).
func InputJSONEq ¶ added in v0.2.0
InputJSONEq retains the stored json operation; Set alone accepts I. Example: InputJSONEq(members.Settings, storedPreferences).
func InputJSONIn ¶ added in v0.2.0
InputJSONIn retains the stored json operation; Set alone accepts I. Example: InputJSONIn(members.Settings, storedPreferences).
func InputJSONIsJSONNull ¶ added in v0.2.0
InputJSONIsJSONNull retains the stored json operation; Set alone accepts I. Example: InputJSONIsJSONNull(members.Settings).
func InputJSONNe ¶ added in v0.2.0
InputJSONNe retains the stored json operation; Set alone accepts I. Example: InputJSONNe(members.Settings, storedPreferences).
func InputJSONNotIn ¶ added in v0.2.0
InputJSONNotIn retains the stored json operation; Set alone accepts I. Example: InputJSONNotIn(members.Settings, storedPreferences).
func InputKeyEq ¶ added in v0.2.0
func InputKeyEq[M, I any, K comparable](c InputKey[M, I, K], v K) Predicate[M]
InputKeyEq compares the stored key. Example: InputKeyEq(users.ID, storedID).
func InputKeyIn ¶ added in v0.2.0
func InputKeyIn[M, I any, K comparable](c InputKey[M, I, K], v ...K) Predicate[M]
InputKeyIn matches stored keys. Example: InputKeyIn(users.ID, firstID, secondID).
func InputKeyNe ¶ added in v0.2.0
func InputKeyNe[M, I any, K comparable](c InputKey[M, I, K], v K) Predicate[M]
InputKeyNe excludes a stored key. Example: InputKeyNe(users.ID, storedID).
func InputKeyNotIn ¶ added in v0.2.0
func InputKeyNotIn[M, I any, K comparable](c InputKey[M, I, K], v ...K) Predicate[M]
InputKeyNotIn excludes stored keys. Example: InputKeyNotIn(users.ID, firstID, secondID).
func InputNumberBetween ¶ added in v0.2.0
func InputNumberBetween[M, I any, V NumberValue](c InputNumber[M, I, V], a, b V) Predicate[M]
InputNumberBetween retains the stored number operation; Set alone accepts I. Example: InputNumberBetween(invoices.Amount, int64(0), int64(1000)).
func InputNumberEq ¶ added in v0.2.0
func InputNumberEq[M, I any, V NumberValue](c InputNumber[M, I, V], v V) Predicate[M]
InputNumberEq retains the stored number operation; Set alone accepts I. Example: InputNumberEq(invoices.Amount, int64(100)).
func InputNumberGt ¶ added in v0.2.0
func InputNumberGt[M, I any, V NumberValue](c InputNumber[M, I, V], v V) Predicate[M]
InputNumberGt retains the stored number operation; Set alone accepts I. Example: InputNumberGt(invoices.Amount, int64(100)).
func InputNumberGte ¶ added in v0.2.0
func InputNumberGte[M, I any, V NumberValue](c InputNumber[M, I, V], v V) Predicate[M]
InputNumberGte retains the stored number operation; Set alone accepts I. Example: InputNumberGte(invoices.Amount, int64(100)).
func InputNumberIn ¶ added in v0.2.0
func InputNumberIn[M, I any, V NumberValue](c InputNumber[M, I, V], v ...V) Predicate[M]
InputNumberIn retains the stored number operation; Set alone accepts I. Example: InputNumberIn(invoices.Amount, int64(100)).
func InputNumberLt ¶ added in v0.2.0
func InputNumberLt[M, I any, V NumberValue](c InputNumber[M, I, V], v V) Predicate[M]
InputNumberLt retains the stored number operation; Set alone accepts I. Example: InputNumberLt(invoices.Amount, int64(100)).
func InputNumberLte ¶ added in v0.2.0
func InputNumberLte[M, I any, V NumberValue](c InputNumber[M, I, V], v V) Predicate[M]
InputNumberLte retains the stored number operation; Set alone accepts I. Example: InputNumberLte(invoices.Amount, int64(100)).
func InputNumberNe ¶ added in v0.2.0
func InputNumberNe[M, I any, V NumberValue](c InputNumber[M, I, V], v V) Predicate[M]
InputNumberNe retains the stored number operation; Set alone accepts I. Example: InputNumberNe(invoices.Amount, int64(100)).
func InputNumberNotIn ¶ added in v0.2.0
func InputNumberNotIn[M, I any, V NumberValue](c InputNumber[M, I, V], v ...V) Predicate[M]
InputNumberNotIn retains the stored number operation; Set alone accepts I. Example: InputNumberNotIn(invoices.Amount, int64(100)).
func InputTextBetween ¶ added in v0.2.0
InputTextBetween retains the stored text operation; Set alone accepts I. Example: InputTextBetween(members.Email, StoredEmail("a"), StoredEmail("z")).
func InputTextContains ¶ added in v0.2.0
InputTextContains retains the stored text operation; Set alone accepts I. Example: InputTextContains(members.Email, StoredEmail("ada@example.test")).
func InputTextEndsWith ¶ added in v0.2.0
InputTextEndsWith retains the stored text operation; Set alone accepts I. Example: InputTextEndsWith(members.Email, StoredEmail("ada@example.test")).
func InputTextEq ¶ added in v0.2.0
InputTextEq retains the stored text operation; Set alone accepts I. Example: InputTextEq(members.Email, StoredEmail("ada@example.test")).
func InputTextGt ¶ added in v0.2.0
InputTextGt retains the stored text operation; Set alone accepts I. Example: InputTextGt(members.Email, StoredEmail("ada@example.test")).
func InputTextGte ¶ added in v0.2.0
InputTextGte retains the stored text operation; Set alone accepts I. Example: InputTextGte(members.Email, StoredEmail("ada@example.test")).
func InputTextIContains ¶ added in v0.2.0
InputTextIContains retains the stored text operation; Set alone accepts I. Example: InputTextIContains(members.Email, StoredEmail("ada@example.test")).
func InputTextIEndsWith ¶ added in v0.2.0
InputTextIEndsWith retains the stored text operation; Set alone accepts I. Example: InputTextIEndsWith(members.Email, StoredEmail("ada@example.test")).
func InputTextILike ¶ added in v0.2.0
InputTextILike retains the stored text operation; Set alone accepts I. Example: InputTextILike(members.Email, StoredEmail("ada@example.test")).
func InputTextIStartsWith ¶ added in v0.2.0
InputTextIStartsWith retains the stored text operation; Set alone accepts I. Example: InputTextIStartsWith(members.Email, StoredEmail("ada@example.test")).
func InputTextIn ¶ added in v0.2.0
InputTextIn retains the stored text operation; Set alone accepts I. Example: InputTextIn(members.Email, StoredEmail("ada@example.test")).
func InputTextLike ¶ added in v0.2.0
InputTextLike retains the stored text operation; Set alone accepts I. Example: InputTextLike(members.Email, StoredEmail("ada@example.test")).
func InputTextLt ¶ added in v0.2.0
InputTextLt retains the stored text operation; Set alone accepts I. Example: InputTextLt(members.Email, StoredEmail("ada@example.test")).
func InputTextLte ¶ added in v0.2.0
InputTextLte retains the stored text operation; Set alone accepts I. Example: InputTextLte(members.Email, StoredEmail("ada@example.test")).
func InputTextNe ¶ added in v0.2.0
InputTextNe retains the stored text operation; Set alone accepts I. Example: InputTextNe(members.Email, StoredEmail("ada@example.test")).
func InputTextNotIn ¶ added in v0.2.0
InputTextNotIn retains the stored text operation; Set alone accepts I. Example: InputTextNotIn(members.Email, StoredEmail("ada@example.test")).
func InputTextStartsWith ¶ added in v0.2.0
InputTextStartsWith retains the stored text operation; Set alone accepts I. Example: InputTextStartsWith(members.Email, StoredEmail("ada@example.test")).
func InputTimeBetween ¶ added in v0.2.0
InputTimeBetween retains the stored time operation; Set alone accepts I. Example: InputTimeBetween(events.StartsAt, startsAt, endsAt).
func InputTimeEq ¶ added in v0.2.0
InputTimeEq retains the stored time operation; Set alone accepts I. Example: InputTimeEq(events.StartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func InputTimeGt ¶ added in v0.2.0
InputTimeGt retains the stored time operation; Set alone accepts I. Example: InputTimeGt(events.StartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func InputTimeGte ¶ added in v0.2.0
InputTimeGte retains the stored time operation; Set alone accepts I. Example: InputTimeGte(events.StartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func InputTimeIn ¶ added in v0.2.0
InputTimeIn retains the stored time operation; Set alone accepts I. Example: InputTimeIn(events.StartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func InputTimeLt ¶ added in v0.2.0
InputTimeLt retains the stored time operation; Set alone accepts I. Example: InputTimeLt(events.StartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func InputTimeLte ¶ added in v0.2.0
InputTimeLte retains the stored time operation; Set alone accepts I. Example: InputTimeLte(events.StartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func InputTimeNe ¶ added in v0.2.0
InputTimeNe retains the stored time operation; Set alone accepts I. Example: InputTimeNe(events.StartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func InputTimeNotIn ¶ added in v0.2.0
InputTimeNotIn retains the stored time operation; Set alone accepts I. Example: InputTimeNotIn(events.StartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func IntervalBetween ¶ added in v0.2.0
IntervalBetween includes both endpoints. Example: IntervalBetween(Records.Period, a, b).
func IntervalEq ¶ added in v0.2.0
IntervalEq compares a concrete value. Example: IntervalEq(Records.Period, period).
func IntervalGt ¶ added in v0.2.0
IntervalGt compares ordered values. Example: IntervalGt(Records.Period, period).
func IntervalGte ¶ added in v0.2.0
IntervalGte compares ordered values. Example: IntervalGte(Records.Period, period).
func IntervalIn ¶ added in v0.2.0
IntervalIn tests membership. Example: IntervalIn(Records.Period, a, b).
func IntervalLt ¶ added in v0.2.0
IntervalLt compares ordered values. Example: IntervalLt(Records.Period, period).
func IntervalLte ¶ added in v0.2.0
IntervalLte compares ordered values. Example: IntervalLte(Records.Period, period).
func IntervalNe ¶ added in v0.2.0
IntervalNe excludes a concrete value. Example: IntervalNe(Records.Period, period).
func IntervalNotIn ¶ added in v0.2.0
IntervalNotIn excludes membership. Example: IntervalNotIn(Records.Period, a, b).
func JSONContainedBy ¶ added in v0.2.0
JSONContainedBy tests the reverse JSONB containment. Example: JSONContainedBy(Records.Settings, settings).
func JSONContains ¶ added in v0.2.0
JSONContains tests JSONB document containment, not a text pattern. Example: JSONContains(Records.Settings, settings).
func JSONEq ¶ added in v0.2.0
JSONEq compares a concrete value. Example: JSONEq(Records.Settings, settings).
func JSONIsJSONNull ¶ added in v0.2.0
JSONIsJSONNull matches a JSON null document, excluding SQL NULL. Example: JSONIsJSONNull(Records.Settings).
func JSONNe ¶ added in v0.2.0
JSONNe excludes a concrete value. Example: JSONNe(Records.Settings, settings).
func JSONNotIn ¶ added in v0.2.0
JSONNotIn excludes membership. Example: JSONNotIn(Records.Settings, a, b).
func KeyColumnEq ¶ added in v0.2.0
func KeyColumnEq[M any, K comparable](c KeyColumn[M, K], v K) Predicate[M]
KeyColumnEq compares a concrete value from a key column handle. Example: KeyColumnEq(Users.Key(), id).
func KeyColumnNe ¶ added in v0.2.0
func KeyColumnNe[M any, K comparable](c KeyColumn[M, K], v K) Predicate[M]
KeyColumnNe excludes a concrete value from a key column handle. Example: KeyColumnNe(Users.Key(), id).
func KeyEq ¶ added in v0.2.0
func KeyEq[M any, K comparable, R columnRole](c keyColumn[M, K, R], v K) Predicate[M]
KeyEq compares a concrete value. Example: KeyEq(Orders.ID, id).
func KeyIn ¶ added in v0.2.0
func KeyIn[M any, K comparable, R columnRole](c keyColumn[M, K, R], v ...K) Predicate[M]
KeyIn tests membership. Example: KeyIn(Orders.ID, a, b).
func KeyNe ¶ added in v0.2.0
func KeyNe[M any, K comparable, R columnRole](c keyColumn[M, K, R], v K) Predicate[M]
KeyNe excludes a concrete value. Example: KeyNe(Orders.ID, id).
func KeyNotIn ¶ added in v0.2.0
func KeyNotIn[M any, K comparable, R columnRole](c keyColumn[M, K, R], v ...K) Predicate[M]
KeyNotIn excludes membership. Example: KeyNotIn(Orders.ID, a, b).
func NullableColumnEq ¶ added in v0.2.0
func NullableColumnEq[M, V any](c NullableColumn[M, V], v V) Predicate[M]
NullableColumnEq compares a concrete value. Example: NullableColumnEq(Users.IntroducerID, userID).
func NullableColumnIn ¶ added in v0.2.0
func NullableColumnIn[M, V any](c NullableColumn[M, V], v ...V) Predicate[M]
NullableColumnIn tests membership. Example: NullableColumnIn(Users.IntroducerID, a, b).
func NullableColumnIsNotNull ¶ added in v0.2.0
func NullableColumnIsNotNull[M, V any](c NullableColumn[M, V]) Predicate[M]
NullableColumnIsNotNull excludes SQL NULL. Example: NullableColumnIsNotNull(Users.IntroducerID).
func NullableColumnIsNull ¶ added in v0.2.0
func NullableColumnIsNull[M, V any](c NullableColumn[M, V]) Predicate[M]
NullableColumnIsNull matches SQL NULL. Example: NullableColumnIsNull(Users.IntroducerID).
func NullableColumnNe ¶ added in v0.2.0
func NullableColumnNe[M, V any](c NullableColumn[M, V], v V) Predicate[M]
NullableColumnNe excludes a concrete value. Example: NullableColumnNe(Users.IntroducerID, userID).
func NullableColumnNotIn ¶ added in v0.2.0
func NullableColumnNotIn[M, V any](c NullableColumn[M, V], v ...V) Predicate[M]
NullableColumnNotIn excludes membership. Example: NullableColumnNotIn(Users.IntroducerID, a, b).
func NullableEncryptedIsNotNull ¶ added in v0.2.0
func NullableEncryptedIsNotNull[M any, V encrypted.Value[V]](c NullableEncrypted[M, V]) Predicate[M]
NullableEncryptedIsNotNull excludes SQL NULL without comparing ciphertext. Example: NullableEncryptedIsNotNull(Vaults.Backup).
func NullableEncryptedIsNull ¶ added in v0.2.0
func NullableEncryptedIsNull[M any, V encrypted.Value[V]](c NullableEncrypted[M, V]) Predicate[M]
NullableEncryptedIsNull matches SQL NULL without comparing ciphertext. Example: NullableEncryptedIsNull(Vaults.Backup).
func NullableEnumEq ¶ added in v0.2.0
func NullableEnumEq[M any, E enum.Scalar](c NullableEnum[M, E], v E) Predicate[M]
NullableEnumEq compares a concrete value. Example: NullableEnumEq(optionalStatus, StatusActive) (optionalStatus is orm.NullableEnum[User, Status]).
func NullableEnumIn ¶ added in v0.2.0
func NullableEnumIn[M any, E enum.Scalar](c NullableEnum[M, E], v ...E) Predicate[M]
NullableEnumIn tests membership. Example: NullableEnumIn(optionalStatus, a, b) (optionalStatus is orm.NullableEnum[User, Status]).
func NullableEnumIsNotNull ¶ added in v0.2.0
func NullableEnumIsNotNull[M any, E enum.Scalar](c NullableEnum[M, E]) Predicate[M]
NullableEnumIsNotNull excludes SQL NULL. Example: NullableEnumIsNotNull(optionalStatus) (optionalStatus is orm.NullableEnum[User, Status]).
func NullableEnumIsNull ¶ added in v0.2.0
func NullableEnumIsNull[M any, E enum.Scalar](c NullableEnum[M, E]) Predicate[M]
NullableEnumIsNull matches SQL NULL. Example: NullableEnumIsNull(optionalStatus) (optionalStatus is orm.NullableEnum[User, Status]).
func NullableEnumNe ¶ added in v0.2.0
func NullableEnumNe[M any, E enum.Scalar](c NullableEnum[M, E], v E) Predicate[M]
NullableEnumNe excludes a concrete value. Example: NullableEnumNe(optionalStatus, StatusActive) (optionalStatus is orm.NullableEnum[User, Status]).
func NullableEnumNotIn ¶ added in v0.2.0
func NullableEnumNotIn[M any, E enum.Scalar](c NullableEnum[M, E], v ...E) Predicate[M]
NullableEnumNotIn excludes membership. Example: NullableEnumNotIn(optionalStatus, a, b) (optionalStatus is orm.NullableEnum[User, Status]).
func NullableInputColumnEq ¶ added in v0.2.0
func NullableInputColumnEq[M, I any, V any](c NullableInputColumn[M, I, V], v V) Predicate[M]
NullableInputColumnEq retains the stored column operation; Set alone accepts I. Example: NullableInputColumnEq(members.Note, StoredLabel("ada@example.test")).
func NullableInputColumnIn ¶ added in v0.2.0
func NullableInputColumnIn[M, I any, V any](c NullableInputColumn[M, I, V], v ...V) Predicate[M]
NullableInputColumnIn retains the stored column operation; Set alone accepts I. Example: NullableInputColumnIn(members.Note, StoredLabel("ada@example.test")).
func NullableInputColumnIsNotNull ¶ added in v0.2.0
func NullableInputColumnIsNotNull[M, I any, V any](c NullableInputColumn[M, I, V]) Predicate[M]
NullableInputColumnIsNotNull retains the stored column operation; Set alone accepts I. Example: NullableInputColumnIsNotNull(members.Note).
func NullableInputColumnIsNull ¶ added in v0.2.0
func NullableInputColumnIsNull[M, I any, V any](c NullableInputColumn[M, I, V]) Predicate[M]
NullableInputColumnIsNull retains the stored column operation; Set alone accepts I. Example: NullableInputColumnIsNull(members.Note).
func NullableInputColumnNe ¶ added in v0.2.0
func NullableInputColumnNe[M, I any, V any](c NullableInputColumn[M, I, V], v V) Predicate[M]
NullableInputColumnNe retains the stored column operation; Set alone accepts I. Example: NullableInputColumnNe(members.Note, StoredLabel("ada@example.test")).
func NullableInputColumnNotIn ¶ added in v0.2.0
func NullableInputColumnNotIn[M, I any, V any](c NullableInputColumn[M, I, V], v ...V) Predicate[M]
NullableInputColumnNotIn retains the stored column operation; Set alone accepts I. Example: NullableInputColumnNotIn(members.Note, StoredLabel("ada@example.test")).
func NullableInputEnumEq ¶ added in v0.2.0
func NullableInputEnumEq[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c NullableInputEnum[M, I, E], v E) Predicate[M]
NullableInputEnumEq retains the stored enum operation; Set alone accepts I. Example: NullableInputEnumEq(members.OptionalStatus, StatusActive).
func NullableInputEnumIn ¶ added in v0.2.0
func NullableInputEnumIn[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c NullableInputEnum[M, I, E], v ...E) Predicate[M]
NullableInputEnumIn retains the stored enum operation; Set alone accepts I. Example: NullableInputEnumIn(members.OptionalStatus, StatusActive).
func NullableInputEnumIsNotNull ¶ added in v0.2.0
func NullableInputEnumIsNotNull[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c NullableInputEnum[M, I, E]) Predicate[M]
NullableInputEnumIsNotNull retains the stored enum operation; Set alone accepts I. Example: NullableInputEnumIsNotNull(members.OptionalStatus).
func NullableInputEnumIsNull ¶ added in v0.2.0
func NullableInputEnumIsNull[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c NullableInputEnum[M, I, E]) Predicate[M]
NullableInputEnumIsNull retains the stored enum operation; Set alone accepts I. Example: NullableInputEnumIsNull(members.OptionalStatus).
func NullableInputEnumNe ¶ added in v0.2.0
func NullableInputEnumNe[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c NullableInputEnum[M, I, E], v E) Predicate[M]
NullableInputEnumNe retains the stored enum operation; Set alone accepts I. Example: NullableInputEnumNe(members.OptionalStatus, StatusActive).
func NullableInputEnumNotIn ¶ added in v0.2.0
func NullableInputEnumNotIn[M, I any, E interface { enum.Scalar EnumDescriptor() enum.Descriptor[E] }](c NullableInputEnum[M, I, E], v ...E) Predicate[M]
NullableInputEnumNotIn retains the stored enum operation; Set alone accepts I. Example: NullableInputEnumNotIn(members.OptionalStatus, StatusActive).
func NullableInputIntervalBetween ¶ added in v0.2.0
func NullableInputIntervalBetween[M, I any](c NullableInputInterval[M, I], a, b temporal.Interval) Predicate[M]
NullableInputIntervalBetween retains the stored interval operation; Set alone accepts I. Example: NullableInputIntervalBetween(bookings.OptionalPeriod, temporal.Days(1), temporal.Days(7)).
func NullableInputIntervalEq ¶ added in v0.2.0
func NullableInputIntervalEq[M, I any](c NullableInputInterval[M, I], v temporal.Interval) Predicate[M]
NullableInputIntervalEq retains the stored interval operation; Set alone accepts I. Example: NullableInputIntervalEq(bookings.OptionalPeriod, temporal.Days(1)).
func NullableInputIntervalGt ¶ added in v0.2.0
func NullableInputIntervalGt[M, I any](c NullableInputInterval[M, I], v temporal.Interval) Predicate[M]
NullableInputIntervalGt retains the stored interval operation; Set alone accepts I. Example: NullableInputIntervalGt(bookings.OptionalPeriod, temporal.Days(1)).
func NullableInputIntervalGte ¶ added in v0.2.0
func NullableInputIntervalGte[M, I any](c NullableInputInterval[M, I], v temporal.Interval) Predicate[M]
NullableInputIntervalGte retains the stored interval operation; Set alone accepts I. Example: NullableInputIntervalGte(bookings.OptionalPeriod, temporal.Days(1)).
func NullableInputIntervalIn ¶ added in v0.2.0
func NullableInputIntervalIn[M, I any](c NullableInputInterval[M, I], v ...temporal.Interval) Predicate[M]
NullableInputIntervalIn retains the stored interval operation; Set alone accepts I. Example: NullableInputIntervalIn(bookings.OptionalPeriod, temporal.Days(1)).
func NullableInputIntervalIsNotNull ¶ added in v0.2.0
func NullableInputIntervalIsNotNull[M, I any](c NullableInputInterval[M, I]) Predicate[M]
NullableInputIntervalIsNotNull retains the stored interval operation; Set alone accepts I. Example: NullableInputIntervalIsNotNull(bookings.OptionalPeriod).
func NullableInputIntervalIsNull ¶ added in v0.2.0
func NullableInputIntervalIsNull[M, I any](c NullableInputInterval[M, I]) Predicate[M]
NullableInputIntervalIsNull retains the stored interval operation; Set alone accepts I. Example: NullableInputIntervalIsNull(bookings.OptionalPeriod).
func NullableInputIntervalLt ¶ added in v0.2.0
func NullableInputIntervalLt[M, I any](c NullableInputInterval[M, I], v temporal.Interval) Predicate[M]
NullableInputIntervalLt retains the stored interval operation; Set alone accepts I. Example: NullableInputIntervalLt(bookings.OptionalPeriod, temporal.Days(1)).
func NullableInputIntervalLte ¶ added in v0.2.0
func NullableInputIntervalLte[M, I any](c NullableInputInterval[M, I], v temporal.Interval) Predicate[M]
NullableInputIntervalLte retains the stored interval operation; Set alone accepts I. Example: NullableInputIntervalLte(bookings.OptionalPeriod, temporal.Days(1)).
func NullableInputIntervalNe ¶ added in v0.2.0
func NullableInputIntervalNe[M, I any](c NullableInputInterval[M, I], v temporal.Interval) Predicate[M]
NullableInputIntervalNe retains the stored interval operation; Set alone accepts I. Example: NullableInputIntervalNe(bookings.OptionalPeriod, temporal.Days(1)).
func NullableInputIntervalNotIn ¶ added in v0.2.0
func NullableInputIntervalNotIn[M, I any](c NullableInputInterval[M, I], v ...temporal.Interval) Predicate[M]
NullableInputIntervalNotIn retains the stored interval operation; Set alone accepts I. Example: NullableInputIntervalNotIn(bookings.OptionalPeriod, temporal.Days(1)).
func NullableInputJSONContainedBy ¶ added in v0.2.0
func NullableInputJSONContainedBy[M, I any, T any](c NullableInputJSON[M, I, T], v value.JSON[T]) Predicate[M]
NullableInputJSONContainedBy retains the stored json operation; Set alone accepts I. Example: NullableInputJSONContainedBy(members.BackupSettings, storedPreferences).
func NullableInputJSONContains ¶ added in v0.2.0
func NullableInputJSONContains[M, I any, T any](c NullableInputJSON[M, I, T], v value.JSON[T]) Predicate[M]
NullableInputJSONContains retains the stored json operation; Set alone accepts I. Example: NullableInputJSONContains(members.BackupSettings, storedPreferences).
func NullableInputJSONEq ¶ added in v0.2.0
func NullableInputJSONEq[M, I any, T any](c NullableInputJSON[M, I, T], v value.JSON[T]) Predicate[M]
NullableInputJSONEq retains the stored json operation; Set alone accepts I. Example: NullableInputJSONEq(members.BackupSettings, storedPreferences).
func NullableInputJSONIn ¶ added in v0.2.0
func NullableInputJSONIn[M, I any, T any](c NullableInputJSON[M, I, T], v ...value.JSON[T]) Predicate[M]
NullableInputJSONIn retains the stored json operation; Set alone accepts I. Example: NullableInputJSONIn(members.BackupSettings, storedPreferences).
func NullableInputJSONIsJSONNull ¶ added in v0.2.0
func NullableInputJSONIsJSONNull[M, I any, T any](c NullableInputJSON[M, I, T]) Predicate[M]
NullableInputJSONIsJSONNull retains the stored json operation; Set alone accepts I. Example: NullableInputJSONIsJSONNull(members.BackupSettings).
func NullableInputJSONIsNotNull ¶ added in v0.2.0
func NullableInputJSONIsNotNull[M, I any, T any](c NullableInputJSON[M, I, T]) Predicate[M]
NullableInputJSONIsNotNull retains the stored json operation; Set alone accepts I. Example: NullableInputJSONIsNotNull(members.BackupSettings).
func NullableInputJSONIsNull ¶ added in v0.2.0
func NullableInputJSONIsNull[M, I any, T any](c NullableInputJSON[M, I, T]) Predicate[M]
NullableInputJSONIsNull retains the stored json operation; Set alone accepts I. Example: NullableInputJSONIsNull(members.BackupSettings).
func NullableInputJSONNe ¶ added in v0.2.0
func NullableInputJSONNe[M, I any, T any](c NullableInputJSON[M, I, T], v value.JSON[T]) Predicate[M]
NullableInputJSONNe retains the stored json operation; Set alone accepts I. Example: NullableInputJSONNe(members.BackupSettings, storedPreferences).
func NullableInputJSONNotIn ¶ added in v0.2.0
func NullableInputJSONNotIn[M, I any, T any](c NullableInputJSON[M, I, T], v ...value.JSON[T]) Predicate[M]
NullableInputJSONNotIn retains the stored json operation; Set alone accepts I. Example: NullableInputJSONNotIn(members.BackupSettings, storedPreferences).
func NullableInputNumberBetween ¶ added in v0.2.0
func NullableInputNumberBetween[M, I any, V NumberValue](c NullableInputNumber[M, I, V], a, b V) Predicate[M]
NullableInputNumberBetween retains the stored number operation; Set alone accepts I. Example: NullableInputNumberBetween(invoices.OptionalAmount, int64(0), int64(1000)).
func NullableInputNumberEq ¶ added in v0.2.0
func NullableInputNumberEq[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v V) Predicate[M]
NullableInputNumberEq retains the stored number operation; Set alone accepts I. Example: NullableInputNumberEq(invoices.OptionalAmount, int64(100)).
func NullableInputNumberGt ¶ added in v0.2.0
func NullableInputNumberGt[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v V) Predicate[M]
NullableInputNumberGt retains the stored number operation; Set alone accepts I. Example: NullableInputNumberGt(invoices.OptionalAmount, int64(100)).
func NullableInputNumberGte ¶ added in v0.2.0
func NullableInputNumberGte[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v V) Predicate[M]
NullableInputNumberGte retains the stored number operation; Set alone accepts I. Example: NullableInputNumberGte(invoices.OptionalAmount, int64(100)).
func NullableInputNumberIn ¶ added in v0.2.0
func NullableInputNumberIn[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v ...V) Predicate[M]
NullableInputNumberIn retains the stored number operation; Set alone accepts I. Example: NullableInputNumberIn(invoices.OptionalAmount, int64(100)).
func NullableInputNumberIsNotNull ¶ added in v0.2.0
func NullableInputNumberIsNotNull[M, I any, V NumberValue](c NullableInputNumber[M, I, V]) Predicate[M]
NullableInputNumberIsNotNull retains the stored number operation; Set alone accepts I. Example: NullableInputNumberIsNotNull(invoices.OptionalAmount).
func NullableInputNumberIsNull ¶ added in v0.2.0
func NullableInputNumberIsNull[M, I any, V NumberValue](c NullableInputNumber[M, I, V]) Predicate[M]
NullableInputNumberIsNull retains the stored number operation; Set alone accepts I. Example: NullableInputNumberIsNull(invoices.OptionalAmount).
func NullableInputNumberLt ¶ added in v0.2.0
func NullableInputNumberLt[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v V) Predicate[M]
NullableInputNumberLt retains the stored number operation; Set alone accepts I. Example: NullableInputNumberLt(invoices.OptionalAmount, int64(100)).
func NullableInputNumberLte ¶ added in v0.2.0
func NullableInputNumberLte[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v V) Predicate[M]
NullableInputNumberLte retains the stored number operation; Set alone accepts I. Example: NullableInputNumberLte(invoices.OptionalAmount, int64(100)).
func NullableInputNumberNe ¶ added in v0.2.0
func NullableInputNumberNe[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v V) Predicate[M]
NullableInputNumberNe retains the stored number operation; Set alone accepts I. Example: NullableInputNumberNe(invoices.OptionalAmount, int64(100)).
func NullableInputNumberNotIn ¶ added in v0.2.0
func NullableInputNumberNotIn[M, I any, V NumberValue](c NullableInputNumber[M, I, V], v ...V) Predicate[M]
NullableInputNumberNotIn retains the stored number operation; Set alone accepts I. Example: NullableInputNumberNotIn(invoices.OptionalAmount, int64(100)).
func NullableInputTextBetween ¶ added in v0.2.0
func NullableInputTextBetween[M, I any, V ~string](c NullableInputText[M, I, V], a, b V) Predicate[M]
NullableInputTextBetween retains the stored text operation; Set alone accepts I. Example: NullableInputTextBetween(members.Note, StoredLabel("a"), StoredLabel("z")).
func NullableInputTextContains ¶ added in v0.2.0
func NullableInputTextContains[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
NullableInputTextContains retains the stored text operation; Set alone accepts I. Example: NullableInputTextContains(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextEndsWith ¶ added in v0.2.0
func NullableInputTextEndsWith[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
NullableInputTextEndsWith retains the stored text operation; Set alone accepts I. Example: NullableInputTextEndsWith(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextEq ¶ added in v0.2.0
func NullableInputTextEq[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
NullableInputTextEq retains the stored text operation; Set alone accepts I. Example: NullableInputTextEq(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextGt ¶ added in v0.2.0
func NullableInputTextGt[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
NullableInputTextGt retains the stored text operation; Set alone accepts I. Example: NullableInputTextGt(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextGte ¶ added in v0.2.0
func NullableInputTextGte[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
NullableInputTextGte retains the stored text operation; Set alone accepts I. Example: NullableInputTextGte(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextIContains ¶ added in v0.2.0
func NullableInputTextIContains[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
NullableInputTextIContains retains the stored text operation; Set alone accepts I. Example: NullableInputTextIContains(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextIEndsWith ¶ added in v0.2.0
func NullableInputTextIEndsWith[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
NullableInputTextIEndsWith retains the stored text operation; Set alone accepts I. Example: NullableInputTextIEndsWith(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextILike ¶ added in v0.2.0
func NullableInputTextILike[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
NullableInputTextILike retains the stored text operation; Set alone accepts I. Example: NullableInputTextILike(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextIStartsWith ¶ added in v0.2.0
func NullableInputTextIStartsWith[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
NullableInputTextIStartsWith retains the stored text operation; Set alone accepts I. Example: NullableInputTextIStartsWith(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextIn ¶ added in v0.2.0
func NullableInputTextIn[M, I any, V ~string](c NullableInputText[M, I, V], v ...V) Predicate[M]
NullableInputTextIn retains the stored text operation; Set alone accepts I. Example: NullableInputTextIn(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextIsNotNull ¶ added in v0.2.0
func NullableInputTextIsNotNull[M, I any, V ~string](c NullableInputText[M, I, V]) Predicate[M]
NullableInputTextIsNotNull retains the stored text operation; Set alone accepts I. Example: NullableInputTextIsNotNull(members.Note).
func NullableInputTextIsNull ¶ added in v0.2.0
func NullableInputTextIsNull[M, I any, V ~string](c NullableInputText[M, I, V]) Predicate[M]
NullableInputTextIsNull retains the stored text operation; Set alone accepts I. Example: NullableInputTextIsNull(members.Note).
func NullableInputTextLike ¶ added in v0.2.0
func NullableInputTextLike[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
NullableInputTextLike retains the stored text operation; Set alone accepts I. Example: NullableInputTextLike(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextLt ¶ added in v0.2.0
func NullableInputTextLt[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
NullableInputTextLt retains the stored text operation; Set alone accepts I. Example: NullableInputTextLt(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextLte ¶ added in v0.2.0
func NullableInputTextLte[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
NullableInputTextLte retains the stored text operation; Set alone accepts I. Example: NullableInputTextLte(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextNe ¶ added in v0.2.0
func NullableInputTextNe[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
NullableInputTextNe retains the stored text operation; Set alone accepts I. Example: NullableInputTextNe(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextNotIn ¶ added in v0.2.0
func NullableInputTextNotIn[M, I any, V ~string](c NullableInputText[M, I, V], v ...V) Predicate[M]
NullableInputTextNotIn retains the stored text operation; Set alone accepts I. Example: NullableInputTextNotIn(members.Note, StoredLabel("ada@example.test")).
func NullableInputTextStartsWith ¶ added in v0.2.0
func NullableInputTextStartsWith[M, I any, V ~string](c NullableInputText[M, I, V], v V) Predicate[M]
NullableInputTextStartsWith retains the stored text operation; Set alone accepts I. Example: NullableInputTextStartsWith(members.Note, StoredLabel("ada@example.test")).
func NullableInputTimeBetween ¶ added in v0.2.0
func NullableInputTimeBetween[M, I any, V TimeValue](c NullableInputTime[M, I, V], a, b V) Predicate[M]
NullableInputTimeBetween retains the stored time operation; Set alone accepts I. Example: NullableInputTimeBetween(events.OptionalStartsAt, startsAt, endsAt).
func NullableInputTimeEq ¶ added in v0.2.0
func NullableInputTimeEq[M, I any, V TimeValue](c NullableInputTime[M, I, V], v V) Predicate[M]
NullableInputTimeEq retains the stored time operation; Set alone accepts I. Example: NullableInputTimeEq(events.OptionalStartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func NullableInputTimeGt ¶ added in v0.2.0
func NullableInputTimeGt[M, I any, V TimeValue](c NullableInputTime[M, I, V], v V) Predicate[M]
NullableInputTimeGt retains the stored time operation; Set alone accepts I. Example: NullableInputTimeGt(events.OptionalStartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func NullableInputTimeGte ¶ added in v0.2.0
func NullableInputTimeGte[M, I any, V TimeValue](c NullableInputTime[M, I, V], v V) Predicate[M]
NullableInputTimeGte retains the stored time operation; Set alone accepts I. Example: NullableInputTimeGte(events.OptionalStartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func NullableInputTimeIn ¶ added in v0.2.0
func NullableInputTimeIn[M, I any, V TimeValue](c NullableInputTime[M, I, V], v ...V) Predicate[M]
NullableInputTimeIn retains the stored time operation; Set alone accepts I. Example: NullableInputTimeIn(events.OptionalStartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func NullableInputTimeIsNotNull ¶ added in v0.2.0
func NullableInputTimeIsNotNull[M, I any, V TimeValue](c NullableInputTime[M, I, V]) Predicate[M]
NullableInputTimeIsNotNull retains the stored time operation; Set alone accepts I. Example: NullableInputTimeIsNotNull(events.OptionalStartsAt).
func NullableInputTimeIsNull ¶ added in v0.2.0
func NullableInputTimeIsNull[M, I any, V TimeValue](c NullableInputTime[M, I, V]) Predicate[M]
NullableInputTimeIsNull retains the stored time operation; Set alone accepts I. Example: NullableInputTimeIsNull(events.OptionalStartsAt).
func NullableInputTimeLt ¶ added in v0.2.0
func NullableInputTimeLt[M, I any, V TimeValue](c NullableInputTime[M, I, V], v V) Predicate[M]
NullableInputTimeLt retains the stored time operation; Set alone accepts I. Example: NullableInputTimeLt(events.OptionalStartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func NullableInputTimeLte ¶ added in v0.2.0
func NullableInputTimeLte[M, I any, V TimeValue](c NullableInputTime[M, I, V], v V) Predicate[M]
NullableInputTimeLte retains the stored time operation; Set alone accepts I. Example: NullableInputTimeLte(events.OptionalStartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func NullableInputTimeNe ¶ added in v0.2.0
func NullableInputTimeNe[M, I any, V TimeValue](c NullableInputTime[M, I, V], v V) Predicate[M]
NullableInputTimeNe retains the stored time operation; Set alone accepts I. Example: NullableInputTimeNe(events.OptionalStartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func NullableInputTimeNotIn ¶ added in v0.2.0
func NullableInputTimeNotIn[M, I any, V TimeValue](c NullableInputTime[M, I, V], v ...V) Predicate[M]
NullableInputTimeNotIn retains the stored time operation; Set alone accepts I. Example: NullableInputTimeNotIn(events.OptionalStartsAt, time.Date(2026, 10, 23, 0, 0, 0, 0, time.UTC)).
func NullableIntervalBetween ¶ added in v0.2.0
func NullableIntervalBetween[M any](c NullableInterval[M], a, b temporal.Interval) Predicate[M]
NullableIntervalBetween includes both endpoints. Example: NullableIntervalBetween(Records.MaybePeriod, a, b).
func NullableIntervalEq ¶ added in v0.2.0
func NullableIntervalEq[M any](c NullableInterval[M], v temporal.Interval) Predicate[M]
NullableIntervalEq compares a concrete value. Example: NullableIntervalEq(Records.MaybePeriod, period).
func NullableIntervalGt ¶ added in v0.2.0
func NullableIntervalGt[M any](c NullableInterval[M], v temporal.Interval) Predicate[M]
NullableIntervalGt compares ordered values. Example: NullableIntervalGt(Records.MaybePeriod, period).
func NullableIntervalGte ¶ added in v0.2.0
func NullableIntervalGte[M any](c NullableInterval[M], v temporal.Interval) Predicate[M]
NullableIntervalGte compares ordered values. Example: NullableIntervalGte(Records.MaybePeriod, period).
func NullableIntervalIn ¶ added in v0.2.0
func NullableIntervalIn[M any](c NullableInterval[M], v ...temporal.Interval) Predicate[M]
NullableIntervalIn tests membership. Example: NullableIntervalIn(Records.MaybePeriod, a, b).
func NullableIntervalIsNotNull ¶ added in v0.2.0
func NullableIntervalIsNotNull[M any](c NullableInterval[M]) Predicate[M]
NullableIntervalIsNotNull excludes SQL NULL. Example: NullableIntervalIsNotNull(Records.MaybePeriod).
func NullableIntervalIsNull ¶ added in v0.2.0
func NullableIntervalIsNull[M any](c NullableInterval[M]) Predicate[M]
NullableIntervalIsNull matches SQL NULL. Example: NullableIntervalIsNull(Records.MaybePeriod).
func NullableIntervalLt ¶ added in v0.2.0
func NullableIntervalLt[M any](c NullableInterval[M], v temporal.Interval) Predicate[M]
NullableIntervalLt compares ordered values. Example: NullableIntervalLt(Records.MaybePeriod, period).
func NullableIntervalLte ¶ added in v0.2.0
func NullableIntervalLte[M any](c NullableInterval[M], v temporal.Interval) Predicate[M]
NullableIntervalLte compares ordered values. Example: NullableIntervalLte(Records.MaybePeriod, period).
func NullableIntervalNe ¶ added in v0.2.0
func NullableIntervalNe[M any](c NullableInterval[M], v temporal.Interval) Predicate[M]
NullableIntervalNe excludes a concrete value. Example: NullableIntervalNe(Records.MaybePeriod, period).
func NullableIntervalNotIn ¶ added in v0.2.0
func NullableIntervalNotIn[M any](c NullableInterval[M], v ...temporal.Interval) Predicate[M]
NullableIntervalNotIn excludes membership. Example: NullableIntervalNotIn(Records.MaybePeriod, a, b).
func NullableJSONContainedBy ¶ added in v0.2.0
func NullableJSONContainedBy[M, T any](c NullableJSON[M, T], v value.JSON[T]) Predicate[M]
NullableJSONContainedBy excludes SQL NULL and tests reverse JSONB containment. Example: NullableJSONContainedBy(Records.MaybeSettings, settings).
func NullableJSONContains ¶ added in v0.2.0
func NullableJSONContains[M, T any](c NullableJSON[M, T], v value.JSON[T]) Predicate[M]
NullableJSONContains excludes SQL NULL and tests JSONB containment. Example: NullableJSONContains(Records.MaybeSettings, settings).
func NullableJSONEq ¶ added in v0.2.0
func NullableJSONEq[M, T any](c NullableJSON[M, T], v value.JSON[T]) Predicate[M]
NullableJSONEq compares a concrete value. Example: NullableJSONEq(Records.MaybeSettings, settings).
func NullableJSONIn ¶ added in v0.2.0
func NullableJSONIn[M, T any](c NullableJSON[M, T], v ...value.JSON[T]) Predicate[M]
NullableJSONIn tests membership. Example: NullableJSONIn(Records.MaybeSettings, a, b).
func NullableJSONIsJSONNull ¶ added in v0.2.0
func NullableJSONIsJSONNull[M, T any](c NullableJSON[M, T]) Predicate[M]
NullableJSONIsJSONNull matches a JSON null document, excluding SQL NULL. Example: NullableJSONIsJSONNull(Records.MaybeSettings).
func NullableJSONIsNotNull ¶ added in v0.2.0
func NullableJSONIsNotNull[M, T any](c NullableJSON[M, T]) Predicate[M]
NullableJSONIsNotNull excludes SQL NULL. Example: NullableJSONIsNotNull(Records.MaybeSettings).
func NullableJSONIsNull ¶ added in v0.2.0
func NullableJSONIsNull[M, T any](c NullableJSON[M, T]) Predicate[M]
NullableJSONIsNull matches SQL NULL. Example: NullableJSONIsNull(Records.MaybeSettings).
func NullableJSONNe ¶ added in v0.2.0
func NullableJSONNe[M, T any](c NullableJSON[M, T], v value.JSON[T]) Predicate[M]
NullableJSONNe excludes a concrete value. Example: NullableJSONNe(Records.MaybeSettings, settings).
func NullableJSONNotIn ¶ added in v0.2.0
func NullableJSONNotIn[M, T any](c NullableJSON[M, T], v ...value.JSON[T]) Predicate[M]
NullableJSONNotIn excludes membership. Example: NullableJSONNotIn(Records.MaybeSettings, a, b).
func NullableNumberBetween ¶ added in v0.2.0
func NullableNumberBetween[M any, V NumberValue](c NullableNumber[M, V], a, b V) Predicate[M]
NullableNumberBetween includes both endpoints. Example: NullableNumberBetween(LedgerEntries.Balance, a, b).
func NullableNumberEq ¶ added in v0.2.0
func NullableNumberEq[M any, V NumberValue](c NullableNumber[M, V], v V) Predicate[M]
NullableNumberEq compares a concrete value. Example: NullableNumberEq(LedgerEntries.Balance, amount).
func NullableNumberGt ¶ added in v0.2.0
func NullableNumberGt[M any, V NumberValue](c NullableNumber[M, V], v V) Predicate[M]
NullableNumberGt compares ordered values. Example: NullableNumberGt(LedgerEntries.Balance, amount).
func NullableNumberGte ¶ added in v0.2.0
func NullableNumberGte[M any, V NumberValue](c NullableNumber[M, V], v V) Predicate[M]
NullableNumberGte compares ordered values. Example: NullableNumberGte(LedgerEntries.Balance, amount).
func NullableNumberIn ¶ added in v0.2.0
func NullableNumberIn[M any, V NumberValue](c NullableNumber[M, V], v ...V) Predicate[M]
NullableNumberIn tests membership. Example: NullableNumberIn(LedgerEntries.Balance, a, b).
func NullableNumberIsNotNull ¶ added in v0.2.0
func NullableNumberIsNotNull[M any, V NumberValue](c NullableNumber[M, V]) Predicate[M]
NullableNumberIsNotNull excludes SQL NULL. Example: NullableNumberIsNotNull(LedgerEntries.Balance).
func NullableNumberIsNull ¶ added in v0.2.0
func NullableNumberIsNull[M any, V NumberValue](c NullableNumber[M, V]) Predicate[M]
NullableNumberIsNull matches SQL NULL. Example: NullableNumberIsNull(LedgerEntries.Balance).
func NullableNumberLt ¶ added in v0.2.0
func NullableNumberLt[M any, V NumberValue](c NullableNumber[M, V], v V) Predicate[M]
NullableNumberLt compares ordered values. Example: NullableNumberLt(LedgerEntries.Balance, amount).
func NullableNumberLte ¶ added in v0.2.0
func NullableNumberLte[M any, V NumberValue](c NullableNumber[M, V], v V) Predicate[M]
NullableNumberLte compares ordered values. Example: NullableNumberLte(LedgerEntries.Balance, amount).
func NullableNumberNe ¶ added in v0.2.0
func NullableNumberNe[M any, V NumberValue](c NullableNumber[M, V], v V) Predicate[M]
NullableNumberNe excludes a concrete value. Example: NullableNumberNe(LedgerEntries.Balance, amount).
func NullableNumberNotIn ¶ added in v0.2.0
func NullableNumberNotIn[M any, V NumberValue](c NullableNumber[M, V], v ...V) Predicate[M]
NullableNumberNotIn excludes membership. Example: NullableNumberNotIn(LedgerEntries.Balance, a, b).
func NullableTextBetween ¶ added in v0.2.0
func NullableTextBetween[M any, V ~string](c NullableText[M, V], a, b V) Predicate[M]
NullableTextBetween includes both endpoints. Example: NullableTextBetween(Users.Nickname, a, b).
func NullableTextContains ¶ added in v0.2.0
func NullableTextContains[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
NullableTextContains matches a literal substring; wildcards are escaped. Example: NullableTextContains(Users.Nickname, "da").
func NullableTextEndsWith ¶ added in v0.2.0
func NullableTextEndsWith[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
NullableTextEndsWith matches a literal suffix; wildcards are escaped. Example: NullableTextEndsWith(Users.Nickname, "son").
func NullableTextEq ¶ added in v0.2.0
func NullableTextEq[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
NullableTextEq compares a concrete value. Example: NullableTextEq(Users.Nickname, "Ada").
func NullableTextGt ¶ added in v0.2.0
func NullableTextGt[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
NullableTextGt compares ordered values. Example: NullableTextGt(Users.Nickname, "Ada").
func NullableTextGte ¶ added in v0.2.0
func NullableTextGte[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
NullableTextGte compares ordered values. Example: NullableTextGte(Users.Nickname, "Ada").
func NullableTextIContains ¶ added in v0.2.0
func NullableTextIContains[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
NullableTextIContains matches a literal substring case-insensitively; wildcards are escaped. Example: NullableTextIContains(Users.Nickname, "Ada").
func NullableTextIEndsWith ¶ added in v0.2.0
func NullableTextIEndsWith[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
NullableTextIEndsWith matches a literal suffix case-insensitively; wildcards are escaped. Example: NullableTextIEndsWith(Users.Nickname, "SON").
func NullableTextILike ¶ added in v0.2.0
func NullableTextILike[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
NullableTextILike matches an ILIKE pattern case-insensitively; % and _ are wildcards. Example: NullableTextILike(Users.Nickname, "a%").
func NullableTextIStartsWith ¶ added in v0.2.0
func NullableTextIStartsWith[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
NullableTextIStartsWith matches a literal prefix case-insensitively; wildcards are escaped. Example: NullableTextIStartsWith(Users.Nickname, "ada").
func NullableTextIn ¶ added in v0.2.0
func NullableTextIn[M any, V ~string](c NullableText[M, V], v ...V) Predicate[M]
NullableTextIn tests membership. Example: NullableTextIn(Users.Nickname, a, b).
func NullableTextIsNotNull ¶ added in v0.2.0
func NullableTextIsNotNull[M any, V ~string](c NullableText[M, V]) Predicate[M]
NullableTextIsNotNull excludes SQL NULL. Example: NullableTextIsNotNull(Users.Nickname).
func NullableTextIsNull ¶ added in v0.2.0
func NullableTextIsNull[M any, V ~string](c NullableText[M, V]) Predicate[M]
NullableTextIsNull matches SQL NULL. Example: NullableTextIsNull(Users.Nickname).
func NullableTextLike ¶ added in v0.2.0
func NullableTextLike[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
NullableTextLike matches a LIKE pattern; % and _ are wildcards. Example: NullableTextLike(Users.Nickname, "A%").
func NullableTextLt ¶ added in v0.2.0
func NullableTextLt[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
NullableTextLt compares ordered values. Example: NullableTextLt(Users.Nickname, "Ada").
func NullableTextLte ¶ added in v0.2.0
func NullableTextLte[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
NullableTextLte compares ordered values. Example: NullableTextLte(Users.Nickname, "Ada").
func NullableTextNe ¶ added in v0.2.0
func NullableTextNe[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
NullableTextNe excludes a concrete value. Example: NullableTextNe(Users.Nickname, "Ada").
func NullableTextNotIn ¶ added in v0.2.0
func NullableTextNotIn[M any, V ~string](c NullableText[M, V], v ...V) Predicate[M]
NullableTextNotIn excludes membership. Example: NullableTextNotIn(Users.Nickname, a, b).
func NullableTextStartsWith ¶ added in v0.2.0
func NullableTextStartsWith[M any, V ~string](c NullableText[M, V], v V) Predicate[M]
NullableTextStartsWith matches a literal prefix; wildcards are escaped. Example: NullableTextStartsWith(Users.Nickname, "Ada").
func NullableTimeBetween ¶ added in v0.2.0
func NullableTimeBetween[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], a, b V) Predicate[M]
NullableTimeBetween includes both endpoints. Example: NullableTimeBetween(Users.Birthday, a, b).
func NullableTimeEq ¶ added in v0.2.0
func NullableTimeEq[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v V) Predicate[M]
NullableTimeEq compares a concrete value. Example: NullableTimeEq(Users.Birthday, birthday).
func NullableTimeGt ¶ added in v0.2.0
func NullableTimeGt[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v V) Predicate[M]
NullableTimeGt compares ordered values. Example: NullableTimeGt(Users.Birthday, birthday).
func NullableTimeGte ¶ added in v0.2.0
func NullableTimeGte[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v V) Predicate[M]
NullableTimeGte compares ordered values. Example: NullableTimeGte(Users.Birthday, birthday).
func NullableTimeIn ¶ added in v0.2.0
func NullableTimeIn[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v ...V) Predicate[M]
NullableTimeIn tests membership. Example: NullableTimeIn(Users.Birthday, a, b).
func NullableTimeIsNotNull ¶ added in v0.2.0
func NullableTimeIsNotNull[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R]) Predicate[M]
NullableTimeIsNotNull excludes SQL NULL. Example: NullableTimeIsNotNull(Users.Birthday).
func NullableTimeIsNull ¶ added in v0.2.0
func NullableTimeIsNull[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R]) Predicate[M]
NullableTimeIsNull matches SQL NULL. Example: NullableTimeIsNull(Users.Birthday).
func NullableTimeLt ¶ added in v0.2.0
func NullableTimeLt[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v V) Predicate[M]
NullableTimeLt compares ordered values. Example: NullableTimeLt(Users.Birthday, birthday).
func NullableTimeLte ¶ added in v0.2.0
func NullableTimeLte[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v V) Predicate[M]
NullableTimeLte compares ordered values. Example: NullableTimeLte(Users.Birthday, birthday).
func NullableTimeNe ¶ added in v0.2.0
func NullableTimeNe[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v V) Predicate[M]
NullableTimeNe excludes a concrete value. Example: NullableTimeNe(Users.Birthday, birthday).
func NullableTimeNotIn ¶ added in v0.2.0
func NullableTimeNotIn[M any, V TimeValue, R columnRole](c nullableTimeColumn[M, V, R], v ...V) Predicate[M]
NullableTimeNotIn excludes membership. Example: NullableTimeNotIn(Users.Birthday, a, b).
func NumberBetween ¶ added in v0.2.0
func NumberBetween[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], a, b V) Predicate[M]
NumberBetween includes both endpoints. Example: NumberBetween(Orders.TotalCents, a, b).
func NumberEq ¶ added in v0.2.0
func NumberEq[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v V) Predicate[M]
NumberEq compares a concrete value. Example: NumberEq(Orders.TotalCents, 100).
func NumberGt ¶ added in v0.2.0
func NumberGt[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v V) Predicate[M]
NumberGt compares ordered values. Example: NumberGt(Orders.TotalCents, 100).
func NumberGte ¶ added in v0.2.0
func NumberGte[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v V) Predicate[M]
NumberGte compares ordered values. Example: NumberGte(Orders.TotalCents, 100).
func NumberIn ¶ added in v0.2.0
func NumberIn[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v ...V) Predicate[M]
NumberIn tests membership. Example: NumberIn(Orders.TotalCents, a, b).
func NumberKeyBetween ¶ added in v0.2.0
func NumberKeyBetween[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], a, b V) Predicate[M]
NumberKeyBetween includes both endpoints. Example: NumberKeyBetween(Orders.ID, a, b).
func NumberKeyEq ¶ added in v0.2.0
func NumberKeyEq[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v V) Predicate[M]
NumberKeyEq compares a concrete value. Example: NumberKeyEq(Orders.ID, 100).
func NumberKeyGt ¶ added in v0.2.0
func NumberKeyGt[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v V) Predicate[M]
NumberKeyGt compares ordered values. Example: NumberKeyGt(Orders.ID, 100).
func NumberKeyGte ¶ added in v0.2.0
func NumberKeyGte[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v V) Predicate[M]
NumberKeyGte compares ordered values. Example: NumberKeyGte(Orders.ID, 100).
func NumberKeyIn ¶ added in v0.2.0
func NumberKeyIn[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v ...V) Predicate[M]
NumberKeyIn tests membership. Example: NumberKeyIn(Orders.ID, a, b).
func NumberKeyLt ¶ added in v0.2.0
func NumberKeyLt[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v V) Predicate[M]
NumberKeyLt compares ordered values. Example: NumberKeyLt(Orders.ID, 100).
func NumberKeyLte ¶ added in v0.2.0
func NumberKeyLte[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v V) Predicate[M]
NumberKeyLte compares ordered values. Example: NumberKeyLte(Orders.ID, 100).
func NumberKeyNe ¶ added in v0.2.0
func NumberKeyNe[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v V) Predicate[M]
NumberKeyNe excludes a concrete value. Example: NumberKeyNe(Orders.ID, 100).
func NumberKeyNotIn ¶ added in v0.2.0
func NumberKeyNotIn[M any, V NumberValue, R keyRole](c numberKeyColumn[M, V, R], v ...V) Predicate[M]
NumberKeyNotIn excludes membership. Example: NumberKeyNotIn(Orders.ID, a, b).
func NumberLt ¶ added in v0.2.0
func NumberLt[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v V) Predicate[M]
NumberLt compares ordered values. Example: NumberLt(Orders.TotalCents, 100).
func NumberLte ¶ added in v0.2.0
func NumberLte[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v V) Predicate[M]
NumberLte compares ordered values. Example: NumberLte(Orders.TotalCents, 100).
func NumberNe ¶ added in v0.2.0
func NumberNe[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v V) Predicate[M]
NumberNe excludes a concrete value. Example: NumberNe(Orders.TotalCents, 100).
func NumberNotIn ¶ added in v0.2.0
func NumberNotIn[M any, V NumberValue, R columnRole](c numberColumn[M, V, R], v ...V) Predicate[M]
NumberNotIn excludes membership. Example: NumberNotIn(Orders.TotalCents, a, b).
func Or ¶
Or matches any supplied condition. Example: Or(orm.NumberLt(users.Age, 18), orm.NumberGt(users.Age, 65)).
func TextBetween ¶ added in v0.2.0
TextBetween includes both endpoints. Example: TextBetween(Users.Email, a, b).
func TextContains ¶ added in v0.2.0
TextContains matches a literal substring; wildcards are escaped. Example: TextContains(Users.Email, "@").
func TextEndsWith ¶ added in v0.2.0
TextEndsWith matches a literal suffix; wildcards are escaped. Example: TextEndsWith(Users.Email, "@example.com").
func TextEq ¶ added in v0.2.0
TextEq compares a concrete value. Example: TextEq(Users.Email, "@example.com").
func TextGt ¶ added in v0.2.0
TextGt compares ordered values. Example: TextGt(Users.Email, "@example.com").
func TextGte ¶ added in v0.2.0
TextGte compares ordered values. Example: TextGte(Users.Email, "@example.com").
func TextIContains ¶ added in v0.2.0
TextIContains matches a literal substring case-insensitively; wildcards are escaped. Example: TextIContains(Users.Email, "Ada").
func TextIEndsWith ¶ added in v0.2.0
TextIEndsWith matches a literal suffix case-insensitively; wildcards are escaped. Example: TextIEndsWith(Users.Email, "@EXAMPLE.com").
func TextILike ¶ added in v0.2.0
TextILike matches an ILIKE pattern case-insensitively; % and _ are wildcards. Example: TextILike(Users.Email, "%@EXAMPLE.com").
func TextIStartsWith ¶ added in v0.2.0
TextIStartsWith matches a literal prefix case-insensitively; wildcards are escaped. Example: TextIStartsWith(Users.Email, "Admin").
func TextLike ¶ added in v0.2.0
TextLike matches a LIKE pattern; % and _ are wildcards. Example: TextLike(Users.Email, "%@example.com").
func TextLt ¶ added in v0.2.0
TextLt compares ordered values. Example: TextLt(Users.Email, "@example.com").
func TextLte ¶ added in v0.2.0
TextLte compares ordered values. Example: TextLte(Users.Email, "@example.com").
func TextNe ¶ added in v0.2.0
TextNe excludes a concrete value. Example: TextNe(Users.Email, "@example.com").
func TextNotIn ¶ added in v0.2.0
TextNotIn excludes membership. Example: TextNotIn(Users.Email, a, b).
func TextStartsWith ¶ added in v0.2.0
TextStartsWith matches a literal prefix; wildcards are escaped. Example: TextStartsWith(Users.Email, "admin").
func TimeBetween ¶ added in v0.2.0
TimeBetween includes both endpoints. Example: TimeBetween(createdAt, a, b) (createdAt is orm.Time[User, time.Time]).
func TimeEq ¶ added in v0.2.0
TimeEq compares a concrete value. Example: TimeEq(createdAt, at) (createdAt is orm.Time[User, time.Time]).
func TimeGt ¶ added in v0.2.0
TimeGt compares ordered values. Example: TimeGt(createdAt, at) (createdAt is orm.Time[User, time.Time]).
func TimeGte ¶ added in v0.2.0
TimeGte compares ordered values. Example: TimeGte(createdAt, at) (createdAt is orm.Time[User, time.Time]).
func TimeIn ¶ added in v0.2.0
TimeIn tests membership. Example: TimeIn(createdAt, a, b) (createdAt is orm.Time[User, time.Time]).
func TimeLt ¶ added in v0.2.0
TimeLt compares ordered values. Example: TimeLt(createdAt, at) (createdAt is orm.Time[User, time.Time]).
func TimeLte ¶ added in v0.2.0
TimeLte compares ordered values. Example: TimeLte(createdAt, at) (createdAt is orm.Time[User, time.Time]).
func TimeNe ¶ added in v0.2.0
TimeNe excludes a concrete value. Example: TimeNe(createdAt, at) (createdAt is orm.Time[User, time.Time]).
func TimeNotIn ¶ added in v0.2.0
TimeNotIn excludes membership. Example: TimeNotIn(createdAt, a, b) (createdAt is orm.Time[User, time.Time]).
func UUIDGreater ¶
UUIDGreater compares model-owned UUIDs bytewise. Example: orm.UUIDGreater(Files.Key(),after).
func UUIDGreaterOrEqual ¶
UUIDGreaterOrEqual compares model-owned UUIDs bytewise. Example: orm.UUIDGreaterOrEqual(Files.Key(),after).
func UUIDLess ¶
UUIDLess compares model-owned UUIDs bytewise. Example: orm.UUIDLess(Files.Key(),after).
func UUIDLessOrEqual ¶
UUIDLessOrEqual compares model-owned UUIDs bytewise. Example: orm.UUIDLessOrEqual(Files.Key(),after).
type Primary ¶
type Primary[M any, K comparable] = keyColumn[M, K, primaryRole]
Primary is an unmutated primary column eligible for insert-select mapping. Example: ID Primary[User, model.ID[User]]. Ordinary lookups only need Table.Key.
type Query ¶
type Query[M any] struct { // contains filtered or unexported fields }
Query stores only a model-independent AST and table binding. Example: Orders.Query().Where(orm.KeyEq(Orders.ID, id)).
func FoundryOrderBy ¶
FoundryOrderBy appends sealed computed row ordering in a model's original scope. Example: FoundryOrderBy(q,o,sqlowner.Queries()).
func FoundryWhere ¶
FoundryWhere appends a sealed computed predicate in a model's original scope. Example: FoundryWhere(q,p,sqlowner.Queries()).
func WithRelationLimits ¶
func WithRelationLimits[M any](q Query[M], limits RelationLimits) Query[M]
WithRelationLimits returns a query with immutable tree-wide limits. Example: q = orm.WithRelationLimits(q, orm.RelationLimits{BatchSize:100,MaxRows:5000,MaxDepth:4}).
func WithScopeContext ¶
WithScopeContext supplies context for Compile; execution always uses its own context. Example: Compile(WithScopeContext(Orders.Query(), ctx)).
func WithoutGlobalScope ¶
func WithoutGlobalScope[M any](q Query[M], scopes ...GlobalScope[M]) Query[M]
WithoutGlobalScope removes named defaults from this query only, preserving explicit predicates and soft-delete visibility. Example: WithoutGlobalScope(Orders.Query(), orderTenantScope).
func WithoutGlobalScopes ¶
WithoutGlobalScopes removes all model defaults from this query only. Example: WithoutGlobalScopes(Orders.Query()).Where(orm.KeyEq(Orders.ID, id)).
func WithoutModelHooks ¶
WithoutModelHooks acknowledges set writes skip per-model hooks, observers and changes. Per-model writes reject this flag. Example: orm.UpdateAll(ctx, db, WithoutModelHooks(Orders.Query()), orm.NumberSet(Orders.TotalCents, 0)).
func (Query[M]) OnlyTrashed ¶
OnlyTrashed selects deleted records. Example: orm.All(ctx, db, records.Query().OnlyTrashed()).
func (Query[M]) OrderBy ¶
OrderBy appends sort directions. Example: Orders.Query().OrderBy(orm.KeyAsc(Orders.ID)).
func (Query[M]) Where ¶
Where appends AND predicates. Example: Orders.Query().Where(orm.NumberGt(Orders.TotalCents, 0)).
func (Query[M]) With ¶
With adds batched eager loading. Example: Orders.Query().With(OrderRelations.Buyer).
func (Query[M]) WithTrashed ¶
WithTrashed includes deleted records. Example: orm.All(ctx, db, records.Query().WithTrashed()).
func (Query[M]) WithoutTrashed ¶
WithoutTrashed restores the default active-record scope.
type RelatedLookup ¶
type RelatedLookup[P, M any, K comparable] struct { // contains filtered or unexported fields }
RelatedLookup retains the parent, target and alternate-key types. Example: orm.RelatedUnique(TeamRelations.Projects,orm.TextExpr(Projects.Slug)).
func RelatedUnique ¶
func RelatedUnique[P, M any, K comparable, R DirectRelation[P, M]](relation R, field KeyColumn[M, K]) RelatedLookup[P, M, K]
RelatedUnique scopes a unique lookup through a loaded parent without a fallback query. Example: orm.RelatedUnique(TeamRelations.Projects,orm.TextExpr(Projects.Slug)).Find(ctx,db,team,slug).
func (RelatedLookup[P, M, K]) Find ¶
func (l RelatedLookup[P, M, K]) Find(ctx context.Context, ex database.Executor, parent P, key K) (value.Optional[M], error)
Find retains the relationship predicate, target filters and ordinary hydration. Example: lookup.Find(ctx,db,team,slug).
func (RelatedLookup[P, M, K]) Format ¶
func (RelatedLookup[P, M, K]) Format(s fmt.State, _ rune)
Format redacts parent and target scopes. Example: fmt.Sprintf("%+v", related).
func (RelatedLookup[P, M, K]) GoString ¶
func (RelatedLookup[P, M, K]) GoString() string
GoString redacts Go-syntax diagnostics. Example: fmt.Sprintf("%#v", related).
func (RelatedLookup[P, M, K]) String ¶
func (RelatedLookup[P, M, K]) String() string
String redacts parent and target scopes. Example: fmt.Sprint(related).
func (RelatedLookup[P, M, K]) Validate ¶
func (l RelatedLookup[P, M, K]) Validate() error
Validate rejects non-direct plans and windowed target scopes. Example: lookup.Validate().
type Relation ¶
type Relation[M any] interface { // contains filtered or unexported methods }
Relation is a model-owned, immutable eager-loading descriptor. Example: q.With(OrderRelations.Buyer).
type RelationLimits ¶
type RelationLimits = querycore.RelationLimits
RelationLimits is the existing shared public limits type. MaxRows separately bounds fetched rows and attached values across the whole tree. Example: limits := orm.DefaultRelationLimits().
func DefaultRelationLimits ¶
func DefaultRelationLimits() RelationLimits
DefaultRelationLimits uses the shared defaults: batches 500, rows 10000, depth 8. Example: limits := orm.DefaultRelationLimits().
type RetrievalHooks ¶
type RetrievalHooks[M any] struct { // Retrieved receives the caller's executor; reads create no implicit write transaction. // Example: Retrieved: func(ctx context.Context, ex database.Executor, order Order) error { return nil }. Retrieved func(context.Context, database.Executor, M) error }
RetrievalHooks observes complete stored models after hydration and row closure. Example: RetrievalHooks[Order]{Retrieved: inspectOrder}.
type RetrievalObserver ¶
type RetrievalObserver[M any] struct { // contains filtered or unexported fields }
RetrievalObserver retains a retrieval-only model factory at registration. Example: NewRetrievalObserver[Order]("orders.read").
func NewRetrievalObserver ¶
func NewRetrievalObserver[M any](name string) RetrievalObserver[M]
NewRetrievalObserver declares an instance-owned complete-read observer. Example: NewRetrievalObserver[Order]("orders.read").
func (RetrievalObserver[M]) Declare ¶
func (o RetrievalObserver[M]) Declare(factory func() RetrievalHooks[M]) (lifecycle.Declaration, error)
Declare captures the per-batch factory without running it. Example: observer.Declare(orderReadHooks).
func (RetrievalObserver[M]) Name ¶
func (o RetrievalObserver[M]) Name() string
Name returns the registration identifier. Example: observer.Name().
func (RetrievalObserver[M]) Validate ¶
func (o RetrievalObserver[M]) Validate() error
Validate checks the identifier without constructing hooks. Example: observer.Validate().
type SimplePage ¶
type SimplePage[M any] = querycore.SimplePage[M]
SimplePage retains the existing page-without-total response contract.
func SimplePaginate ¶ added in v0.2.0
func SimplePaginate[M any](ctx context.Context, ex database.Executor, q Query[M], request PageRequest) (SimplePage[M], error)
SimplePaginate fetches one extra row to determine whether another page exists.
type Slot ¶
type Slot[M, S any] struct { // contains filtered or unexported fields }
Slot binds an extension value without persisting a model column. Example: Title orm.Slot[Article,translations.Text].
type SoftDeletable ¶
type SoftDeletable[M any] struct { // contains filtered or unexported fields }
SoftDeletable authorizes restoring or physically deleting soft-delete models. Example: Soft SoftDeletable[User]. Its zero value is invalid.
func SoftDeletes ¶
func SoftDeletes[M any, V InstantValue](field SoftDelete[M, V]) SoftDeletable[M]
SoftDeletes captures the explicitly declared deletion column. Example: Soft: SoftDeletes(deletedAt).
type SoftDelete ¶
type SoftDelete[M any, V InstantValue] = nullableTimeColumn[M, V, deletedRole]
SoftDelete is a nullable deletion instant. Example: SoftDeleteOf(b,&o.DeletedAt).
func SoftDeleteOf ¶
func SoftDeleteOf[M any, V InstantValue](b Builder[M], ptr *value.Nullable[V]) SoftDelete[M, V]
SoftDeleteOf explicitly marks a deletion timestamp. Example: SoftDeleteOf(b,&o.DeletedAt).
type SourceKey ¶
type SourceKey[S, M any] struct { // contains filtered or unexported fields }
SourceKey matches a stored primary value without assigning it. Example: rows.MatchSource(orm.KeyExpr(Users.ID),expr.Value(orm.ColumnExpr(Archives.UserID))).
func FoundrySourceKey ¶
func FoundrySourceKey[S, M any](m ormcore.ModelMapping, seal sqlowner.ExpressionSeal) SourceKey[S, M]
FoundrySourceKey binds a framework expression to a stored primary key. Example: FoundrySourceKey[Archive,User](mapping,sqlowner.Expressions()).
type Statement ¶
type Statement struct {
// contains filtered or unexported fields
}
Statement is an immutable compiled statement. Example: s,err := Compile(Orders.Query()).
func CompileLocked ¶
func CompileLocked[M any](q LockedQuery[M]) (Statement, error)
CompileLocked inspects a locked read without I/O. Example: CompileLocked(orm.Lock(Orders.Query())).
func FoundryStatement ¶
FoundryStatement retains the shared immutable inspection boundary. Example: FoundryStatement(s,sqlowner.Metadata()).
func (Statement) Arguments ¶
Arguments returns an owned binding snapshot. Example: statement.Arguments().
func (Statement) GoString ¶
GoString omits SQL and bindings from diagnostics. Example: fmt.Sprintf("%#v",statement).
type Table ¶
type Table[M any, K comparable] struct { // contains filtered or unexported fields }
Table retains the model and primary-key types. Example: Table[Order,model.ID[Order]].
func TableOf ¶
func TableOf[M any, K comparable](b Builder[M], ptr *K, opts ...ColumnOption[K]) Table[M, K]
TableOf declares the primary key once. Example: tbl := TableOf(b,&o.ID).
type TextExpressionColumn ¶
type TextExpressionColumn[M, V, P any] interface { OrderedExpressionColumn[M, V, P] // contains filtered or unexported methods }
TextExpressionColumn preserves text operations at the expression boundary. The interface excludes direct non-text inputs. Adapters also validate the retrieved column metadata: embedding can promote markers from another handle. Example: expr.TextContains(expr.TextRow(orm.TextExpr(Users.Name)), "Ada").
type TextLookupKey ¶
TextLookupKey retains the primary lookup role. Example: TextKey(table.Key()).
type TextPrimary ¶
TextPrimary preserves text primary capabilities. Example: TextKey(PrimaryOf(b, table.Key())).
type Through ¶
type Through[M, N, P any] struct { // contains filtered or unexported fields }
Through identifies a typed pivot slot. Example: Groups orm.Through[User,Group,Membership].
type ThroughRelation ¶
type ThroughRelation[M, N, P any] struct { // contains filtered or unexported fields }
ThroughRelation retains source, target and pivot owners in a thin immutable plan. Example: UserRelations.Groups.WherePivot(orm.InputTextEq(Memberships.Role, "admin")).
func ManyToManyOf ¶
func ManyToManyOf[M, N, P any, A, B comparable](slot Through[M, N, P], local KeyColumn[M, A], pivotLocal KeyColumn[P, A], pivotForeign KeyColumn[P, B], foreign KeyColumn[N, B]) ThroughRelation[M, N, P]
ManyToManyOf unifies both key pairs and binds a concrete pivot slot. Example: orm.ManyToManyOf(Users.Groups,orm.KeyExpr(Users.ID),orm.ColumnExpr(Memberships.UserID),orm.ColumnExpr(Memberships.GroupID),orm.KeyExpr(Groups.ID)).
func MorphToManyOf ¶
func MorphToManyOf[M model.Morphable, N, P any, A, B comparable](slot Through[M, N, P], local KeyColumn[M, A], pivotLocal KeyColumn[P, A], kind KeyColumn[P, model.MorphName], pivotForeign KeyColumn[P, B], foreign KeyColumn[N, B]) ThroughRelation[M, N, P]
MorphToManyOf filters the shared pivot by the source discriminator. Example: orm.MorphToManyOf(Offices.Labels,orm.TextExpr(Offices.Code),orm.TextExpr(Labelings.LabelableID),orm.ColumnExpr(Labelings.LabelableType),orm.ColumnExpr(Labelings.LabelID),orm.KeyExpr(Labels.ID)).
func MorphedByManyOf ¶
func MorphedByManyOf[M any, N model.Morphable, P any, A, B comparable](slot Through[M, N, P], local KeyColumn[M, A], pivotLocal KeyColumn[P, A], kind KeyColumn[P, model.MorphName], pivotForeign KeyColumn[P, B], foreign KeyColumn[N, B]) ThroughRelation[M, N, P]
MorphedByManyOf filters the shared pivot by one concrete target discriminator. Example: orm.MorphedByManyOf(Labels.Offices,orm.KeyExpr(Labels.ID),orm.ColumnExpr(Labelings.LabelID),orm.ColumnExpr(Labelings.LabelableType),orm.TextExpr(Labelings.LabelableID),orm.TextExpr(Offices.Code)).
func WithRelationWriteLimit ¶
func WithRelationWriteLimit[M, N, P any](r ThroughRelation[M, N, P], limit int) ThroughRelation[M, N, P]
WithRelationWriteLimit lowers the atomic row bound without changing read limits. Example: links := orm.WithRelationWriteLimit(UserRelations.Groups,100).
func WithoutPivotGlobalScope ¶
func WithoutPivotGlobalScope[M, N, P any](r ThroughRelation[M, N, P], scopes ...GlobalScope[P]) ThroughRelation[M, N, P]
WithoutPivotGlobalScope removes named pivot defaults only. Example: WithoutPivotGlobalScope(UserRelations.Groups, membershipTenantScope).
func WithoutPivotGlobalScopes ¶
func WithoutPivotGlobalScopes[M, N, P any](r ThroughRelation[M, N, P]) ThroughRelation[M, N, P]
WithoutPivotGlobalScopes removes every pivot default only. Example: WithoutPivotGlobalScopes(UserRelations.Groups).
func (ThroughRelation[M, N, P]) OnlyTrashed ¶
func (r ThroughRelation[M, N, P]) OnlyTrashed() ThroughRelation[M, N, P]
OnlyTrashed sets visibility for this side only. Example: links.OnlyTrashed().
func (ThroughRelation[M, N, P]) OnlyTrashedPivot ¶
func (r ThroughRelation[M, N, P]) OnlyTrashedPivot() ThroughRelation[M, N, P]
OnlyTrashedPivot sets visibility for this side only. Example: links.OnlyTrashedPivot().
func (ThroughRelation[M, N, P]) OrderBy ¶
func (r ThroughRelation[M, N, P]) OrderBy(orders ...Order[N]) ThroughRelation[M, N, P]
OrderBy derives an immutable joined descriptor for its typed side. Example: links.OrderBy(orm.TextAsc(Groups.Name)).
func (ThroughRelation[M, N, P]) OrderByPivot ¶
func (r ThroughRelation[M, N, P]) OrderByPivot(orders ...Order[P]) ThroughRelation[M, N, P]
OrderByPivot derives an immutable joined descriptor for its typed side. Example: links.OrderByPivot(orm.KeyAsc(Memberships.ID)).
func (ThroughRelation[M, N, P]) Where ¶
func (r ThroughRelation[M, N, P]) Where(ps ...Predicate[N]) ThroughRelation[M, N, P]
Where derives an immutable joined descriptor for its typed side. Example: links.Where(orm.TextEq(Groups.Name, "maintainers")).
func (ThroughRelation[M, N, P]) WherePivot ¶
func (r ThroughRelation[M, N, P]) WherePivot(ps ...Predicate[P]) ThroughRelation[M, N, P]
WherePivot derives an immutable joined descriptor for its typed side. Example: links.WherePivot(orm.InputTextEq(Memberships.Role, "admin")).
func (ThroughRelation[M, N, P]) With ¶
func (r ThroughRelation[M, N, P]) With(children ...Relation[N]) ThroughRelation[M, N, P]
With derives an immutable joined descriptor for its typed side. Example: links.With(GroupRelations.Owner).
func (ThroughRelation[M, N, P]) WithPivot ¶
func (r ThroughRelation[M, N, P]) WithPivot(children ...Relation[P]) ThroughRelation[M, N, P]
WithPivot derives an immutable joined descriptor for its typed side. Example: links.WithPivot(MembershipRelations.Inviter).
func (ThroughRelation[M, N, P]) WithTrashed ¶
func (r ThroughRelation[M, N, P]) WithTrashed() ThroughRelation[M, N, P]
WithTrashed sets visibility for this side only. Example: links.WithTrashed().
func (ThroughRelation[M, N, P]) WithTrashedPivot ¶
func (r ThroughRelation[M, N, P]) WithTrashedPivot() ThroughRelation[M, N, P]
WithTrashedPivot sets visibility for this side only. Example: links.WithTrashedPivot().
func (ThroughRelation[M, N, P]) WithoutTrashed ¶
func (r ThroughRelation[M, N, P]) WithoutTrashed() ThroughRelation[M, N, P]
WithoutTrashed sets visibility for this side only. Example: links.WithoutTrashed().
func (ThroughRelation[M, N, P]) WithoutTrashedPivot ¶
func (r ThroughRelation[M, N, P]) WithoutTrashedPivot() ThroughRelation[M, N, P]
WithoutTrashedPivot sets visibility for this side only. Example: links.WithoutTrashedPivot().
type TimeValue ¶
type TimeValue interface {
time.Time | temporal.DateTime | temporal.Date | temporal.Time | temporal.LocalDateTime
}
TimeValue permits supported temporal fields. Example: Time[Order, temporal.DateTime].
type UpdateMapping ¶
type UpdateMapping[S, M any] struct { // contains filtered or unexported fields }
UpdateMapping maps a non-primary stored value. Example: rows.MapUpdate(orm.TextExpr(Users.Name), expr.Value(orm.TextExpr(Archives.Name))).
func FoundryUpdateMapping ¶
func FoundryUpdateMapping[S, M any](m ormcore.ModelMapping, seal sqlowner.ExpressionSeal) UpdateMapping[S, M]
FoundryUpdateMapping binds a framework expression to its destination. Example: FoundryUpdateMapping[Archive,User](mapping,sqlowner.Expressions()).
type UpdateSource ¶
type UpdateSource[S, M any] struct { // contains filtered or unexported fields }
UpdateSource updates matching models; ambiguous mapped values roll back. Example: rows.UpdateFrom(Users.Query(),rows.From(Archives.Query())).
func FoundryUpdateFrom ¶
func FoundryUpdateFrom[S, M any](q Query[M], source ormcore.Source, seal sqlowner.QuerySeal) UpdateSource[S, M]
FoundryUpdateFrom creates a source update plan. Example: FoundryUpdateFrom[Archive](Users.Query(),source,sqlowner.Queries()).
func (UpdateSource[S, M]) Exec ¶
func (p UpdateSource[S, M]) Exec(ctx context.Context, writer database.Transactor) (int64, error)
Exec rolls back ambiguous SQL-mapped updates. Example: plan.Exec(ctx,db).
func (UpdateSource[S, M]) Format ¶
func (UpdateSource[S, M]) Format(s fmt.State, _ rune)
Format hides captured source values. Example: fmt.Sprintf("%#v",plan).
func (UpdateSource[S, M]) Match ¶
func (p UpdateSource[S, M]) Match(key SourceKey[S, M]) UpdateSource[S, M]
Match replaces the source-to-primary match. Example: plan.Match(rows.MatchSource(orm.KeyExpr(Users.ID),expr.Value(orm.ColumnExpr(Archives.UserID)))).
func (UpdateSource[S, M]) Returning ¶
func (p UpdateSource[S, M]) Returning(ctx context.Context, writer database.Transactor, limit int) ([]M, error)
Returning preserves complete hydration and rejects ambiguous matches. Example: plan.Returning(ctx,db,100).
func (UpdateSource[S, M]) Select ¶
func (p UpdateSource[S, M]) Select(mappings ...UpdateMapping[S, M]) UpdateSource[S, M]
Select appends stored-value mappings without bypassing mutators. Example: plan.Select(rows.MapUpdate(orm.TextExpr(Users.Name), expr.Value(orm.TextExpr(Archives.Name)))).
func (UpdateSource[S, M]) Values ¶
func (p UpdateSource[S, M]) Values(values ...Assignment[M]) UpdateSource[S, M]
Values replaces literal inputs; repeated source keys are allowed without mappings. Example: plan.Values(orm.TextSet(Users.Name, "archived")).
type UpdateTarget ¶
type UpdateTarget[M, V, P any] interface { ExpressionColumn[M, V, P] ordinaryLayouts[M, V] | createdLayouts[M, V] }
UpdateTarget excludes all primary keys, mutators and managed update timestamps. Example: rows.MapUpdate(orm.TextExpr(Users.Name), expr.Value(orm.TextExpr(Archives.Name))).
type UpdatedAt ¶
type UpdatedAt[M any, V InstantValue] = timeColumn[M, V, updatedRole]
UpdatedAt is an explicitly managed update instant. Example: UpdatedAtOf(b,&o.UpdatedAt).
func UpdatedAtOf ¶
func UpdatedAtOf[M any, V InstantValue](b Builder[M], ptr *V) UpdatedAt[M, V]
UpdatedAtOf explicitly marks an update timestamp. Example: UpdatedAtOf(b,&o.UpdatedAt).
type Value ¶
type Value[M, V any] struct { // contains filtered or unexported fields }
Value identifies a typed computed slot. Example: OrdersCount orm.Value[User,int64].
func ValueOf ¶
ValueOf binds an aggregate slot during Define. Example: orm.ValueOf(b,&u.OrdersCount).
func (Value[M, V]) Using ¶
func (v Value[M, V]) Using(computation AggregateRelation[M, V]) AggregateRelation[M, V]
Using binds a computation with the slot's exact owner and result type. Example: Users.OrdersCount.Using(expr.Related(UserRelations.Orders,expr.Count[Order]())).
type ValueLookup ¶
type ValueLookup[M any, V comparable] struct { // contains filtered or unexported fields }
ValueLookup observes a stored field without hydrating models or running retrieval hooks. It is advisory, not a reservation. Example: orm.Lookup(Users.Query(), orm.TextExpr(Users.Email)).
func Lookup ¶
func Lookup[M any, V comparable](source Query[M], field KeyColumn[M, V]) ValueLookup[M, V]
Lookup binds a stored column's non-null value type to its complete model scope. Ordering, pagination and eager loading are rejected. Example: orm.Lookup(Users.Query(), orm.NullableTextExpr(Users.Nickname)).
func (ValueLookup[M, V]) AllExist ¶
func (l ValueLookup[M, V]) AllExist(ctx context.Context, ex database.Executor, input []V) (bool, error)
AllExist checks SQL equality in batches of 64, including duplicate representations. Empty input performs no I/O. Example: lookup.AllExist(ctx, db, emails).
func (ValueLookup[M, V]) AnyExist ¶
func (l ValueLookup[M, V]) AnyExist(ctx context.Context, ex database.Executor, input []V) (bool, error)
AnyExist checks IN predicates in batches of 64 and stops on the first match. Empty input performs no I/O. Example: lookup.AnyExist(ctx, db, emails).
func (ValueLookup[M, V]) Exists ¶
Exists performs one equality observation without a transaction. Example: lookup.Exists(ctx, db, email).
func (ValueLookup[M, V]) Format ¶
func (l ValueLookup[M, V]) Format(s fmt.State, _ rune)
Format redacts every formatting verb. Example: fmt.Sprintf("%+v", lookup).
func (ValueLookup[M, V]) GoString ¶
func (l ValueLookup[M, V]) GoString() string
GoString redacts Go-syntax diagnostics. Example: fmt.Sprintf("%#v", lookup).
func (ValueLookup[M, V]) String ¶
func (ValueLookup[M, V]) String() string
String redacts retained predicates. Example: fmt.Sprint(lookup).
func (ValueLookup[M, V]) Validate ¶
func (l ValueLookup[M, V]) Validate() error
Validate checks declarations without encoding values or performing I/O. Example: lookup.Validate().
type Write ¶
type Write[M any] struct { // contains filtered or unexported fields }
Write is an operation-local draft. Use it only during Saving/Creating/Updating. Example: WriteSet(write, orm.NumberSet(Orders.TotalCents, 0)).
type WriteError ¶
type WriteError[R any] struct { // contains filtered or unexported fields }
WriteError preserves a candidate when persistence needs reconciliation. Example: errors.As(err,&writeError).
func (*WriteError[R]) Candidate ¶
func (e *WriteError[R]) Candidate() R
Candidate is reconciliation data, not proof of persistence. Example: writeError.Candidate().
func (*WriteError[R]) Error ¶
func (e *WriteError[R]) Error() string
Error omits model values. Example: writeError.Error().
func (*WriteError[R]) GoString ¶
func (e *WriteError[R]) GoString() string
GoString omits model values. Example: fmt.Sprintf("%#v",writeError).
func (*WriteError[R]) Unwrap ¶
func (e *WriteError[R]) Unwrap() error
Unwrap retains the original transaction outcome. Example: errors.As(writeError, &databaseError).
Source Files
¶
- adjustment.go
- adjustment_write.go
- audit.go
- audit_read.go
- changes.go
- chunk.go
- codecs.go
- column.go
- column_adapters.go
- column_conflict.go
- column_input.go
- column_interval.go
- column_json.go
- column_methods.go
- column_role.go
- column_sensitive.go
- conflict.go
- conflict_bridge.go
- conflict_write.go
- create_or_first.go
- cursor.go
- declaration.go
- encrypted_write.go
- explain.go
- extension.go
- global_scope.go
- hooks.go
- identity.go
- input_binding.go
- input_key.go
- insert_each.go
- limits.go
- lookup.go
- lookup_value.go
- model_read.go
- mutator.go
- number_key.go
- ordered.go
- pagination.go
- pagination_types.go
- projection_bridge.go
- prune.go
- query.go
- raw.go
- raw_fragment.go
- record.go
- relation.go
- relation_aggregate.go
- relation_aggregate_loading.go
- relation_expression_order.go
- relation_global_scope.go
- relation_join_plan.go
- relation_loading.go
- relation_morph.go
- relation_pivot_mutation.go
- relation_predicate.go
- relation_scope.go
- relation_through.go
- relation_through_hop.go
- relation_through_loading.go
- relation_tree.go
- relation_value.go
- relation_write.go
- relation_write_core.go
- retrieval.go
- source.go
- source_write.go
- source_write_bridge.go
- source_write_execution.go
- text_capability.go
- uuid_compare.go
- write.go
- write_atomic.go
- write_draft.go
- write_each.go
- write_keyed.go
- write_lookup.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package expr provides thin, typed SQL expressions in explicit source scopes.
|
Package expr provides thin, typed SQL expressions in explicit source scopes. |
|
internal
|
|
|
enuminit
Package enuminit deliberately declares models before generated enum variables.
|
Package enuminit deliberately declares models before generated enum variables. |
|
Package rows provides typed aliases, joins and complete row projections.
|
Package rows provides typed aliases, joins and complete row projections. |