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

Need to set null for sqflite database instance when close database. Otherwise it will always return the old instance. #838

Open
haidang750 opened this issue Jul 26, 2024 · 4 comments

Comments

@haidang750
Copy link

In close() function of database.dart file, need to set null for current database before closing it like this:
Future close() async {
final db = await instance.database;
_database = null;
await db.close();
}

@haidang750
Copy link
Author

You can find this issue by: tekartik/sqflite#223

@haidang750
Copy link
Author

@stephanmantel please help me

@stephanmantel
Copy link
Contributor

Hi, thanks for your interest in Floor and fr filing this issue, I shall take a look at it

@haidang750
Copy link
Author

thank you very much, my case is switching between different sqflite .db files, so I need to close the current before open the new one, but I got the error Unhandled Exception: DatabaseException(error database_closed) after close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants