Correctly build updaters with New
Otherwise we have nil columns
This commit is contained in:
parent
7da653efc6
commit
24a3610c4c
6 changed files with 29 additions and 7 deletions
|
|
@ -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).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue