Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upMySql : call LAST_INSERT_ID() after insert to get the last generated id. #1011
Comments
This comment has been minimized.
|
|
sgrif
closed this
Jul 9, 2017
This comment has been minimized.
vityafx
commented
Jul 13, 2017
|
@sgrif could you be so kind giving an example please? (I am interested in sqlite and postgre-sql). |
This comment has been minimized.
mmrath
commented
Jul 15, 2017
|
@vityafx In case you have not found a solution yet. in my db module I have
I use it as below
|
This comment has been minimized.
haruhinoshana
commented
Apr 9, 2018
|
@mmrath sir do you have a sample to implement this get last_insert_id im new at diesel and rust itself it will be a big help |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mmrath commentedJul 9, 2017
Setup
Versions
Feature Flags
Problem Description
After insert into a table with auto_incremented primary key, we need to get the generated id after the insert.
What are you trying to accomplish?
In PG the following works.
But we don't have anything similar for MySQL
What is the expected output?
Something like the above to work in MySQL
What is the actual output?
Are you seeing any additional errors?
Steps to reproduce
Checklist