pub trait Query {
type Arguments;
type Result;
// Required methods
fn execute(
self,
client: &SpiClient<'_>,
limit: Option<c_long>,
arguments: Self::Arguments
) -> Self::Result;
fn open_cursor<'c: 'cc, 'cc>(
self,
client: &'cc SpiClient<'c>,
args: Self::Arguments
) -> SpiCursor<'c>;
}
Expand description
A generalized interface to what constitutes a query
Its primary purpose is to abstract away differences between one-off statements and prepared statements, but it can potentially be implemented for other types, provided they can be converted into a query.
Required Associated Types§
Required Methods§
sourcefn execute(
self,
client: &SpiClient<'_>,
limit: Option<c_long>,
arguments: Self::Arguments
) -> Self::Result
fn execute( self, client: &SpiClient<'_>, limit: Option<c_long>, arguments: Self::Arguments ) -> Self::Result
Execute a query given a client and other arguments
sourcefn open_cursor<'c: 'cc, 'cc>(
self,
client: &'cc SpiClient<'c>,
args: Self::Arguments
) -> SpiCursor<'c>
fn open_cursor<'c: 'cc, 'cc>( self, client: &'cc SpiClient<'c>, args: Self::Arguments ) -> SpiCursor<'c>
Open a cursor for the query
Implementations on Foreign Types§
source§impl<'a> Query for &'a str
impl<'a> Query for &'a str
source§fn execute(
self,
_client: &SpiClient<'_>,
limit: Option<c_long>,
arguments: Self::Arguments
) -> Self::Result
fn execute( self, _client: &SpiClient<'_>, limit: Option<c_long>, arguments: Self::Arguments ) -> Self::Result
Panics
This function will panic if somehow the specified query contains a null byte.