Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var OrderMeta = drel.ModelMeta[Order]{ Table: "orders", Columns: []string{"id", "customer", "total", "created_at", "updated_at"}, PKColumn: "id", Scan: scanOrder, Snapshot: snapshotOrder, Diff: diffOrder, PKValue: orderPKValue, InsertColumns: orderInsertColumns, ScanReturning: orderScanReturning, ColumnValue: orderColumnValue, NormalizeKey: orderNormalizeKey, KeyStrategy: drel.KeyAppAssigned, GenerateKey: drel.UUIDv7Key, SetKey: func(p *Order, key any) { p.SetID(key.(uuid.UUID)) }, KeyIsZero: orderKeyIsZero, ScanGenerated: orderScanGenerated, }
View Source
var Orders = struct { ID drel.ComparableColumn[uuid.UUID] Customer drel.StringColumn Total drel.OrderedColumn[int] CreatedAt drel.TimeColumn UpdatedAt drel.TimeColumn }{ ID: drel.NewComparableCol[uuid.UUID]("id"), Customer: drel.NewStringCol("customer"), Total: drel.NewOrderedCol[int]("total"), CreatedAt: drel.NewTimeCol("created_at"), UpdatedAt: drel.NewTimeCol("updated_at"), }
Functions ¶
This section is empty.
Types ¶
type Order ¶
Order uses an application-assigned UUIDv7 primary key. drel stamps a fresh v7 UUID at Add() time — the id is available before any flush.
type OrderRepository ¶
type OrderRepository struct {
*drel.Repository[Order]
}
type TxOrderRepository ¶
type TxOrderRepository struct {
*drel.TxRepository[Order]
}
Click to show internal directories.
Click to hide internal directories.