Skip to main content

ReuseDriver

Struct ReuseDriver 

Source
pub struct ReuseDriver { /* private fields */ }

Implementations§

Source§

impl ReuseDriver

Source

pub fn new(inner: Arc<dyn DatabaseDriver>, db_type: &str) -> Self

Trait Implementations§

Source§

impl DatabaseDriver for ReuseDriver

Source§

fn driver_type(&self) -> DatabaseType

Source§

fn driver_category(&self) -> DriverCategory

Source§

fn quote_char(&self) -> char

Source§

fn skip_count_query(&self) -> bool

Source§

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

Whether the driver supports EXPLAIN query plan analysis.
Source§

fn format_sql_literal(&self, value: &Option<Value>) -> String

Source§

fn build_update_sql( &self, table: &str, set_columns: &[(&str, Option<Value>)], pk_columns: &[(&str, Option<Value>)], ) -> String

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Stream query results as row batches. Read more
Source§

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,

Source§

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>

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,

Execute a driver command. Read more
Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

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,

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>

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,

Emit CREATE TABLE DDL for a single table. Read more
Source§

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,

Restore a SQL dump by executing statements against the live connection. Read more
Source§

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,

Source§

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,

Source§

fn quote_ident(&self, name: &str) -> String

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.