pub struct MysqlConnection { /* private fields */ }Expand description
Wrapper around mysql::Conn providing interior mutability for the
SqlConnection trait (which requires &self).
Implementations§
Trait Implementations§
Source§impl SqlConnection for MysqlConnection
Available on crate feature sql-mysql only.
impl SqlConnection for MysqlConnection
Available on crate feature
sql-mysql only.fn query( &self, query_str: &str, params: &[Scalar], ) -> Result<SqlQueryResult, IoError>
fn execute_batch(&self, sql: &str) -> Result<(), IoError>
fn table_exists(&self, table_name: &str) -> Result<bool, IoError>
fn insert_rows( &self, insert_sql: &str, rows: &[Vec<Scalar>], ) -> Result<(), IoError>
fn dtype_sql(&self, dtype: DType) -> &'static str
fn index_dtype_sql(&self, index: &Index) -> &'static str
Source§fn dialect_name(&self) -> &'static str
fn dialect_name(&self) -> &'static str
Short identifier for this backend’s SQL dialect. Read more
Source§fn parameter_marker(&self, _ordinal: usize) -> String
fn parameter_marker(&self, _ordinal: usize) -> String
Return the bind marker for the one-based parameter ordinal. Read more
Source§fn supports_returning(&self) -> bool
fn supports_returning(&self) -> bool
Whether this backend honors
INSERT ... RETURNING ... natively. Read moreSource§fn max_param_count(&self) -> Option<usize>
fn max_param_count(&self) -> Option<usize>
Hard upper bound on bound-parameter count per statement, if known. Read more
Source§fn max_identifier_length(&self) -> Option<usize>
fn max_identifier_length(&self) -> Option<usize>
Maximum identifier length supported by the backend, or
None
when no documented limit exists (or the limit is irrelevant for
the deployment). Read moreSource§fn quote_identifier(&self, ident: &str) -> Result<String, IoError>
fn quote_identifier(&self, ident: &str) -> Result<String, IoError>
Quote a SQL identifier (table name, column name, schema name) for
safe inclusion in a generated statement. Read more
Source§fn list_tables(&self, _schema: Option<&str>) -> Result<Vec<String>, IoError>
fn list_tables(&self, _schema: Option<&str>) -> Result<Vec<String>, IoError>
List user-visible table names, optionally scoped to
schema. Read moreSource§fn query_column_dtypes(
&self,
_query: &str,
_params: &[Scalar],
) -> Result<Vec<Option<DType>>, IoError>
fn query_column_dtypes( &self, _query: &str, _params: &[Scalar], ) -> Result<Vec<Option<DType>>, IoError>
Return optional dtype hints for each result column in
query. Read moreSource§fn supports_paged_sql_chunks(&self) -> bool
fn supports_paged_sql_chunks(&self) -> bool
Whether
read_sql_chunks* may page this backend with a bounded
LIMIT/OFFSET wrapper instead of materializing the whole result
before the first chunk. Defaults to false so lightweight test
doubles and custom backends keep the legacy behavior until they opt in.Source§fn with_transaction<T, F>(&self, f: F) -> Result<T, IoError>
fn with_transaction<T, F>(&self, f: F) -> Result<T, IoError>
Run
f inside a transaction. The default impl runs f without
BEGIN/COMMIT — backends that support transactions should override
to wrap in their native transaction primitive (rusqlite BEGIN,
PostgreSQL BEGIN, MySQL START TRANSACTION, …). On Err
from f, transactional backends roll back; on Ok they commit. Read moreSource§fn supports_schemas(&self) -> bool
fn supports_schemas(&self) -> bool
Whether this backend exposes multi-schema namespacing. Read more
Source§fn default_schema(&self) -> Option<String>
fn default_schema(&self) -> Option<String>
Default schema for unqualified table references, if the backend
has one. Read more
Source§fn table_exists_in_schema(
&self,
table_name: &str,
_schema: Option<&str>,
) -> Result<bool, IoError>
fn table_exists_in_schema( &self, table_name: &str, _schema: Option<&str>, ) -> Result<bool, IoError>
Schema-aware table-existence check. Read more
Source§fn table_schema(
&self,
_table_name: &str,
_schema: Option<&str>,
) -> Result<Option<SqlTableSchema>, IoError>
fn table_schema( &self, _table_name: &str, _schema: Option<&str>, ) -> Result<Option<SqlTableSchema>, IoError>
Introspect a table’s column metadata, optionally schema-scoped. Read more
Source§fn list_schemas(&self) -> Result<Vec<String>, IoError>
fn list_schemas(&self) -> Result<Vec<String>, IoError>
List user-visible schemas (PostgreSQL “schemas”, MySQL “databases”). Read more
Source§fn server_version(&self) -> Result<Option<String>, IoError>
fn server_version(&self) -> Result<Option<String>, IoError>
Probe the backend server’s version string. Read more
Source§fn list_views(&self, _schema: Option<&str>) -> Result<Vec<String>, IoError>
fn list_views(&self, _schema: Option<&str>) -> Result<Vec<String>, IoError>
List user-visible view names, optionally scoped to
schema. Read moreSource§fn list_indexes(
&self,
_table_name: &str,
_schema: Option<&str>,
) -> Result<Vec<SqlIndexSchema>, IoError>
fn list_indexes( &self, _table_name: &str, _schema: Option<&str>, ) -> Result<Vec<SqlIndexSchema>, IoError>
List indexes defined on a table, optionally schema-scoped. Read more
Source§fn list_unique_constraints(
&self,
_table_name: &str,
_schema: Option<&str>,
) -> Result<Vec<SqlUniqueConstraintSchema>, IoError>
fn list_unique_constraints( &self, _table_name: &str, _schema: Option<&str>, ) -> Result<Vec<SqlUniqueConstraintSchema>, IoError>
List UNIQUE constraints declared on a table (inline or table-level),
excluding
CREATE UNIQUE INDEX indexes (those land in list_indexes). Read moreSource§fn table_comment(
&self,
_table_name: &str,
_schema: Option<&str>,
) -> Result<Option<String>, IoError>
fn table_comment( &self, _table_name: &str, _schema: Option<&str>, ) -> Result<Option<String>, IoError>
Probe the table-level comment, optionally schema-scoped. Read more
Source§fn list_foreign_keys(
&self,
_table_name: &str,
_schema: Option<&str>,
) -> Result<Vec<SqlForeignKeySchema>, IoError>
fn list_foreign_keys( &self, _table_name: &str, _schema: Option<&str>, ) -> Result<Vec<SqlForeignKeySchema>, IoError>
List foreign-key constraints declared on a table, optionally
schema-scoped. Read more
Auto Trait Implementations§
impl !Freeze for MysqlConnection
impl !RefUnwindSafe for MysqlConnection
impl !Sync for MysqlConnection
impl Send for MysqlConnection
impl Unpin for MysqlConnection
impl UnsafeUnpin for MysqlConnection
impl UnwindSafe for MysqlConnection
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