pub struct ReuseDriver { /* private fields */ }Implementations§
Source§impl ReuseDriver
impl ReuseDriver
pub fn new(inner: Arc<dyn DatabaseDriver>, db_type: &str) -> Self
Trait Implementations§
Source§impl DatabaseDriver for ReuseDriver
impl DatabaseDriver for ReuseDriver
fn driver_type(&self) -> DatabaseType
fn driver_category(&self) -> DriverCategory
fn quote_char(&self) -> char
fn skip_count_query(&self) -> bool
Source§fn supports_offset(&self) -> bool
fn supports_offset(&self) -> bool
Whether the driver’s SQL dialect supports
OFFSET in pagination.
Drivers that don’t (e.g. Presto/Hive via Superset) should return false.Source§fn supports_explain(&self) -> bool
fn supports_explain(&self) -> bool
Whether the driver supports EXPLAIN query plan analysis.
fn format_sql_literal(&self, value: &Option<Value>) -> String
fn build_update_sql( &self, table: &str, set_columns: &[(&str, Option<Value>)], pk_columns: &[(&str, Option<Value>)], ) -> String
fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ConnectionConfig,
) -> Pin<Box<dyn Future<Output = Result<ConnectionHandle, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn test_connection<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 ConnectionConfig,
) -> Pin<Box<dyn Future<Output = Result<ServerInfo, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 self,
handle: ConnectionHandle,
) -> Pin<Box<dyn Future<Output = Result<(), DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_databases<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_tables<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
database: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<TableInfo>, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_table_schema<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
table: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<TableSchema, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_columns<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
table: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<ColumnSchema>, Vec<String>), DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
sql: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<QueryResult, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn query_multi<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
sql: &'life2 str,
limit: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<MultiQueryResult, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn query_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
sql: &'life2 str,
limit: Option<u32>,
on_event: QueryStreamCallback,
) -> Pin<Box<dyn Future<Output = Result<(), DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn query_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
sql: &'life2 str,
limit: Option<u32>,
on_event: QueryStreamCallback,
) -> Pin<Box<dyn Future<Output = Result<(), DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Stream query results as row batches. Read more
fn query_with_params<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
sql: &'life2 str,
params: &'life3 [Value],
) -> Pin<Box<dyn Future<Output = Result<QueryResult, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
sql: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<u64, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn command_definitions(&self) -> Vec<DriverCommandDefinition>
fn command_definitions(&self) -> Vec<DriverCommandDefinition>
Return commands supported by this driver. Read more
Source§fn execute_command<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
command: &'life2 str,
input: Value,
) -> Pin<Box<dyn Future<Output = Result<CommandResult, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_command<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
command: &'life2 str,
input: Value,
) -> Pin<Box<dyn Future<Output = Result<CommandResult, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute a driver command. Read more
fn begin_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
) -> Pin<Box<dyn Future<Output = Result<TransactionHandle, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn commit<'life0, 'async_trait>(
&'life0 self,
tx: TransactionHandle,
) -> Pin<Box<dyn Future<Output = Result<(), DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn rollback<'life0, 'async_trait>(
&'life0 self,
tx: TransactionHandle,
) -> Pin<Box<dyn Future<Output = Result<(), DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn explain<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
sql: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<ExplainResult, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn cancel_query<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
) -> Pin<Box<dyn Future<Output = Result<(), DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_server_info<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
) -> Pin<Box<dyn Future<Output = Result<ServerInfo, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_server_info<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
) -> Pin<Box<dyn Future<Output = Result<ServerInfo, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch server version info using an existing connection handle.
Unlike
test_connection which creates a temporary pool, this reuses the live connection.Source§fn use_database<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
database: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn use_database<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
database: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Switch the active database for subsequent queries.
Drivers that maintain per-session state (e.g. Kiwi) should override this.
Source§fn prompt_overrides(&self) -> HashMap<PromptScenario, PromptTemplate>
fn prompt_overrides(&self) -> HashMap<PromptScenario, PromptTemplate>
Return driver-specific prompt overrides for AI features. Read more
Source§fn dump_table_ddl<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
table: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn dump_table_ddl<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
table: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Emit
CREATE TABLE DDL for a single table. Read moreSource§fn dump_database<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
database: &'life2 str,
opts: &'life3 BackupDumpOptions,
) -> Pin<Box<dyn Future<Output = Result<String, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn dump_database<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
database: &'life2 str,
opts: &'life3 BackupDumpOptions,
) -> Pin<Box<dyn Future<Output = Result<String, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Dump an entire database to SQL text. Read more
Source§fn restore_sql<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
sql: &'life2 str,
opts: Option<&'life3 BackupRestoreOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn restore_sql<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
sql: &'life2 str,
opts: Option<&'life3 BackupRestoreOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Restore a SQL dump by executing statements against the live connection. Read more
fn structure_capabilities<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
) -> Pin<Box<dyn Future<Output = Result<StructureCapabilities, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn plan_structure_changes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 ConnectionHandle,
request: &'life2 StructureChangeRequest,
) -> Pin<Box<dyn Future<Output = Result<StructureChangePlan, DriverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn quote_ident(&self, name: &str) -> String
Auto Trait Implementations§
impl !RefUnwindSafe for ReuseDriver
impl !UnwindSafe for ReuseDriver
impl Freeze for ReuseDriver
impl Send for ReuseDriver
impl Sync for ReuseDriver
impl Unpin for ReuseDriver
impl UnsafeUnpin for ReuseDriver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more