Add clarifying comment to partial database class

This commit is contained in:
Simon Binder 2024-03-14 18:54:47 +01:00
parent c231d25e59
commit e90c3c33a6
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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:
<a name="open">
{% include "blocks/snippet" snippets = snippets name = 'open' %}
The Android-specific workarounds are necessary because sqlite3 attempts to use `/tmp` to store