Correctly build updaters with New

Otherwise we have nil columns
This commit is contained in:
Eli Ribble 2026-05-08 22:22:52 +00:00
parent 7da653efc6
commit 24a3610c4c
No known key found for this signature in database
6 changed files with 29 additions and 7 deletions

View file

@ -15,6 +15,13 @@ import (
type ReportUpdater = db.Updater[table.ReportTable, model.Report]
func NewReportUpdater() ReportUpdater {
return db.NewUpdater[table.ReportTable, model.Report](
table.Report,
table.Report.ID,
)
}
func ReportInsert(ctx context.Context, txn db.Ex, m model.Report) (model.Report, error) {
statement := table.Report.INSERT(table.Report.MutableColumns).
MODEL(m).