PostgresAdapter class
PostgreSQL database adapter.
Example usage:
final connection = await pg.Connection.open(
pg.Endpoint(
host: 'localhost',
database: 'mydb',
username: 'user',
password: 'password',
),
);
final adapter = PostgresAdapter(connection);
final prisma = PrismaClient(adapter: adapter);
- Implemented types
Constructors
- PostgresAdapter(Connection _connection, {ConnectionInfo? connectionInfo})
Properties
- adapterName → String
-
Adapter package name (e.g., '@prisma/adapter-pg')
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- provider → String
-
Database provider name (e.g., 'postgresql', 'mysql', 'sqlite')
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → Future< void> -
Close the connection and clean up resources
override
-
executeRaw(
SqlQuery query) → Future< int> -
Execute a raw SQL command and return affected row count
override
-
executeScript(
String script) → Future< void> -
Execute a SQL script (multiple statements)
override
-
getConnectionInfo(
) → ConnectionInfo? -
Get connection information (schema, capabilities, etc.)
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
queryRaw(
SqlQuery query) → Future< SqlResultSet> -
Execute a raw SQL query and return results
override
-
startTransaction(
[IsolationLevel? isolationLevel]) → Future< Transaction> -
Start a new database transaction
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited