pub struct InMemorySqlEngine { /* private fields */ }Expand description
The in-memory SQLite engine.
Implementations§
Source§impl InMemorySqlEngine
impl InMemorySqlEngine
pub fn open() -> Result<Self, SqlQueryError>
Sourcepub fn interrupt_handle(&self) -> InterruptHandle
pub fn interrupt_handle(&self) -> InterruptHandle
Returns an interrupt handle that can cancel a running statement from another thread (used by the request-level timeout watchdog).
Sourcepub fn create_table(
&self,
label: &str,
schema: &TableSchema,
) -> Result<(), SqlQueryError>
pub fn create_table( &self, label: &str, schema: &TableSchema, ) -> Result<(), SqlQueryError>
Create a table with the given label and schema.
Sourcepub async fn insert_rows<S>(
&mut self,
label: &str,
schema: &TableSchema,
rows: Pin<Box<S>>,
max_rows: usize,
) -> Result<usize, SqlQueryError>
pub async fn insert_rows<S>( &mut self, label: &str, schema: &TableSchema, rows: Pin<Box<S>>, max_rows: usize, ) -> Result<usize, SqlQueryError>
Stream rows into label. Each row is a flat JSON object whose keys
match column names; missing or null keys become SQL NULL.
Sourcepub fn execute_select(
&self,
sql: &str,
bindings: &[BoundParam],
max_rows: usize,
) -> Result<QueryResult, SqlQueryError>
pub fn execute_select( &self, sql: &str, bindings: &[BoundParam], max_rows: usize, ) -> Result<QueryResult, SqlQueryError>
Run a SELECT with named bindings and a row cap.
Auto Trait Implementations§
impl !Freeze for InMemorySqlEngine
impl !RefUnwindSafe for InMemorySqlEngine
impl !Sync for InMemorySqlEngine
impl !UnwindSafe for InMemorySqlEngine
impl Send for InMemorySqlEngine
impl Unpin for InMemorySqlEngine
impl UnsafeUnpin for InMemorySqlEngine
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> 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