Home > Back-end >  Delete Database in Sqflite package in flutter
Delete Database in Sqflite package in flutter

Time:02-03

I am using the package 'sqflite' in flutter and I could not find a way to delete the entire database when the user in my app clicks on 'Delete Account'.

There are methods to delete data in a table but is there a way to delete the entire database using the package?

CodePudding user response:

There is a delete database function in the DatabaseFactory that can delete a database based on path.

Future<void> deleteDatabase(String path) =>
    databaseFactory.deleteDatabase(path);

See documentation for more information: https://pub.dev/documentation/sqflite_common/latest/sqlite_api/DatabaseFactory-class.html

  •  Tags:  
  • Related