pub struct Query { /* private fields */ }
Implementations§
source§impl Query
impl Query
sourcepub fn new(query: impl Into<String>) -> Self
pub fn new(query: impl Into<String>) -> Self
Examples found in repository?
examples/simple_query.rs (line 4)
3 4 5 6 7 8 9 10 11 12 13 14
fn main() {
let result = Query::new("SELECT number FROM numbers(10)")
.option(option!("format", "TSVWithNames"))
.option(flag!("verbose"))
.exec()
.unwrap();
println!("Elapsed: {}", result.elapsed);
println!("Rows: {}", result.rows_read);
println!("Bytes: {}", result.bytes_read);
println!("Result:\n{}", result.to_string().unwrap());
}
sourcepub fn option(self, param: QueryOption) -> Self
pub fn option(self, param: QueryOption) -> Self
Examples found in repository?
examples/simple_query.rs (line 5)
3 4 5 6 7 8 9 10 11 12 13 14
fn main() {
let result = Query::new("SELECT number FROM numbers(10)")
.option(option!("format", "TSVWithNames"))
.option(flag!("verbose"))
.exec()
.unwrap();
println!("Elapsed: {}", result.elapsed);
println!("Rows: {}", result.rows_read);
println!("Bytes: {}", result.bytes_read);
println!("Result:\n{}", result.to_string().unwrap());
}
sourcepub fn exec(self) -> Option<QueryResult>
pub fn exec(self) -> Option<QueryResult>
Examples found in repository?
examples/simple_query.rs (line 7)
3 4 5 6 7 8 9 10 11 12 13 14
fn main() {
let result = Query::new("SELECT number FROM numbers(10)")
.option(option!("format", "TSVWithNames"))
.option(flag!("verbose"))
.exec()
.unwrap();
println!("Elapsed: {}", result.elapsed);
println!("Rows: {}", result.rows_read);
println!("Bytes: {}", result.bytes_read);
println!("Result:\n{}", result.to_string().unwrap());
}
Trait Implementations§
Auto Trait Implementations§
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