zim32 / mysql.dart

MySQL client for Dart written in Dart
BSD 3-Clause "New" or "Revised" License
64 stars 17 forks source link

LAST_INSERT_ID() #46

Closed dongri727 closed 1 year ago

dongri727 commented 1 year ago

Hello, thank you for mysql_client How can I get the last inserted ID with mysql_client ?

sido420 commented 1 year ago

Have you tried?

result.lastInsertID

zim32 commented 1 year ago

Sorry for long answer. Have a hard times now. Yes you can use https://pub.dev/documentation/mysql_client/latest/mysql_client/IResultSet/lastInsertID.html

dongri727 commented 1 year ago

thank you both for your help, it works as

var lastInsertedId = result.lastInsertID;
print(lastInsertedId);

if it became BigInt someday, I'll try the second recommend