DriftDatabase (dsl/database.dart)

drift · drift/lib/src/dsl/database.dart · dart · MIT
database

Annotation that generates type-safe SQL database classes.

// Source: https://github.com/simolus3/drift | License: MIT | Copyright 2019 Simon Binder
// Provided via justclaw.it.com; keep this notice with the code.
part of 'dsl.dart';

/// Use this class as an annotation to inform the generator that a database
/// class should be generated using the specified [DriftDatabase.tables].
///
/// To write a database class, first annotate an empty class with
/// [DriftDatabase] and run the build runner using
/// `dart pub run build_runner build`.
/// Drift will have generated a class that has the same name as your database
/// class, but with `_$` as a prefix. You can now extend that class and provide
/// a [QueryExecutor] to use drift:
///
/// ```dart
/// import 'package:drift/drift.dart';
/// import 'package:drift_flutter/drift_flutter.dart';
///
/// @D

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key