Database class
Database connection
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isClosed → bool
-
Return true if connection has been close otherwise false.
no setter
- native → PtrSqlite3
-
get access to native c pointer
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
attach(
String filename, String schemaName) → Future< void> - Attach an database with the current connection.
-
begin<
T extends Transaction> ({TransactionCreator< T> ? creator, Duration? timeout}) → Future<T> - Begin starts and returns a new transaction.
-
close(
) → Future< void> - Close invalidates and potentially stops any current prepared statements and transactions, marking this connection as no longer in use.
-
detach(
String schemaName) → Future< void> - Detach a database from the current conncetion.
-
exec(
String sql, {Iterable? parameters}) → Future< Changes> - Quick execution of sql query without holding any statment object.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
ping(
) → Future< void> - Ping verifies a connection to the database is still alive, establishing a connection if necessary.
-
prepare(
String query, [dynamic option]) → Future< Statement> - Returns a prepared statement for read or write.
-
query<
T> (String query, {Iterable? parameters, RowCreator< T> ? creator}) → Future<Rows< T> > - A wrapped method around statement to execute a statement select query
-
registerAggregate(
String name, AggregatorFunction af) → void -
Register aggregator function with the given
name
-
registerCollation(
String name, Comparator< String> comparator) → void -
Register collation
comparator
with the given name. -
registerCommitHook(
int callback()) → void - register a commit hook, it invoke when a commit occurred.
-
registerFunction(
String name, DatabaseFunction< PtrContext, dynamic> df) → void -
Register function
df.func
with the given name. -
registerRollbackHook(
void callback()) → void - register a rollback hook, it invoke when a rollback occurred.
-
registerUpdateHook(
UpdateHook callback) → void - register a update hook, it invoke when an update occurred.
-
setLimit(
int id, int val) → void - Set runtime limit. See https://www.sqlite.org/c3ref/limit.html
-
toString(
) → String -
A string representation of this object.
inherited
-
unregisterAggregate(
String name) → void -
Unregister aggregator function with the given
name
-
unregisterCollation(
String name) → void -
Unregister collation
name
-
unregisterCommitHook(
) → void - unregister a commit hook.
-
unregisterFunction(
String name) → void -
Unregister function of the given
name
. -
unregisterRollbackHook(
) → void - unregister a rollback hook.
-
unregisterUpdateHook(
) → void - unregister a update hook.
-
withNative(
Future< void> block(PtrSqlite3)) → Future<void> - Provide an access to c native pointer database in expose api is not enough.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited