-
So, I want to add initial data to one of my table once the app is installed.
If I understand correctly the Custom Insert query statement need to run after I am using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Yes, that is correct. Otherwise the table wouldn't exist. To me, it looks like you have a syntax error in your insert statement, AFAIK sqlite does not support Note that in recent moor versions you can use the regular apis inside a migration callback, so maybe you prefer writing onCreate: (Migrator m) async {
await m.createAll();
await into(users).insert(...);
}, Note that you may have to clear your app's data for this to work now since the db likely already exists. Still, it's a bit worrying that you didn't get an exception when opening the database for the first time. Did you overlook that maybe? |
Beta Was this translation helpful? Give feedback.
Yes, that is correct. Otherwise the table wouldn't exist. To me, it looks like you have a syntax error in your insert statement, AFAIK sqlite does not support
[
and]
for column names which explains why no data is being added.Note that in recent moor versions you can use the regular apis inside a migration callback, so maybe you prefer writing
Note that you may have to clear your app's data for this to work now since the db likely already exists. Still, it's a bit worrying that you didn't get an ex…