Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
500 views
in Technique[技术] by (71.8m points)

flutter - 如何检查和删除flf中所有现有的sqflite数据库?(How to check and delete all existing db of sqflite in flutter?)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...