Database class abstract

An opened sqlite3 database with dart:ffi.

See CommonDatabase for the methods that are available on both the FFI and the WebAssembly implementation.

Constructors

Database()

Properties

autocommit → bool
Checks whether the connection is in autocommit mode. The connection is in autocommit by default, except when inside a transaction.
no setterinherited
busyHandler ← bool Function(int count)?
Installs a function to invoke whenever an attempt is made to access a database table when another thread or process has the table locked.
no getterinherited
commitFilter ↔ VoidPredicate?
The VoidPredicate that is used to filter out transactions before commiting.
getter/setter pairinherited
commits → Stream<void>
An async stream that fires after each commit.
no setterinherited
config → DatabaseConfig
Configuration for the database connection.
no setterinherited
handle → Pointer<void>
The native database connection handle from sqlite.
no setter
hashCode → int
The hash code for this object.
no setterinherited
lastInsertRowId → int
The row id of the most recent successful insert statement on this database connection.
no setterinherited
rollbacks → Stream<void>
An async stream that fires after each rollback.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
updatedRows → int
The amount of rows inserted, updated or deleted by the last INSERT, UPDATE or DELETE statement, respectively.
no setterinherited
updates → Stream<SqliteUpdate>
An async stream of data changes happening on this database.
no setterinherited
updatesSync → Stream<SqliteUpdate>
A synchronous stream of data changes happening on this database.
no setterinherited
userVersion ↔ int
The application defined version of this database.
getter/setter pairinherited

Methods

backup(Database toDatabase, {int nPage = 5}) → Stream<double>
Create a backup of the current database (this) into another database (toDatabase) on memory or disk.
close() → void
Closes this database and releases associated resources.
inherited
createAggregateFunction<V>({required String functionName, required AggregateFunction<V> function, AllowedArgumentCount argumentCount = const AllowedArgumentCount.any(), bool deterministic = false, bool directOnly = true, bool subtype = false}) → void
Creates an application-defined aggregate function that can be used from sql queries sent against this database.
inherited
createCollation({required String name, required CollatingFunction function}) → void
Creates a collation that can be used from sql queries sent against this database.
inherited
createFunction({required String functionName, required ScalarFunction function, AllowedArgumentCount argumentCount = const AllowedArgumentCount.any(), bool deterministic = false, bool directOnly = true, bool subtype = false}) → void
Creates a scalar function that can be called from sql queries sent against this database.
inherited
dispose() → void
Closes this database and releases associated resources.
inherited
execute(String sql, [List<Object?> parameters = const []]) → void
Executes the sql statement(s) with the provided parameters, ignoring any rows returned by the statement(s).
inherited
getUpdatedRows() → int
The amount of rows affected by the last INSERT, UPDATE or DELETE statement.
inherited
leak() → Pointer<void>
Like handle, this returns the native sqlite3* pointer wrapped by this instance.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepare(String sql, {bool persistent = false, bool vtab = true, bool checkNoTail = false}) → PreparedStatement
Compiles the sql statement to execute it later.
prepareMultiple(String sql, {bool persistent = false, bool vtab = true}) → List<PreparedStatement>
Compiles multiple statements from sql to be executed later.
select(String sql, [List<Object?> parameters = const []]) → ResultSet
Prepares the sql statement and runs it with the provided parameters, returning all rows returned by the statement.
inherited
statementFromPointer({required Pointer<void> statement, required String sql, bool borrowed = false}) → PreparedStatement
Creates a Dart PreparedStatement instance from the underlying sqlite3_stmt pointer.
toString() → String
A string representation of this object.
inherited

Operators

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