pub trait DatabaseProvider:
Send
+ Sync
+ 'static {
// Required methods
fn list_tables<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<TableInfo>, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_table_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
table: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TableSchema, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_rows<'life0, 'life1, 'async_trait>(
&'life0 self,
table: &'life1 str,
query: RowQuery,
) -> Pin<Box<dyn Future<Output = Result<RowsResponse, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn count_rows<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
table: &'life1 str,
query: &'life2 RowQuery,
) -> Pin<Box<dyn Future<Output = Result<CountResponse, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn execute_query<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<QueryResult, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Database provider trait for schema discovery and data access
Implementations of this trait provide database-specific logic for discovering schema information and fetching data.
Required Methods§
Sourcefn list_tables<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<TableInfo>, DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_tables<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<TableInfo>, DatabaseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all table names in the database
§Returns
A vector of table information, optionally including row counts