Struct sqlite::Connection [−][src]
pub struct Connection { /* fields omitted */ }
A database connection.
Methods
impl Connection
[src]
impl Connection
pub fn open<T: AsRef<Path>>(path: T) -> Result<Connection>
[src]
pub fn open<T: AsRef<Path>>(path: T) -> Result<Connection>
Open a connection to a new or existing database.
pub fn execute<T: AsRef<str>>(&self, statement: T) -> Result<()>
[src]
pub fn execute<T: AsRef<str>>(&self, statement: T) -> Result<()>
Execute a statement without processing the resulting rows if any.
pub fn iterate<T: AsRef<str>, F>(&self, statement: T, callback: F) -> Result<()> where
F: FnMut(&[(&str, Option<&str>)]) -> bool,
[src]
pub fn iterate<T: AsRef<str>, F>(&self, statement: T, callback: F) -> Result<()> where
F: FnMut(&[(&str, Option<&str>)]) -> bool,
Execute a statement and process the resulting rows as plain text.
The callback is triggered for each row. If the callback returns false
,
no more rows will be processed. For large queries and non-string data
types, prepared statement are highly preferable; see prepare
.
pub fn prepare<'l, T: AsRef<str>>(
&'l self,
statement: T
) -> Result<Statement<'l>>
[src]
pub fn prepare<'l, T: AsRef<str>>(
&'l self,
statement: T
) -> Result<Statement<'l>>
Create a prepared statement.
pub fn set_busy_handler<F>(&mut self, callback: F) -> Result<()> where
F: FnMut(usize) -> bool + Send + 'static,
[src]
pub fn set_busy_handler<F>(&mut self, callback: F) -> Result<()> where
F: FnMut(usize) -> bool + Send + 'static,
Set a callback for handling busy events.
The callback is triggered when the database cannot perform an operation
due to processing of some other request. If the callback returns true
,
the operation will be repeated.
pub fn set_busy_timeout(&mut self, milliseconds: usize) -> Result<()>
[src]
pub fn set_busy_timeout(&mut self, milliseconds: usize) -> Result<()>
Set an implicit callback for handling busy events that tries to repeat rejected operations until a timeout expires.
pub fn remove_busy_handler(&mut self) -> Result<()>
[src]
pub fn remove_busy_handler(&mut self) -> Result<()>
Remove the callback handling busy events.
pub fn as_raw(&self) -> *mut sqlite3
[src]
pub fn as_raw(&self) -> *mut sqlite3
Return the raw pointer.
Trait Implementations
impl Send for Connection
[src]
impl Send for Connection
impl Drop for Connection
[src]
impl Drop for Connection
Auto Trait Implementations
impl !Sync for Connection
impl !Sync for Connection