pub struct Connection<'a> { /* private fields */ }
Expand description
A connection to a database backend.
This is a wrapper around the actual connection to the database.
Implementations§
Trait Implementations§
Source§impl Debug for Connection<'_>
impl Debug for Connection<'_>
Source§impl Display for Connection<'_>
impl Display for Connection<'_>
Source§impl Drop for Connection<'_>
impl Drop for Connection<'_>
Source§impl GeekConnection for Connection<'_>
impl GeekConnection for Connection<'_>
Source§type Connection = Connection<'_>
type Connection = Connection<'_>
Native Connection
Source§async fn create_table<T>(connection: &Self::Connection) -> Result<(), Error>
async fn create_table<T>(connection: &Self::Connection) -> Result<(), Error>
Create a table in the database
Source§async fn batch(connection: &Self::Connection, query: Query) -> Result<(), Error>
async fn batch(connection: &Self::Connection, query: Query) -> Result<(), Error>
Execute a batch query on the database and do not return any rows
Source§async fn query<T>(
connection: &Self::Connection,
query: Query,
) -> Result<Vec<T>, Error>where
T: DeserializeOwned,
async fn query<T>(
connection: &Self::Connection,
query: Query,
) -> Result<Vec<T>, Error>where
T: DeserializeOwned,
Query the database with an active Connection and Query
Source§async fn execute(
connection: &Self::Connection,
query: Query,
) -> Result<(), Error>
async fn execute( connection: &Self::Connection, query: Query, ) -> Result<(), Error>
Execute a query on the database and do not return any rows
Source§async fn row_count(
connection: &Self::Connection,
query: Query,
) -> Result<i64, Error>
async fn row_count( connection: &Self::Connection, query: Query, ) -> Result<i64, Error>
Run a SELECT Count query on the database and return the number of rows
Source§async fn query_raw(
connection: &Self::Connection,
query: Query,
) -> Result<Vec<HashMap<String, Value>>, Error>
async fn query_raw( connection: &Self::Connection, query: Query, ) -> Result<Vec<HashMap<String, Value>>, Error>
Query the database with an active Connection and Query and return a list of GeekORM Values.
Source§async fn query_first<T>(
connection: &Self::Connection,
query: Query,
) -> Result<T, Error>where
T: DeserializeOwned,
async fn query_first<T>(
connection: &Self::Connection,
query: Query,
) -> Result<T, Error>where
T: DeserializeOwned,
Query the database with an active Connection and Query and return the first row. Read more
Source§async fn table_names(
connection: &Self::Connection,
) -> Result<Vec<String>, Error>
async fn table_names( connection: &Self::Connection, ) -> Result<Vec<String>, Error>
Get Table Names
Source§async fn pragma_info(
connection: &Self::Connection,
table: &str,
) -> Result<Vec<TableInfo>, Error>
async fn pragma_info( connection: &Self::Connection, table: &str, ) -> Result<Vec<TableInfo>, Error>
Pragma table info
Auto Trait Implementations§
impl<'a> !Freeze for Connection<'a>
impl<'a> !RefUnwindSafe for Connection<'a>
impl<'a> !Send for Connection<'a>
impl<'a> !Sync for Connection<'a>
impl<'a> Unpin for Connection<'a>
impl<'a> !UnwindSafe for Connection<'a>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request