| 6 | /// Trait for handling database queries - can be implemented by DbHandler or QueryRouter |
| 7 | #[async_trait] |
| 8 | pub trait QueryHandler: Send + Sync { |
| 9 | /// Execute a SELECT query |
| 10 | async fn query(&self, sql: &str) -> Result<DbResponse, PgSqliteError>; |
| 11 | |
| 12 | /// Execute a DML/DDL query |
| 13 | async fn execute(&self, sql: &str) -> Result<DbResponse, PgSqliteError>; |
| 14 | |
| 15 | /// Get schema type information |
| 16 | async fn get_schema_type(&self, table: &str, column: &str) -> Result<Option<String>, PgSqliteError>; |
| 17 | |
| 18 | /// Check if using connection pooling |
| 19 | fn is_pooling_enabled(&self) -> bool { |
| 20 | false |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | /// Wrapper enum to hold either a DbHandler or QueryRouter |
| 25 | pub enum QueryHandlerImpl { |
nothing calls this directly
no outgoing calls
no test coverage detected