DbModel class

The database model class to extend

Constructors

DbModel()

Properties

db Db
get the database
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
id int
The database id of the model instance [...]
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
table DbTable
get the table schema
read-only

Methods

fromDb(Map<String, dynamic> map) DbModel
The database row deserializer for the model [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
sqlCount({String where, bool verbose = false}) Future<int>
Count rows
sqlDelete({String where, bool verbose = false}) Future<void>
Delete an instance from the database
sqlInsert({bool verbose = false}) Future<int>
Insert a row in the database table
sqlInsertIfNotExists({bool verbose = false}) Future<int>
Insert a row in the database table if it does not exist already
@Deprecated("The insertIfNotExists function will be removed after version 4.4.0")
sqlJoin({int offset, int limit, String orderBy, String where, String groupBy, bool verbose = false}) Future<List>
Select rows in the database table with joins on foreign keys
sqlSelect({String where, String orderBy, int limit, int offset, String groupBy, bool verbose = false}) Future<List>
Select rows in the database table
sqlUpdate({bool verbose = false}) Future<void>
Update a row in the database table
sqlUpsert({bool verbose = false, List<String> preserveColumns = const <String>[]}) Future<void>
Upsert a row in the database table
toDb() Map<String, dynamic>
The database row serializer for the model [...]
toString() String
A string representation of this object. [...]
inherited

Operators

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