Rust

The adapter writes SQL with named placeholders (:_uid) and binds values with a PDO parameter type. PDO (ATTR_EMULATE_PREPARES) substitutes the placeholders client side with quoted literals and sends the statement as plain text with PQexec; with ATTR_STRINGIFY_FETCHES every fetched value is a string. Pdo reproduces that, so the server sees the same text and the adapter reads the same values:

Contents

use utopia_database::adapter::postgres::pdo::Executed;
Rust
pub struct Executed

A statement's result: what execute() returned, the rows and the row count.

use utopia_database::adapter::postgres::pdo::Pdo;
Rust
pub struct Pdo

The PDO handle: one connection.

use utopia_database::adapter::postgres::pdo::PdoError;
Rust
pub struct PdoError

A driver error (PDOException): its SQLSTATE, the driver's native code (errorInfo[1], 7 for server errors) and its message.

use utopia_database::adapter::postgres::pdo::Statement;
Rust
pub struct Statement

A prepared statement: SQL with named placeholders and bound values.

use utopia_database::adapter::postgres::pdo::ParamType;
Rust
pub enum ParamType

A PDO parameter type (PDO::PARAM_*).

use utopia_database::adapter::postgres::pdo::PdoFailure;
Rust
pub enum PdoFailure

A failed execute(): a driver error, or another exception (a value that cannot be converted to a string).

Also implements From.
use utopia_database::adapter::postgres::pdo::Rendering;
Rust
pub enum Rendering

Why a statement could not be rendered.

use utopia_database::adapter::postgres::pdo::error_of;
Rust
pub fn error_of(outcome: &Outcome, query: &[u8]) -> PdoError

The PDOException of a failed result (pdo_pgsql_error then pdo_handle_error).

use utopia_database::adapter::postgres::pdo::fetch;
Rust
pub fn fetch(oid: u32, value: Option<&Bytes>) -> Value

One fetched value (pgsql_stmt_get_col, then PDO's stringify).

use utopia_database::adapter::postgres::pdo::libpq_message;
Rust
pub fn libpq_message(outcome: &Outcome, query: &[u8]) -> String

The libpq message of an error result (PQresultErrorMessage), as pqBuildErrorMessage3 writes it with the default verbosity, for the query query it answered.

use utopia_database::adapter::postgres::pdo::quote;
Rust
pub fn quote(s: &[u8]) -> Option<Vec<u8>>

$pdo->quote($string) (PQescapeStringConn in quotes): None when the string, up to its first NUL, is not valid UTF-8.

use utopia_database::adapter::postgres::pdo::rows;
Rust
pub fn rows(outcome: &Outcome) -> Vec<Array>

The rows of a result as fetchAll(PDO::FETCH_ASSOC) returns them with ATTR_STRINGIFY_FETCHES.

use utopia_database::adapter::postgres::pdo::to_long;
Rust
pub fn to_long(value: &Value) -> i64

Undocumented.