insert
always returns int
#1222
-
What if my model doesn't have an auto-increment TextColumn get id => text().clientDefault(() => _uuid.v4())(); I see in the comment that it returns |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 21 replies
-
You can use Be aware that this requires a fairly recent sqlite3 version (at least 3.35.0). If you use |
Beta Was this translation helpful? Give feedback.
You can use
insertReturning
instead ofinsert
to obtain a full row instance with the generated uuid.Be aware that this requires a fairly recent sqlite3 version (at least 3.35.0). If you use
sqlite3_flutter_libs
you will have that version available, if you rely on the sqlite3 from the operating systems you probably don't.