You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You could do something like this if your table has a serial pk named id and you insert a single record:
...
var id int
_, err := conn.Scan("INSERT INTO foo (bar) VALUES ('baz') RETURNING id;", &id)
if err != nil {
return err
}
// do something with id
...
The Scan method is available on Conn as well as Statement.
If you insert multiple records at once, you may want to try one of the Query methods instead (didn't test this one though).
I'm closing this issue, but feel free to reopen, if it doesn't work out.
apologies if this is incorrect...
Support on Execute for returning any generated keys as the result of statement. An example in Java would be:
The text was updated successfully, but these errors were encountered: