pub struct SqliteBackend {
pub read_only: bool,
/* private fields */
}Expand description
SQLite file-based database backend.
Fields§
§read_only: boolImplementations§
Source§impl SqliteBackend
impl SqliteBackend
Sourcepub async fn new(config: &DatabaseConfig) -> Result<Self, AppError>
pub async fn new(config: &DatabaseConfig) -> Result<Self, AppError>
Creates a new SQLite backend from configuration.
§Errors
Returns AppError::Connection if the database file cannot be opened.
Trait Implementations§
Source§impl Clone for SqliteBackend
impl Clone for SqliteBackend
Source§fn clone(&self) -> SqliteBackend
fn clone(&self) -> SqliteBackend
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl DatabaseBackend for SqliteBackend
impl DatabaseBackend for SqliteBackend
Source§async fn list_databases(&self) -> Result<Vec<String>, AppError>
async fn list_databases(&self) -> Result<Vec<String>, AppError>
Lists all accessible databases.
Source§async fn list_tables(&self, _database: &str) -> Result<Vec<String>, AppError>
async fn list_tables(&self, _database: &str) -> Result<Vec<String>, AppError>
Lists all tables in a database.
Source§async fn get_table_schema(
&self,
_database: &str,
table: &str,
) -> Result<Value, AppError>
async fn get_table_schema( &self, _database: &str, table: &str, ) -> Result<Value, AppError>
Returns column definitions for a table.
Source§async fn get_table_schema_with_relations(
&self,
database: &str,
table: &str,
) -> Result<Value, AppError>
async fn get_table_schema_with_relations( &self, database: &str, table: &str, ) -> Result<Value, AppError>
Returns column definitions with foreign key relationships.
Source§async fn execute_query(
&self,
sql: &str,
_database: Option<&str>,
) -> Result<Value, AppError>
async fn execute_query( &self, sql: &str, _database: Option<&str>, ) -> Result<Value, AppError>
Executes a SQL query and returns rows as a JSON array.
Auto Trait Implementations§
impl Freeze for SqliteBackend
impl !RefUnwindSafe for SqliteBackend
impl Send for SqliteBackend
impl Sync for SqliteBackend
impl Unpin for SqliteBackend
impl UnsafeUnpin for SqliteBackend
impl !UnwindSafe for SqliteBackend
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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