diff --git a/docs/lib/snippets/setup/database.dart b/docs/lib/snippets/setup/database.dart index fe45fc4d..00d175a5 100644 --- a/docs/lib/snippets/setup/database.dart +++ b/docs/lib/snippets/setup/database.dart @@ -31,7 +31,12 @@ class TodoItems extends Table { @DriftDatabase(tables: [TodoItems]) class AppDatabase extends _$AppDatabase { +// #enddocregion open + // After generating code, this class needs to define a `schemaVersion` getter + // and a constructor telling drift where the database should be stored. + // These are described in the getting started guide: https://drift.simonbinder.eu/getting-started/#open // #enddocregion before_generation +// #docregion open AppDatabase() : super(_openConnection()); @override diff --git a/docs/pages/docs/setup.md b/docs/pages/docs/setup.md index 59947b8f..a1379099 100644 --- a/docs/pages/docs/setup.md +++ b/docs/pages/docs/setup.md @@ -99,7 +99,7 @@ You will now see errors related to missing overrides and a missing constructor. is responsible for telling drift how to open the database. The `schemaVersion` getter is relevant for migrations after changing the database, we can leave it at `1` for now. The database class now looks like this: - + {% include "blocks/snippet" snippets = snippets name = 'open' %} The Android-specific workarounds are necessary because sqlite3 attempts to use `/tmp` to store