PostgresDatabase class

A PostgreSQL implementation of SqlDatabase using the postgres package.

This class allows you to perform standard SQL operations such as querying, inserting, updating, and deleting data in a PostgreSQL database using named parameters and Dart-friendly types.

Inheritance

Constructors

PostgresDatabase.new(DbConfig config)
Creates a PostgresDatabase with the provided config settings.

Properties

config DbConfig
Configuration settings for the database connection.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Closes the current PostgreSQL database connection.
override
connect() Future<void>
Opens a connection to the PostgreSQL database using the configured endpoint.
override
delete(String table, {required Map<String, dynamic> where}) Future<DbResult>
Deletes rows from the specified table based on the where clause.
override
insert(String table, Map<String, dynamic> data) Future<DbResult>
Inserts a new row into the specified table and returns the inserted data.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rawQuery(String query, {Map<String, dynamic>? values}) Future<DbResult>
Executes a raw SQL query with optional named parameters.
override
select(String table, {Map<String, dynamic>? where, int? limit, int? offset}) Future<DbResult>
Executes a SELECT query with optional WHERE, LIMIT, and OFFSET clauses.
inherited
toString() String
A string representation of this object.
inherited
update(String table, Map<String, dynamic> data, {required Map<String, dynamic> where}) Future<DbResult>
Updates matching rows in the table with the given data.
override

Operators

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