BriteDatabase class
IBriteDatabase implementation.
Streaming database.
- Inheritance
-
- Object
- AbstractBriteDatabaseExecutor
- BriteDatabase
- Implemented types
- Available Extensions
Constructors
- BriteDatabase(Database _db, {BriteDatabaseLogger? logger = print})
-
Construct a BriteDatabase backed by a sqlite_api.Database.
To disable logging, pass
null
to logger.
Properties
- database → Database
-
Get the database.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isOpen → bool
-
Tell if the database is open, returns false once close has been called
no setteroverride
- logger → BriteDatabaseLogger?
-
Set to
null
to disable logging.final - path → String
-
The path of the database
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
batch(
) → IBriteBatch -
Creates a batch, used for performing multiple operation
in a single atomic operation.
inherited
-
close(
) → Future< void> -
Close the database. Cannot be accessed anymore
override
-
createQuery(
String table, {bool? distinct, List< String> ? columns, String? where, List<Object?> ? whereArgs, String? groupBy, String? having, String? orderBy, int? limit, int? offset}) → Stream<Query> -
Create an stream which will notify subscribers with a
Query
query for execution.override -
createRawQuery(
Iterable< String> tables, String sql, [List<Object?> ? arguments]) → Stream<Query> -
Like IBriteDatabase.createQuery.
override
-
delete(
String table, {String? where, List< Object?> ? whereArgs}) → Future<int> -
Convenience method for deleting rows in the database.
inherited
-
devInvokeMethod<
T> (String method, [Object? arguments]) → Future< T> -
testing only
override
-
devInvokeSqlMethod<
T> (String method, String sql, [List< Object?> ? arguments]) → Future<T> -
testing only
override
-
execute(
String sql, [List< Object?> ? arguments]) → Future<void> -
Execute an SQL query with no return value.
inherited
-
executeAndTrigger(
Iterable< String> tables, String sql, [List<Object?> ? arguments]) → Future<void> -
See execute
inherited
-
insert(
String table, JSON values, {String? nullColumnHack, ConflictAlgorithm? conflictAlgorithm}) → Future< int> -
This method helps insert a map of
values
into the specifiedtable
and returns the id of the last inserted row.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
query(
String table, {bool? distinct, List< String> ? columns, String? where, List<Object?> ? whereArgs, String? groupBy, String? having, String? orderBy, int? limit, int? offset}) → Future<List< JSON> > -
This is a helper to query a table and return the items found. All optional
clauses and filters are formatted as SQL queries
excluding the clauses' names.
inherited
-
queryCursor(
String table, {bool? distinct, List< String> ? columns, String? where, List<Object?> ? whereArgs, String? groupBy, String? having, String? orderBy, int? limit, int? offset, int? bufferSize}) → Future<QueryCursor> -
See DatabaseExecutor.rawQueryCursor for details about the argument
bufferSize
See DatabaseExecutor.query for the other arguments.inherited -
rawDelete(
String sql, [List< Object?> ? arguments]) → Future<int> -
Executes a raw SQL DELETE query and returns the
number of changes made.
inherited
-
rawDeleteAndTrigger(
Iterable< String> tables, String sql, [List<Object?> ? arguments]) → Future<int> -
See rawDelete
inherited
-
rawInsert(
String sql, [List< Object?> ? arguments]) → Future<int> -
Executes a raw SQL INSERT query and returns the last inserted row ID.
inherited
-
rawInsertAndTrigger(
Iterable< String> tables, String sql, [List<Object?> ? arguments]) → Future<int> -
See rawInsert
inherited
-
rawQuery(
String sql, [List< Object?> ? arguments]) → Future<List< JSON> > -
Executes a raw SQL SELECT query and returns a list
of the rows that were found.
inherited
-
rawQueryCursor(
String sql, List< Object?> ? arguments, {int? bufferSize}) → Future<QueryCursor> -
Executes a raw SQL SELECT with a cursor.
inherited
-
rawUpdate(
String sql, [List< Object?> ? arguments]) → Future<int> -
Executes a raw SQL UPDATE query and returns
the number of changes made.
inherited
-
rawUpdateAndTrigger(
Iterable< String> tables, String sql, [List<Object?> ? arguments]) → Future<int> -
See rawUpdate
inherited
-
readTransaction<
T> (Future< T> action(Transaction txn)) → Future<T> -
Read-only transaction (experimental, for now only supported in async_sqlite, use a normal transaction otherwise)
override
-
sendTableTrigger(
Iterable< String> tables) → void -
Override this method to send notifications
override
-
toString(
) → String -
A string representation of this object.
inherited
-
transaction<
T> (Future< T> action(Transaction txn), {bool? exclusive}) → Future<T> -
Calls in action must only be done using the transaction object
using the database will trigger a dead-lock.
override
-
transactionAndTrigger<
T> (Future< T> action(Transaction txn), {bool? exclusive}) → Future<T> -
Calls in action must only be done using the transaction object
using the database will trigger a dead-lock.
override
-
update(
String table, JSON values, {String? where, List< Object?> ? whereArgs, ConflictAlgorithm? conflictAlgorithm}) → Future<int> -
Convenience method for updating rows in the database. Returns
the number of changes made
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited