drift/docs/test/generated/database.dart

22 lines
519 B
Dart
Raw Normal View History

2022-08-15 10:55:06 -07:00
import 'package:drift/drift.dart';
part 'database.g.dart';
class Users extends Table {
IntColumn get id => integer().autoIncrement()();
TextColumn get name => text()();
DateTimeColumn get createdAt =>
dateTime().nullable().withDefault(currentDateAndTime)();
}
@DriftDatabase(tables: [Users])
class Database extends _$Database {
Database.connect(DatabaseConnection c) : super.connect(c);
@override
int get schemaVersion => 1;
@override
DriftDatabaseOptions options = DriftDatabaseOptions();
}