Defines the migration strategy that will determine how to deal with an
increasing schemaVersion. The default value only supports creating the
database by creating all tables known in this database. When you have
changes in your schema, you'll need a custom migration strategy to create
the new tables or change the columns.
Closes this database and releases associated resources.
inherited
computeWithDatabase<Ret, DB extends GeneratedDatabase>({requiredFutureOr<Ret>computation(DB), requiredDBconnect(DatabaseConnection)})
→ Future<Ret>
On native platforms this spawns a short-lived isolate to run the computation with a drift
database.
On web platforms, this will run the computation on the current JavaScript context.
Creates a custom select statement from the given sql query. To run the
query once, use Selectable.get. For an auto-updating streams, set the
set of tables the ready readsFrom and use Selectable.watch. If you
know the query will never emit more than one row, you can also use
getSingle and watchSingle which return the item directly without
wrapping it into a list.
Executes a custom delete or update statement and returns the amount of
rows that have been changed.
You can use the updates parameter so that drift knows which tables are
affected by your query. All select streams that depend on a table
specified there will then update their data. For more accurate results,
you can also set the updateKind parameter to UpdateKind.delete or
UpdateKind.update. This is optional, but can improve the accuracy of
query updates, especially when using triggers.
Starts an UpdateStatement for the given table. You can use that
statement to update individual rows in that table by setting a where
clause on that table and then use UpdateStatement.write.