SqliteDriver class final
Owns one native SQLite connection and serializes callback acquisition FIFO.
All statements and complete transactions share this queue, so independent sessions cannot accidentally execute inside another callback's transaction. The handle is isolate-local. Queries execute synchronously on that isolate; use a worker isolate for workloads that must not block a UI event loop.
Parameters use ? placeholders. Boolean values bind as 0/1; DateTime values
bind as exact integer microseconds since the Unix epoch. Result values keep
SQLite's native storage types.
Unsupported parameter objects are rejected before executing SQL.
SQLite exceptions propagate unchanged as sqlite.SqliteException. Compare
primary codes with sqlite.SqlError and specific sqlite.SqlExtendedError
codes with the exception's extendedResultCode.
- Implemented types
Constructors
- SqliteDriver.memory()
-
Opens an isolated in-memory database, deleted when close completes.
factory
- SqliteDriver.open(String path)
-
Opens
path, creating it if absent. Owns the handle until close.factory - SqliteDriver.openReadOnly(String path)
-
Opens an existing database file using SQLite's native read-only mode.
factory
Properties
- capabilities ↔ Capabilities
-
latefinaloverride-getter
- engine → Engine
-
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schema → String
-
Managed tables always belong to the persistent main database.
no setteroverride
Methods
-
close(
) → Future< void> -
Stops accepting callbacks, drains admitted work, then closes the handle.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withConnection<
T> (Future< T> action(Connection connection)) → Future<T> -
Acquires the exclusive handle and invalidates it after
actioncompletes.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited