Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db.Connection.CreateMany should set IDs #135

Open
dqu123 opened this issue Nov 5, 2019 · 0 comments
Open

db.Connection.CreateMany should set IDs #135

dqu123 opened this issue Nov 5, 2019 · 0 comments

Comments

@dqu123
Copy link

dqu123 commented Nov 5, 2019

What happened:
image

What you expected to happen:
IDs to be set in array of objects after calling CreateMany()

How to reproduce it (as minimally and precisely as possible):
CreateMany() any array of objects. Print out the IDs, which will remain 0.

Anything else we need to know?:
https://stackoverflow.com/a/5876411 seems to provide a solution:
INSERT INTO my_table VALUES ('a'), ('b'), ('c') RETURNING id;

Environment:

  • go-sdk version: v1.1.1

  • go version (e.g go version): go version go1.12.12 darwin/amd64

  • OS (e.g: cat /etc/os-release): uname -mrsv -> Darwin 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64

  • Others:

@dqu123 dqu123 changed the title db.Connection.CreateMany should set ID db.Connection.CreateMany should set IDs Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant