As I am new to flutter, I have created new DB whenever I have faced an issue, But now I need to remove other unused DB's.
(由于我不熟悉该问题,因此每遇到一个问题就创建一个新的数据库,但是现在我需要删除其他未使用的数据库。)
How can I check existing DB and delete them except currently using? (除了当前使用的数据库外,如何检查现有数据库并删除它们?)
//final demoDb = 'demoDb1.db';
//final demoDb = 'demoDb2.db';
//final demoDb = 'demoDb3.db';
//final demoDb = 'demoDb4.db';
final demoDb = 'demoDb5.db'; //Currently using this one
createDatabase() async {
Directory documentsDirectory = await getApplicationDocumentsDirectory();
String path = join(documentsDirectory.path, demoDb);
var database = await openDatabase(path,
version: 1, onCreate: initDB, onUpgrade: onUpgrade);
return database;
}
Thanks in advance.
(提前致谢。)
ask by Nagaraj translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…