Closed
Description
:exec
only checks the error
:execresult
returns the full sql.Result
:execrows
returns the sql.Result.RowsAffected() (int64, error)
We just need one more return type to support the full interface:
:execlastinsertid
would just be a matter of calling .LastInsertId()
rather than .RowsAffected()
on the sql.Result.
This will avoid sql.Result
database information leaking across the boundary of the pkg.Querier
interface. It's not good for the service code to be handling DB specific method calls. This is a MySQL/SQLite issue as Postgres uses RETURNING
so you can use :one
instead.