Skip to content

Bind-parameter support on PgReplicationConnection #78

Description

@LucaCappelletti94

PgReplicationConnection::exec(query: &str) in src/connection/libpq.rs calls PQexec, which has no parameter slot. Consumers that need to embed dynamic values (relation names, LSNs, slot names, snapshot IDs) must concatenate the SQL string and escape by hand, and any miss is a SQL injection. There is no safe alternative on the connection surface today.

I intend to add exec_with_params(sql: &str, params: &[&dyn ToSql]) -> Result<PgResult> that wraps libpq PQexecParams. paramTypes defaults to null so the server infers from values, paramFormats defaults to text, resultFormat defaults to text for parity with exec. Option<T> encodes SQL NULL. Existing exec stays untouched, the addition is purely additive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions