Skip to main content

Crate nextsql_tokio_postgres_adapter

Crate nextsql_tokio_postgres_adapter 

Source
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::Client implementing the NextSQL Client trait.
PgRow
PgTransaction
A wrapper around tokio_postgres::Transaction implementing the NextSQL Transaction trait. Supports nested transactions (savepoints) and commit/rollback. Drop without calling commit() will rollback the transaction.
PooledPgClient
A wrapper around deadpool_postgres::Object implementing the NextSQL Client trait.

Enums§

OwnedParam
An owned SQL parameter value. Used internally to convert borrowed &dyn ToSqlParam into owned values that can be moved into async futures.

Traits§

Client
Trait for executing SQL queries against a database. Uses impl Future instead of async_trait to avoid proc macro compile overhead.
Row
Trait for reading typed values from a database result row.
ToSqlParam
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 calling commit() 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 OwnedParam to a vec of trait-object references suitable for passing to tokio_postgres query methods.
to_owned_param
Convert a &dyn ToSqlParam to an owned parameter value by downcasting.