drift_flutter 0.2.3 copy "drift_flutter: ^0.2.3" to clipboard
drift_flutter: ^0.2.3 copied to clipboard

Easily set up drift databases across platforms in Flutter apps.

example/main.dart

import 'package:drift/drift.dart';
import 'package:drift_flutter/drift_flutter.dart';

part 'main.g.dart';

void main() async {
  final database = ExampleDatabase();
  await database.exampleTable.all().get();
}

class ExampleTable extends Table {
  IntColumn get id => integer().autoIncrement()();
  TextColumn get description => text()();
}

@DriftDatabase(tables: [ExampleTable])
final class ExampleDatabase extends _$ExampleDatabase {
  ExampleDatabase([QueryExecutor? implementation])
      : super(implementation ?? driftDatabase(name: 'db'));

  @override
  int get schemaVersion => 1;
}
16
likes
160
points
32.3k
downloads

Publisher

verified publishersimonbinder.eu

Weekly Downloads

Easily set up drift databases across platforms in Flutter apps.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#drift #database

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

drift, flutter, meta, path, path_provider, sqlite3, sqlite3_flutter_libs

More

Packages that depend on drift_flutter