DbModel class
The database model class to extend
Constructors
- DbModel()
Properties
- db → Db?
-
get the database
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ int?
-
The database id of the model instance
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- table → DbTable?
-
get the table schema
no setter
Methods
-
fromDb(
Map< String, dynamic> map) → DbModel? - The database row deserializer for the model
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent 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
-
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, String? indexColumn, 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