pub struct Query {
pub statement: String,
pub data: Option<QueryData>,
pub db: Option<String>,
pub credentials: Option<(String, String)>,
pub format: Option<Format>,
pub compress_request: Option<Compression>,
pub compress_response: Option<Compression>,
}
Expand description
Query
A Query object is a complete representation of a query
Fields§
§statement: String
Statement (eg SELECT * FROM …)
data: Option<QueryData>
Data
db: Option<String>
Target DB
credentials: Option<(String, String)>
Credentials (username, password)
format: Option<Format>
Format
compress_request: Option<Compression>
Compress the request
compress_response: Option<Compression>
Compress the HTTP response
Implementations§
Source§impl Query
impl Query
Sourcepub fn bind_val(self, value: impl ChValue) -> Self
pub fn bind_val(self, value: impl ChValue) -> Self
Binds the statement with a ChValue
Query parameters are defined by ??
Sourcepub fn bind_str(self, value: &str) -> Self
pub fn bind_str(self, value: &str) -> Self
Binds the statement with a raw query value
For instance, strings are not enclosed by '
.
Query parameters are defined by ??
Sourcepub fn bind_val_list(self, values: Vec<Value>) -> Self
pub fn bind_val_list(self, values: Vec<Value>) -> Self
Binds the statement with a list of values
Sourcepub fn bind_str_list(self, values: Vec<&str>) -> Self
pub fn bind_str_list(self, values: Vec<&str>) -> Self
Binds the statement with a list of valeus as strings
Sourcepub fn credentials(self, username: &str, password: &str) -> Self
pub fn credentials(self, username: &str, password: &str) -> Self
Assigns the credentials
Sourcepub fn compress_request(self, compression: Compression) -> Self
pub fn compress_request(self, compression: Compression) -> Self
Compress the HTTP request
Eg. RowBinary
Sourcepub fn compress_response(self, compression: Compression) -> Self
pub fn compress_response(self, compression: Compression) -> Self
Compress the HTTP response
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnwindSafe for Query
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