(
framed: &mut Framed<T, crate::protocol::PostgresCodec>,
db: &Arc<DbHandler>,
session: &Arc<SessionState>,
query: &str,
query_router: Option<&Arc<QueryRouter>>
| 2304 | } |
| 2305 | |
| 2306 | async fn execute_generic<T>( |
| 2307 | framed: &mut Framed<T, crate::protocol::PostgresCodec>, |
| 2308 | db: &Arc<DbHandler>, |
| 2309 | session: &Arc<SessionState>, |
| 2310 | query: &str, |
| 2311 | query_router: Option<&Arc<QueryRouter>>, |
| 2312 | ) -> Result<(), PgSqliteError> |
| 2313 | where |
| 2314 | T: tokio::io::AsyncRead + tokio::io::AsyncWrite + Unpin + Send, |
| 2315 | { |
| 2316 | // Try to execute as a simple statement |
| 2317 | if let Some(router) = query_router { |
| 2318 | router.execute_query(query, session).await.map_err(|e| PgSqliteError::Protocol(e.to_string()))?; |
| 2319 | } else { |
| 2320 | let cached_conn = Self::get_or_cache_connection(session, db).await; |
| 2321 | db.execute_with_session_cached(query, &session.id, cached_conn.as_ref()).await?; |
| 2322 | } |
| 2323 | |
| 2324 | framed.send(BackendMessage::CommandComplete { tag: "OK".to_string() }).await |
| 2325 | .map_err(PgSqliteError::Io)?; |
| 2326 | |
| 2327 | Ok(()) |
| 2328 | } |
| 2329 | |
| 2330 | /// Optimized batch sending of data rows with intelligent batching |
| 2331 | async fn send_data_rows_batched<T>( |
nothing calls this directly
no test coverage detected