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.

Inheritance

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
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
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
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.
createAggregateFunction<V>({required String functionName, required AggregateFunction<V> function, AllowedArgumentCount argumentCount = const AllowedArgumentCount.any(), bool deterministic = false, bool directOnly = true}) → 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}) → 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 with the provided parameters, ignoring any rows returned by the statement.
inherited
getUpdatedRows() int
The amount of rows affected by the last INSERT, UPDATE or DELETE statement.
inherited
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.
override
prepareMultiple(String sql, {bool persistent = false, bool vtab = true}) List<PreparedStatement>
Compiles multiple statements from sql to be executed later.
override
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
toString() String
A string representation of this object.
inherited

Operators

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