From b7221cb36422148852a1e9130ed3bb3a0dc26e65 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 29 Jul 2019 15:05:16 +0200 Subject: [PATCH] Don't return error on successful insert --- internal/database/templates/postgres.type.go.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/database/templates/postgres.type.go.tpl b/internal/database/templates/postgres.type.go.tpl index fe2e66b..744016d 100644 --- a/internal/database/templates/postgres.type.go.tpl +++ b/internal/database/templates/postgres.type.go.tpl @@ -46,7 +46,7 @@ func ({{ $short }} *{{ .Name }}) Insert(db XODB) error { // run query XOLog(sqlstr, {{ fieldnames .Fields $short }}) - err = db.QueryRow(sqlstr, {{ fieldnames .Fields $short }}).Scan(&{{ $short }}.{{ .PrimaryKey.Name }}) + _, err = db.Exec(sqlstr, {{ fieldnames .Fields $short }}) if err != nil { return err }