pub fn execute_prepared(
connection: &Arc<Mutex<RawConnection<SyncStream>>>,
statement: &PreparedStatement,
params: &[Option<&[u8]>],
) -> Result<Vec<Row>>Expand description
Executes a prepared statement with parameters, collecting all rows.
Every parameter is bound as PostgreSQL binary. Values whose
ParamFormat is ParamFormat::Text — a scaled NUMERIC, a
geography — will be rejected by the server, because the bytes
ToSqlParam::encode_param produced for them are text. That combination is
unreachable from hyperdb-api, which streams through
RawConnection::start_execute_prepared_with_formats instead; if you are
calling this directly and need mixed formats, use
execute_prepared_no_result_with_formats or the streaming path.
§Errors
- Returns
Error(connection) if the connection mutex is poisoned. - Returns
Error(server) if the server rejectsBind/Execute(parameter type mismatch, constraint violation, etc.). - Returns
Error(I/O) /Error(closed) on wire-protocol I/O failure. - Propagates row-construction errors from
Row::newif aDataRowcannot be decoded against the prepared columns.