DatabaseConnection class Null safety

A database connection managed by drift. This consists of two components:

  • a QueryExecutor, which runs sql statements.
  • a StreamQueryStore, which dispatches table changes to listening queries, on which the auto-updating queries are based.

Constructors

DatabaseConnection(QueryExecutor executor, {StreamQueryStore? streamQueries})
Constructs a raw database connection from the executor and optionally a specified streamQueries implementation to use.
DatabaseConnection.delayed(FutureOr<DatabaseConnection> connection)
Database connection that is instantly available, but delegates work to a connection only available through a Future.
factory
DatabaseConnection.fromExecutor(QueryExecutor executor)
Constructs a DatabaseConnection from the QueryExecutor by using the default type system and a new StreamQueryStore.

Properties

executor QueryExecutor
The executor to use when queries are executed.
final
hashCode int
The hash code for this object.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
streamQueries → StreamQueryStore
Manages active streams from select statements.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
withExecutor(QueryExecutor executor) DatabaseConnection
Returns a database connection that is identical to this one, except that it uses the provided executor.

Operators

operator ==(Object other) bool
The equality operator.
inherited