Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drift_flutter force to use ".sqlite" suffix #3367

Open
lucasdidur opened this issue Dec 3, 2024 · 1 comment
Open

drift_flutter force to use ".sqlite" suffix #3367

lucasdidur opened this issue Dec 3, 2024 · 1 comment
Labels
docs Related to the documentation (dartdoc or website)

Comments

@lucasdidur
Copy link

lucasdidur commented Dec 3, 2024

Because of

return File(p.join(dbFolder.path, '$name.sqlite'));

Old databases can't not be changed or reused if the old file does not contains .sqlite. So old database and data is lost (my case).

Solution:

Add a named parameter extension or remove the '.sqlite' part.

@simolus3
Copy link
Owner

simolus3 commented Dec 4, 2024

You can use driftDatabase(native: DriftNativeOptions(databasePath: () async => ...)) to migrate to drift_flutter while otherwise keeping your existing database path.

I will update the documentation to mention how to migrate from the old setup to drift_flutter, but I'm not sure where to put it yet.

@simolus3 simolus3 added the docs Related to the documentation (dartdoc or website) label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Related to the documentation (dartdoc or website)
Projects
None yet
Development

No branches or pull requests

2 participants