Skip to main content

Crate qail_pg

Crate qail_pg 

Source
Expand description

QAIL Postgres Driver.

qail-pg executes qail-core AST commands through the native PostgreSQL wire protocol. It owns connection I/O, TLS, authentication, pooling, prepared AST execution, pipeline execution, COPY, LISTEN/NOTIFY, and PostgreSQL type conversion.

The normal application path is:

qail_core::Qail AST -> qail_pg::PgDriver/PgPool -> PostgreSQL wire protocol

SQL text may still appear in debugging, EXPLAIN output, or server-side PostgreSQL parse/plan behavior, but application code should build Qail commands instead of concatenating SQL strings.

use qail_core::prelude::*;
use qail_pg::PgDriver;

let mut driver = PgDriver::connect("localhost", 5432, "user", "db").await?;
let cmd = Qail::get("users").columns(["id", "email"]).limit(10);
let rows = driver.fetch_all(&cmd).await?;

Re-exports§

pub use driver::explain;
pub use driver::AstPipelineMode;
pub use driver::AuthSettings;
pub use driver::AutoCountPath;
pub use driver::AutoCountPlan;
pub use driver::ConnectOptions;
pub use driver::EnterpriseAuthMechanism;
pub use driver::GssEncMode;
pub use driver::GssTokenProvider;
pub use driver::GssTokenProviderEx;
pub use driver::GssTokenRequest;
pub use driver::IdentifySystem;
pub use driver::Notification;
pub use driver::PgBytesRow;
pub use driver::PgConnection;
pub use driver::PgDriver;
pub use driver::PgDriverBuilder;
pub use driver::PgError;
pub use driver::PgPool;
pub use driver::PgResult;
pub use driver::PgRow;
pub use driver::PgServerError;
pub use driver::PoolConfig;
pub use driver::PoolStats;
pub use driver::PooledConnection;
pub use driver::PreparedAstQuery;
pub use driver::QailRow;
pub use driver::QueryResult;
pub use driver::ReplicationKeepalive;
pub use driver::ReplicationOption;
pub use driver::ReplicationSlotInfo;
pub use driver::ReplicationStreamMessage;
pub use driver::ReplicationStreamStart;
pub use driver::ReplicationXLogData;
pub use driver::ResultFormat;
pub use driver::ScopedPoolFuture;
pub use driver::ScramChannelBindingMode;
pub use driver::TlsConfig;
pub use driver::TlsMode;
pub use driver::scope;
pub use driver::spawn_pool_maintenance;
pub use protocol::PgEncoder;
pub use types::Cidr;
pub use types::Date;
pub use types::FromPg;
pub use types::Inet;
pub use types::Json;
pub use types::MacAddr;
pub use types::Numeric;
pub use types::Time;
pub use types::Timestamp;
pub use types::ToPg;
pub use types::TypeError;
pub use types::Uuid;

Modules§

driver
PostgreSQL Driver Module (Layer 3: Async I/O)
protocol
PostgreSQL Wire Protocol (Layer 2: Pure, Sync)
types
Type conversion traits and implementations for PostgreSQL types.

Functions§

rls_sql_with_timeout
Generate the RLS SQL string for pipelined execution.
rls_sql_with_timeouts
Generate the RLS SQL string with both statement and lock timeouts.