sqflite中的多个表

时间:2019-04-28 16:14:51

标签: dart flutter sqflite

我对扑朔迷离非常陌生,我只想设置一个具有多个表的SQLite数据库。 我在下面的研究。

提前谢谢。

https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions032.htm

等待db.execute('''       创建表$ reminderTable(         $ columnReminderId整数主键自动递增,         $ columnReminderCarId整数不为null,         $ columnReminderName文本不为null,         $ columnReminderNotifyMileage整数不为null,         $ columnReminderEndMileage整数不为null        )'''); 等待db.execute('''        创建表$ carTable(         $ columnCarId整数主键自动递增,         $ columnCarTitle文本不为空        )''');

调用sqlite3_step时发生未知错误(10:磁盘I / O错误)rs

1 个答案:

答案 0 :(得分:0)

例如,您可以仅组合多个db.execute调用

void _createDb(Database db, int newVersion) async {
    await db.execute(
        'CREATE TABLE $noteTable($colId INTEGER PRIMARY KEY AUTOINCREMENT, $colTitle TEXT, '
        '$colDescription TEXT, $colPriority INTEGER, $colDate TEXT)');

 await db.execute(
        'CREATE TABLE $noteTable($colId INTEGER PRIMARY KEY AUTOINCREMENT, $colTitle TEXT, '
        '$colDescription TEXT, $colPriority INTEGER, $colDate TEXT)');
  }