drift
drift copied to clipboard
Hi there is thing you didn't mention ! how to connect to already exist db with db format ?
I mean that we already have existed database and we should use it how should we connect to it? how to use it? could you please help? I really need it!
I see that you've also commented on the other issue for this, and I think that explains most of the the steps.
If you have an existing sqlite3 database file, you can extract the CREATE TABLE
statements and put them into a .drift
file that you include from your database class.
how should we connect to it?
For an existing sqlite3 database at some path, you can just use NativeDatabase(File('path/to/your/database.file'))
to connect to it. If you included the existing schema in a drift file, this should just work.
how to use it?
The same way you use other drift databases, there are no differences here?
If you still need more information or an example, describing your use-case in more detail would help. What exactly do you have, a sqlite3 database file? Do you include it as a Flutter asset or do you have it lying around on user's devices already?