Skip to main content

query

Function query 

Source
pub fn query(query: &str, buf: &mut BytesMut) -> Result<()>
Expand description

Writes a simple query message.

Executes a SQL query directly without using prepared statements. The server will respond with RowDescription, DataRow, CommandComplete, etc.

§Arguments

  • query - SQL query string (null-terminated)
  • buf - Buffer to write the message to

§Errors

Currently infallible — always returns Ok(()). The io::Result return type is preserved for forward compatibility.

§Panics

Panics via msg_len if query.len() exceeds i32::MAX bytes (PostgreSQL’s per-message cap).