BoxerTableBase class abstract

Implementers

Constructors

BoxerTableBase()

Properties

batch Batch?
If batch not null, we will use it for calling the corresponding SQL Api of executor
getter/setter pair
cloneInstance BoxerTableBase?
no setter
createTableSpecification String?
Implement createTableSpecification to supply a table structure for conveniently creating table
no setter
database Database
Database or Transaction instance
getter/setter pair
executor DatabaseExecutor
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tableName String
Subclass-Override, supply the table name
no setter
transaction Transaction?
Database and Transaction implements DatabaseExecutor, Batch's implementation is based on Transaction Batch contains all SQL interfaces that DatabaseExecutor have, but with void return
getter/setter pair

Methods

clone() BoxerTableBase?
Usually subclass should implement clone() method for return a new instance returned by clone() This makes it easy to switch between doTransaction and doBatch operations, and keep the origin instance unchanged
createTableIfNeeded({Database? db, int? version}) Future<bool?>
delete({String? where, List<Object?>? whereArgs}) Future<int>
Delete
doBatch(void action(BoxerTableBase clone), {bool? exclusive}) Future<List<Object?>?>
Execute all sql in a batch(essentially transaction). See BoxerTableTranslator.resetWithItems for example usage
doTransaction<T>(Future<T?> action(BoxerTableBase clone), {bool? exclusive}) Future<T?>
Execute all sql in a transaction. See BoxerTableTranslator.resetWithItems for example usage
insert(Map<String, Object?> values, {ConflictAlgorithm? conflictAlgorithm, bool isReThrow = false}) Future<int>
Insert. Return the id of the last inserted row. 0 or -1 maybe returned if insert failed.
isTableExisted() Future<bool>
Check if current table existed
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onConfigure(Database db) Future<void>
Subclass-Override. When database configured
onCreate(Database db, int version) Future<void>
Subclass-Override. When database create, create table here
onDowngrade(Database db, int oldVersion, int newVersion) Future<void>
Subclass-Override. When database downgrade, update table field here
onOpen(Database db) Future<void>
Subclass-Override. When database opened, do some extra logic if you want
onUpgrade(Database db, int oldVersion, int newVersion) Future<void>
Subclass-Override. When database upgrade, update table field here
query({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?>>>
Query
resetAutoId() Future<void>
Reset auto increment ID.
select(List<String> columns, {String? where, List<Object?>? whereArgs, bool isUnique = false}) Future<Object?>
Select SQL
selectCount({String? where, List<Object?>? whereArgs}) Future<int?>
Number of rows in current table, null if result mismatch
selectMax(String column, {String? where, List<Object?>? whereArgs}) Future<Object?>
Select Max of column value
selectMin(String column, {String? where, List<Object?>? whereArgs}) Future<Object?>
Select Min of column value
toString() String
A string representation of this object.
inherited
update(Map<String, Object?> values, {String? where, List<Object?>? whereArgs, ConflictAlgorithm? conflictAlgorithm}) Future<int>
Update

Operators

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

Constants

SEPARATOR → const String