hhtokpinar / sqfEntity

SqfEntity ORM for Flutter/Dart lets you build and execute SQL commands on SQLite database easily and quickly with the help of fluent methods similar to .Net Entity Framework. SqfEntity also generates add/edit forms with validations and special controls (DropDown List, DateTime pickers, Checkboxes.. etc) for your table.
379 stars 101 forks source link

How can we determine when the database is ready? #273

Closed JWambaugh closed 2 years ago

JWambaugh commented 2 years ago

Currently, initialization of the database happens automagically, which can be nice, but I'm running into an issue when the user first runs my app and I try to access the database, that the database hasn't finished being created yet, so I get exceptions. Is there a way to tell when the database is ready for use and finished initialization?

hhtokpinar commented 2 years ago

the CRUD operations will be worked right after finished initialization already. If you want to use initializing db manually so use:

final bool isSuccess = MyDbModel().initializeDB();
// TO DO if isSuccess is true