-
Notifications
You must be signed in to change notification settings - Fork 78
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
Returning last inserted id #112
Comments
I'm not sure how the driver here would know to add Also, it looks like it's used in this struct https://github.com/crystal-lang/crystal-db/blob/385cf70a8a5d41374cce988168e82495743ee459/src/db.cr#L80 But I often have tables where the ID is not an Int64, often they're UUIDs or something else, so I'm not sure it's generalizable at all. This might be something that comes from mysql or something? |
@will I agree that I'm not sure, but aren't you able to check whether is |
|
I can't even get RETURNING to work, the code gets tangled up. It looks like support was there in the frame.cr code once (DataRow) but it doesn't work now. Other issues report that db.scalar works but it doesn't with the latest release - possibly because of the breaking crystal change that broke the rest? Below is the attempted fix with a PR #121 |
So, could anyone make |
|
Hm, yes. It works if doing |
Thats just how postgres works.
|
Yep. Closing this one then. |
Does |
Refer to
crystal-pg/src/pg/statement.cr
Line 39 in 8005408
But there is an option with
RETURNING
; maybe this could be implemented?The text was updated successfully, but these errors were encountered: