Files
progetto-m335-flutter/lib/database/database.dart
2023-09-28 11:03:54 +02:00

34 lines
720 B
Dart

import 'package:path/path.dart';
import 'package:progetto_m335_flutter/model/note.dart';
import 'package:sqflite/sqflite.dart';
class Database{
static final Database _instance = Database._init();
static Database? _database;
Database._init();
Future _createDB(Database database) async{
const integerPrimaryKeyAutoincrement = 'INTEGER PRIMARY KEY AUTOINCREMENT';
const textNotNull = 'TEXT NOT NULL';
const integerNotNull = 'INTEGER NOT NULL';
const integer = 'INTEGER';
const real = 'REAL';
const text = 'TEXT';
await database.execute('''
CREATE TABLE $Note (
${Note.id} $integerPrimaryKeyAutoincrement,
)
''');
}
execute(String s) {
}
}