pub struct DatabaseSqlConnection { /* private fields */ }Expand description
Concrete implementation of SqlConnection backed by sochdb_storage::Database.
This enables the SqlBridge to route parsed SQL AST operations to the
actual storage engine, making SELECT, INSERT, UPDATE, DELETE,
and DDL statements work against real persisted data.
§Transaction Model
The connection maintains an optional active write transaction. Read-only
operations (select, table_exists) use fast read-only transactions.
Write operations auto-begin a transaction if none is active.
Implementations§
Trait Implementations§
Source§impl SqlConnection for DatabaseSqlConnection
impl SqlConnection for DatabaseSqlConnection
Source§fn select(
&self,
table: &str,
columns: &[String],
where_clause: Option<&Expr>,
order_by: &[OrderByItem],
limit: Option<usize>,
offset: Option<usize>,
params: &[CoreSochValue],
) -> SqlResult<ExecutionResult>
fn select( &self, table: &str, columns: &[String], where_clause: Option<&Expr>, order_by: &[OrderByItem], limit: Option<usize>, offset: Option<usize>, params: &[CoreSochValue], ) -> SqlResult<ExecutionResult>
Execute a SELECT query
Source§fn insert(
&mut self,
table: &str,
columns: Option<&[String]>,
rows: &[Vec<Expr>],
_on_conflict: Option<&OnConflict>,
params: &[CoreSochValue],
) -> SqlResult<ExecutionResult>
fn insert( &mut self, table: &str, columns: Option<&[String]>, rows: &[Vec<Expr>], _on_conflict: Option<&OnConflict>, params: &[CoreSochValue], ) -> SqlResult<ExecutionResult>
Execute an INSERT
Source§fn update(
&mut self,
table: &str,
assignments: &[Assignment],
where_clause: Option<&Expr>,
params: &[CoreSochValue],
) -> SqlResult<ExecutionResult>
fn update( &mut self, table: &str, assignments: &[Assignment], where_clause: Option<&Expr>, params: &[CoreSochValue], ) -> SqlResult<ExecutionResult>
Execute an UPDATE
Source§fn delete(
&mut self,
table: &str,
where_clause: Option<&Expr>,
params: &[CoreSochValue],
) -> SqlResult<ExecutionResult>
fn delete( &mut self, table: &str, where_clause: Option<&Expr>, params: &[CoreSochValue], ) -> SqlResult<ExecutionResult>
Execute a DELETE
Source§fn create_table(&mut self, stmt: &CreateTableStmt) -> SqlResult<ExecutionResult>
fn create_table(&mut self, stmt: &CreateTableStmt) -> SqlResult<ExecutionResult>
Create a table
Source§fn drop_table(&mut self, stmt: &DropTableStmt) -> SqlResult<ExecutionResult>
fn drop_table(&mut self, stmt: &DropTableStmt) -> SqlResult<ExecutionResult>
Drop a table
Source§fn create_index(
&mut self,
_stmt: &CreateIndexStmt,
) -> SqlResult<ExecutionResult>
fn create_index( &mut self, _stmt: &CreateIndexStmt, ) -> SqlResult<ExecutionResult>
Create an index
Source§fn drop_index(&mut self, _stmt: &DropIndexStmt) -> SqlResult<ExecutionResult>
fn drop_index(&mut self, _stmt: &DropIndexStmt) -> SqlResult<ExecutionResult>
Drop an index
Source§fn alter_table(&mut self, stmt: &AlterTableStmt) -> SqlResult<ExecutionResult>
fn alter_table(&mut self, stmt: &AlterTableStmt) -> SqlResult<ExecutionResult>
Alter a table (add/drop/rename columns, rename table)
Source§fn commit(&mut self) -> SqlResult<ExecutionResult>
fn commit(&mut self) -> SqlResult<ExecutionResult>
Commit transaction
Source§fn rollback(&mut self, _savepoint: Option<&str>) -> SqlResult<ExecutionResult>
fn rollback(&mut self, _savepoint: Option<&str>) -> SqlResult<ExecutionResult>
Rollback transaction
Source§fn scan_all(
&self,
table: &str,
columns: &[String],
) -> SqlResult<Vec<HashMap<String, CoreSochValue>>>
fn scan_all( &self, table: &str, columns: &[String], ) -> SqlResult<Vec<HashMap<String, CoreSochValue>>>
Scan all rows from a table (no filter, no ordering).
Used for JOIN processing — each leaf table is scanned once,
then join logic is applied in-memory.
Source§fn eval_join_predicate(
&self,
expr: &Expr,
row: &HashMap<String, CoreSochValue>,
params: &[CoreSochValue],
) -> Option<bool>
fn eval_join_predicate( &self, expr: &Expr, row: &HashMap<String, CoreSochValue>, params: &[CoreSochValue], ) -> Option<bool>
Evaluate an expression against a merged row (used for JOIN ON conditions).
Returns true/false, or None if evaluation fails.
Auto Trait Implementations§
impl !RefUnwindSafe for DatabaseSqlConnection
impl !UnwindSafe for DatabaseSqlConnection
impl Freeze for DatabaseSqlConnection
impl Send for DatabaseSqlConnection
impl Sync for DatabaseSqlConnection
impl Unpin for DatabaseSqlConnection
impl UnsafeUnpin for DatabaseSqlConnection
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more