pdo
ModuleThe 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
text (mysql_real_query, multi statements allowed); with
ATTR_STRINGIFY_FETCHES every fetched value is a string. Pdo
reproduces that over mysql_async's text protocol, so the server sees
the same bytes and the adapter reads the same values:
Contents
use utopia_database::adapter::mariadb::pdo::Config;pub struct ConfigUndocumented.
use utopia_database::adapter::mariadb::pdo::Executed;pub struct ExecutedA statement's result: what execute() returned, the rows and the row count.
use utopia_database::adapter::mariadb::pdo::Pdo;pub struct PdoThe PDO handle: one connection.
use utopia_database::adapter::mariadb::pdo::PdoError;pub struct PdoErrorA driver error (PDOException): its SQLSTATE, the driver's native code
(errorInfo[1]) and its message.
use utopia_database::adapter::mariadb::pdo::Statement;pub struct StatementA prepared statement: SQL with named placeholders and bound values.
use utopia_database::adapter::mariadb::pdo::ParamType;pub enum ParamTypeA PDO parameter type (PDO::PARAM_*).
use utopia_database::adapter::mariadb::pdo::PdoFailure;pub enum PdoFailureA failed execute(): a driver error, or another exception (a value
that cannot be converted to a string).
From.use utopia_database::adapter::mariadb::pdo::Rendering;pub enum RenderingWhy a statement could not be rendered.
use utopia_database::adapter::mariadb::pdo::quote;pub fn quote(s: &[u8]) -> Vec<u8>$pdo->quote($string): the string in single quotes, escaped by
mysqlnd_cset_escape_slashes for utf8mb4.
use utopia_database::adapter::mariadb::pdo::to_long;pub fn to_long(value: &Value) -> i64Undocumented.