(&self, sql: &str)
| 30 | #[async_trait] |
| 31 | impl QueryHandler for QueryHandlerImpl { |
| 32 | async fn query(&self, sql: &str) -> Result<DbResponse, PgSqliteError> { |
| 33 | match self { |
| 34 | QueryHandlerImpl::Direct(db) => { |
| 35 | db.query(sql).await |
| 36 | }, |
| 37 | QueryHandlerImpl::Routed(router) => { |
| 38 | // For routed queries, we need the session state to determine transaction status |
| 39 | // For now, we'll create a temporary session state - this needs to be refactored |
| 40 | let session = SessionState::new("temp".to_string(), "temp".to_string()); |
| 41 | router.execute_query(sql, &session).await |
| 42 | .map_err(|e| PgSqliteError::Protocol(e.to_string())) |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | async fn execute(&self, sql: &str) -> Result<DbResponse, PgSqliteError> { |
| 48 | match self { |
no test coverage detected