drift_flutter 0.2.1 copy "drift_flutter: ^0.2.1" to clipboard
drift_flutter: ^0.2.1 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;
}
11
likes
160
pub points
97%
popularity

Publisher

verified publishersimonbinder.eu

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