(
db: &Arc<DbHandler>,
session: &Arc<SessionState>,
query: &str,
params: &[rusqlite::types::Value],
fast_query: &crate::query::FastPathQuery,
)
| 2676 | } |
| 2677 | |
| 2678 | async fn try_statement_pool_execution( |
| 2679 | db: &Arc<DbHandler>, |
| 2680 | session: &Arc<SessionState>, |
| 2681 | query: &str, |
| 2682 | params: &[rusqlite::types::Value], |
| 2683 | fast_query: &crate::query::FastPathQuery, |
| 2684 | ) -> Result<crate::session::db_handler::DbResponse, PgSqliteError> { |
| 2685 | // Convert rusqlite values back to byte format for the statement pool methods |
| 2686 | let byte_params: Vec<Option<Vec<u8>>> = params.iter().map(|v| { |
| 2687 | match v { |
| 2688 | rusqlite::types::Value::Null => None, |
| 2689 | rusqlite::types::Value::Integer(i) => Some(i.to_string().into_bytes()), |
| 2690 | rusqlite::types::Value::Real(f) => Some(f.to_string().into_bytes()), |
| 2691 | rusqlite::types::Value::Text(s) => Some(s.clone().into_bytes()), |
| 2692 | rusqlite::types::Value::Blob(b) => Some(b.clone()), |
| 2693 | } |
| 2694 | }).collect(); |
| 2695 | |
| 2696 | // Only try statement pool for queries without decimal columns |
| 2697 | // (decimal queries need rewriting which complicates caching) |
| 2698 | match fast_query.operation { |
| 2699 | crate::query::FastPathOperation::Select => { |
| 2700 | db.query_with_statement_pool_params(query, &byte_params, &session.id) |
| 2701 | .await |
| 2702 | .map_err(|e| PgSqliteError::Protocol(e.to_string())) |
| 2703 | } |
| 2704 | _ => { |
| 2705 | db.execute_with_statement_pool_params(query, &byte_params, &session.id) |
| 2706 | .await |
| 2707 | .map_err(|e| PgSqliteError::Protocol(e.to_string())) |
| 2708 | } |
| 2709 | } |
| 2710 | } |
| 2711 | |
| 2712 | fn convert_parameter_to_value( |
| 2713 | bytes: &[u8], |
nothing calls this directly
no test coverage detected