nidus-sync/db/query/publicreport/report_log.go
Eli Ribble 0fc46d5916
Only set mutable columns on insert
Because we don't want to set ID and other primary keys
2026-05-08 00:56:55 +00:00

17 lines
582 B
Go

package publicreport
import (
"context"
"github.com/Gleipnir-Technology/nidus-sync/db"
"github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/publicreport/model"
"github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/publicreport/table"
//"github.com/go-jet/jet/v2/postgres"
)
func ReportLogInsert(ctx context.Context, txn db.Ex, m model.ReportLog) (model.ReportLog, error) {
statement := table.ReportLog.INSERT(table.ReportLog.MutableColumns).
MODEL(m).
RETURNING(table.ReportLog.AllColumns)
return db.ExecuteOneTx[model.ReportLog](ctx, txn, statement)
}