Skip to content

Help wanted:How to use the options parameter in the in the openDatabase() method. #892

Answered by alextekartik
Haadi-A asked this question in Q&A
Discussion options

You must be logged in to vote

Ok I see, indeed the DatabaseFactory.openDatabase API is slightly different then the sqflite openDatabase API that you might have seen in some example. All the parameters must be set in an options object. You should do something like:

var db = await dbFactoryFfiObj.openDatabase(path,
          options: OpenDatabaseOptions(
              version: 1,
              onCreate: (db, version) async {
                // ... your onCreate implementation here
              }));

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Haadi-A
Comment options

Comment options

You must be logged in to vote
1 reply
@Haadi-A
Comment options

Answer selected by Haadi-A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants