PostgresTable class

Contains Table methods such as select, insert, inserMany, update, delete, deleteAll, min, max, count, sum, avg, aggregate, group, join

Constructors

PostgresTable({required PostgreSQLConnection db, required String tableName})

Properties

db PostgreSQLConnection
final
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
final

Methods

aggregate(List<Aggregate> aggregates, {Where? where}) Future<DbResponse>
aggregate( [ Sum("amount", label: "totalAmount"), Avg("amount", label: "averageAmount"), Max("amount", label: "maxAmount", castToNumeric: true), Min("amount", label: "minAmount"), Count("amount"), ] ); aggregate([Sum("amount", label: "totalAmount")], where: Where("age",WhereOperator.isGreaterThan , 40));
avg(List<Avg> avg, {Where? where}) Future<DbResponse>
avg([Avg("amount",)]); avg([Acg("amount", label: "averageAmount")], where: Where("age",WhereOperator.isGreaterThan , 40));
count(List<Count> count, {Where? where}) Future<DbResponse>
count([Count("*")]); count([Count("*")], where: Where("age",WhereOperator.isGreaterThan , 40));
delete(Where where) Future<DbResponse>
deleteAll() Future<DbResponse>
getQuery({Where? where, OrderBy? orderBy, int? limit, List<String>? groupBy, String? label}) String
group({required List<String> groupBy, List<Column>? columns, List<Aggregate>? aggregates, Where? where, OrderBy? orderBy}) Future<DbResponse>
insert({required List values, List<String>? columns}) Future<DbResponse>
insertIfNonExisting({required List values, List<String>? columns, required Where where}) Future<DbResponse>
insertMany({required List<List> values, List<String>? columns}) Future<DbResponse>
insertManyIfNonExisting({required List<List> values, List<String>? columns, required List<String> where}) Future<DbResponse>
join({List<Column> columns = const [], required List<Join> joins, String? tableAs, Where? where, OrderBy? orderBy, int? limit}) Future<DbResponse>
max(List<Max> max, {Where? where}) Future<DbResponse>
max([Max("amount", label: "maxAmount")]); max([Max("amount", label: "maxAmount"), Min("age", label: "maxAge"),], where: Where("age",WhereOperator.isGreaterThan , 40));
min(List<Min> min, {Where? where}) Future<DbResponse>
min([Min("amount", label: "minAmount")]); min([Min("amount", label: "minAmount"), Min("age", label: "minAge"),], where: Where("age",WhereOperator.isGreaterThan , 40));
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
select({Where? where, OrderBy? orderBy, List<Column> columns = const [], bool distinct = false, int? limit}) Future<DbResponse>
sum(List<Sum> sum, {Where? where}) Future<DbResponse>
sum([Sum("amount",)]); sum([Sum("amount", label: "totalAmount")], where: Where("age",WhereOperator.isGreaterThan , 40));
toString() String
A string representation of this object.
inherited
update({required Map<String, dynamic> update, required Where? where}) Future<DbResponse>
update( update: { "column1": "new value", "age": 60 }, where: Where("id", WhereOperator.isEqual, 12) );

Operators

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