DatabaseConnection class Null safety

A database connection managed by drift. Contains three components:

  • a SqlTypeSystem, which is responsible to map between Dart types and values understood by the database engine.
  • a QueryExecutor, which runs sql commands
  • a StreamQueryStore, which dispatches table changes to listening queries, on which the auto-updating queries are based.


DatabaseConnection(SqlTypeSystem typeSystem, QueryExecutor executor, StreamQueryStore streamQueries)
Constructs a raw database connection from the three components.
DatabaseConnection.delayed(FutureOr<DatabaseConnection> connection)
Database connection that is instantly available, but delegates work to a connection only available through a Future. [...]
DatabaseConnection.fromExecutor(QueryExecutor executor)
Constructs a DatabaseConnection from the QueryExecutor by using the default type system and a new StreamQueryStore.


executor QueryExecutor
The executor to use when queries are executed.
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.
typeSystem SqlTypeSystem
The type system to use with this database. The type system is responsible for mapping Dart objects into sql expressions and vice-versa.
@Deprecated('Only the default type system is supported'), final


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


operator ==(Object other) bool
The equality operator. [...]