Expand description
tokio-postgres / deadpool-postgres adapter for NextSQL runtime.
Provides PooledPgClient which wraps a deadpool_postgres::Object
and implements the NextSQL Client trait.
Also re-exports the core tokio-postgres types from the runtime crate for convenience.
Structs§
- PgClient
- A wrapper around
tokio_postgres::Clientimplementing the NextSQLClienttrait. - PgRow
- PgTransaction
- A wrapper around
tokio_postgres::Transactionimplementing the NextSQLTransactiontrait. Supports nested transactions (savepoints) and commit/rollback. Drop without callingcommit()will rollback the transaction. - Pooled
PgClient - A wrapper around
deadpool_postgres::Objectimplementing the NextSQLClienttrait.
Enums§
- Owned
Param - An owned SQL parameter value. Used internally to convert borrowed
&dyn ToSqlParaminto owned values that can be moved into async futures.
Traits§
- Client
- Trait for executing SQL queries against a database.
Uses
impl Futureinstead of async_trait to avoid proc macro compile overhead. - Row
- Trait for reading typed values from a database result row.
- ToSql
Param - Trait for values that can be bound as SQL query parameters.
- Transaction
- Trait for a database transaction.
Supports the same query/execute operations as
Client, plus commit/rollback. Dropping without callingcommit()should rollback the transaction.
Functions§
- convert_
params - Convert a slice of borrowed params to a vec of owned params.
- owned_
params_ to_ refs - Convert a slice of
OwnedParamto a vec of trait-object references suitable for passing totokio_postgresquery methods. - to_
owned_ param - Convert a
&dyn ToSqlParamto an owned parameter value by downcasting.