SqliteConnection class abstract

Abstract class representing a connection to the SQLite database.

This package typically pools multiple SqliteConnection instances into a managed SqliteDatabase automatically.

Implemented types
Implementers

Constructors

SqliteConnection()
Default constructor for subclasses.
SqliteConnection.synchronousWrapper(CommonDatabase raw, {Mutex? mutex, bool? profileQueries})
Creates a SqliteConnection instance that wraps a raw CommonDatabase from the sqlite3 package.
factory

Properties

closed → bool
Returns true if the connection is closed
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
updates → Stream<UpdateNotification>
Reports table change update notifications
no setter

Methods

abortableReadLock<T>(Future<T> callback(SqliteReadContext tx), {Future<void>? abortTrigger, String? debugContext}) → Future<T>
Takes a read lock, without starting a transaction.
abortableWriteLock<T>(Future<T> callback(SqliteWriteContext tx), {Future<void>? abortTrigger, String? debugContext}) → Future<T>
Takes a global lock, without starting a transaction.
close() → Future<void>
computeWithDatabase<T>(Future<T> compute(CommonDatabase db)) → Future<T>
See SqliteReadContext.computeWithDatabase.
override
execute(String sql, [List<Object?> parameters = const []]) → Future<ResultSet>
Execute a write query (INSERT, UPDATE, DELETE) and return the results (if any).
override
executeBatch(String sql, List<List<Object?>> parameterSets) → Future<void>
Execute a write query (INSERT, UPDATE, DELETE) multiple times with each parameter set. This is more faster than executing separately with each parameter set.
override
executeMultiple(String sql) → Future<void>
override
get(String sql, [List<Object?> parameters = const []]) → Future<Row>
Execute a read-only (SELECT) query and return a single result.
override
getAll(String sql, [List<Object?> parameters = const []]) → Future<ResultSet>
Execute a read-only (SELECT) query and return the results.
override
getAutoCommit() → Future<bool>
Returns true if auto-commit is enabled. This means the database is not currently in a transaction. This may be true even if a transaction lock is still held, when the transaction has been committed or rolled back.
inherited
getOptional(String sql, [List<Object?> parameters = const []]) → Future<Row?>
Execute a read-only (SELECT) query and return a single optional result.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onChange(Iterable<String>? tables, {Duration? throttle = const Duration(milliseconds: 30), bool triggerImmediately = true}) → Stream<UpdateNotification>
Create a Stream of changes to any of the specified tables.
onChangeUnthrottled(Iterable<String>? tables, {bool triggerImmediately = true}) → Stream<UpdateNotification>
Like onChange, but without a defaut throttle duration.
readLock<T>(Future<T> callback(SqliteReadContext tx), {Duration? lockTimeout, String? debugContext}) → Future<T>
Takes a read lock, without starting a transaction.
readTransaction<T>(Future<T> callback(SqliteReadContext tx), {Duration? lockTimeout}) → Future<T>
Open a read-only transaction.
refreshSchema() → Future<void>
Ensures that all connections are aware of the latest schema changes applied (if any). Queries and watch calls can potentially use outdated schema information after a schema update.
toString() → String
A string representation of this object.
inherited
watch(String sql, {List<Object?> parameters = const [], Duration? throttle = const Duration(milliseconds: 30), Iterable<String>? triggerOnTables}) → Stream<ResultSet>
Execute a read query every time the source tables are modified.
watchUnthrottled(String sql, {List<Object?> parameters = const [], Iterable<String>? triggerOnTables}) → Stream<ResultSet>
Like watch, but without a default throttle.
writeLock<T>(Future<T> callback(SqliteWriteContext tx), {Duration? lockTimeout, String? debugContext}) → Future<T>
Takes a global lock, without starting a transaction.
writeTransaction<T>(Future<T> callback(SqliteWriteContext tx), {Duration? lockTimeout}) → Future<T>
Open a read-write transaction.
override

Operators

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