Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NoteMeta = drel.ModelMeta[Note]{ Table: "notes", Columns: []string{"id", "slug", "title", "category", "pinned", "created_at", "updated_at"}, PKColumn: "id", Scan: scanNote, Snapshot: snapshotNote, Diff: diffNote, PKValue: notePKValue, InsertColumns: noteInsertColumns, ScanReturning: noteScanReturning, ColumnValue: noteColumnValue, }
View Source
var Notes = struct { ID drel.OrderedColumn[int] Slug drel.StringColumn Title drel.StringColumn Category drel.StringColumn Pinned drel.BoolColumn CreatedAt drel.Column[time.Time] UpdatedAt drel.Column[time.Time] }{ ID: drel.NewOrderedCol[int]("id"), Slug: drel.NewStringCol("slug"), Title: drel.NewStringCol("title"), Category: drel.NewStringCol("category"), Pinned: drel.NewBoolCol("pinned"), CreatedAt: drel.NewCol[time.Time]("created_at"), UpdatedAt: drel.NewCol[time.Time]("updated_at"), }
Functions ¶
This section is empty.
Types ¶
type Note ¶
type Note struct {
drel.Model[int]
Slug string `db:"slug,unique"`
Title string `db:"title"`
Category string `db:"category,index"`
Pinned bool `db:"pinned"`
}
Note is a simple SQLite-backed model. The db tag options declare an index on `category` and a unique index on `slug`, which codegen turns into CREATE INDEX DDL in the generated migration.
type NoteRepository ¶
type NoteRepository struct {
*drel.Repository[Note]
}
type TxNoteRepository ¶
type TxNoteRepository struct {
*drel.TxRepository[Note]
}
type UoWNoteRepository ¶
type UoWNoteRepository struct {
*drel.UoWRepository[Note]
}
Click to show internal directories.
Click to hide internal directories.