DatabaseExecutor class abstract
Common API for Database and Transaction to execute SQL commands
Each method runs a single SQL statement. Pass values as arguments
(? placeholders with arguments or whereArgs), never by string
interpolation in the SQL. Supported value types are int, num,
String, Uint8List and null (store a bool as 0/1, a DateTime as
an int or a String).
Inside Database.transaction, use the Transaction object, never the Database (deadlock).
- Implementers
- Available extensions
Constructors
Properties
Methods
-
batch(
) → Batch - Creates a batch, used for performing multiple operation in a single atomic operation.
-
delete(
String table, {String? where, List< Object?> ? whereArgs}) → Future<int> - Convenience method for deleting rows in the database.
-
execute(
String sql, [List< Object?> ? arguments]) → Future<void> - Executes a single SQL statement with no return value.
-
getVersion(
) → Future< int> -
Available on DatabaseExecutor, provided by the SqfliteDatabaseExecutorExt extension
Get the database inner version -
insert(
String table, Map< String, Object?> values, {String? nullColumnHack, ConflictAlgorithm? conflictAlgorithm}) → Future<int> -
This method helps insert a map of
valuesinto the specifiedtableand returns the id of the last inserted row. -
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< Map< >String, Object?> > - 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.
-
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
bufferSizeSee DatabaseExecutor.query for the other arguments. -
queryIterate(
String table, {bool? distinct, List< String> ? columns, String? where, List<Object?> ? whereArgs, String? groupBy, String? having, String? orderBy, int? limit, int? offset, int? bufferSize, required SqfliteCursorRowCallback onRow}) → Future<void> -
Available on DatabaseExecutor, provided by the SqfliteDatabaseExecutorIterateExt extension
Iterate over the results of a query. -
rawDelete(
String sql, [List< Object?> ? arguments]) → Future<int> - Executes a raw SQL DELETE query and returns the number of changes made.
-
rawInsert(
String sql, [List< Object?> ? arguments]) → Future<int> - Executes a raw SQL INSERT query and returns the last inserted row ID.
-
rawQuery(
String sql, [List< Object?> ? arguments]) → Future<List< Map< >String, Object?> > - Executes a raw SQL SELECT query and returns a list of the rows that were found.
-
rawQueryCursor(
String sql, List< Object?> ? arguments, {int? bufferSize}) → Future<QueryCursor> - Executes a raw SQL SELECT with a cursor.
-
rawQueryIterate(
String sql, List< Object?> ? arguments, {int? bufferSize, required SqfliteCursorRowCallback onRow}) → Future<void> -
Available on DatabaseExecutor, provided by the SqfliteDatabaseExecutorIterateExt extension
Iterate over the results of a raw query. -
rawUpdate(
String sql, [List< Object?> ? arguments]) → Future<int> - Executes a raw SQL UPDATE query and returns the number of changes made.
-
setVersion(
int version) → Future< void> -
Available on DatabaseExecutor, provided by the SqfliteDatabaseExecutorExt extension
Set the database inner version Used internally for open helpers and automatic versioning -
toString(
) → String -
A string representation of this object.
inherited
-
update(
String table, Map< String, Object?> values, {String? where, List<Object?> ? whereArgs, ConflictAlgorithm? conflictAlgorithm}) → Future<int> - Convenience method for updating rows in the database. Returns the number of changes made
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited