PostgresModel class abstract

Constructors

PostgresModel()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

migrations Map<Type, Function>
no setter

Static Methods

all<T extends Model>() Future<List<T>>
count<T extends Model>() Future<int>
create<T extends Model>(Map<String, dynamic> fromJson) Future<T?>
delete<T extends Model>({required int id}) Future<bool>
exists<T extends Model>({required int id}) Future<bool>
find<T extends Model>({required int id}) Future<T?>
findBy<T extends Model>({required String field, required dynamic value}) Future<T?>
findByUUID<T extends Model>(String uuid) Future<T?>
firstWhere<T extends Model>({required String field, String comp = "==", required dynamic value}) Future<T?>
index<T extends Model>() Future<List<T>>
jsonIndex<T extends Model>() Future<List<Map<String, dynamic>>>
migrate<T extends Model>({required T constructor(Map<String, dynamic>), Map<String, String>? columnDefinitions}) Future<void>
save<T extends Model>(T instance) Future<bool>
Saves instance (create or update).
truncate<T extends Model>() Future<bool>
update<T extends Model>({required dynamic id, required String field, required dynamic value}) Future<bool>
updateInstance<T extends Model>({required T instance, required Map<String, dynamic> withJson}) Future<bool>
where<T extends Model>({required String field, String comp = "==", required dynamic value}) Future<List<T>>