MCPcopy Create free account
hub / github.com/erans/pgsqlite / query

Method query

src/query/query_handler.rs:32–45  ·  view source on GitHub ↗
(&self, sql: &str)

Source from the content-addressed store, hash-verified

30#[async_trait]
31impl 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 {

Callers 1

analyze_select_paramsMethod · 0.45

Calls 1

execute_queryMethod · 0.45

Tested by

no test coverage detected