mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-03-15 06:20:50 +00:00
Always succeed when calling Statement::cursor
This commit is contained in:
parent
fd9c9a0a25
commit
22aea1100f
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "sqlite"
|
||||
version = "0.19.1"
|
||||
version = "0.19.2"
|
||||
authors = ["Ivan Ukhov <ivan.ukhov@gmail.com>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/stainless-steel/sqlite"
|
||||
|
@ -54,7 +54,7 @@ use sqlite::Value;
|
||||
|
||||
let mut cursor = connection.prepare("
|
||||
SELECT * FROM users WHERE age > ?
|
||||
").unwrap().cursor().unwrap();
|
||||
").unwrap().cursor();
|
||||
|
||||
cursor.bind(&[Value::Integer(50)]).unwrap();
|
||||
|
||||
|
@ -52,6 +52,6 @@ impl<'l> Cursor<'l> {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn new<'l>(statement: Statement<'l>) -> Result<Cursor<'l>> {
|
||||
Ok(Cursor { state: None, values: None, statement: statement })
|
||||
pub fn new<'l>(statement: Statement<'l>) -> Cursor<'l> {
|
||||
Cursor { state: None, values: None, statement: statement }
|
||||
}
|
||||
|
@ -68,7 +68,7 @@
|
||||
//!
|
||||
//! let mut cursor = connection.prepare("
|
||||
//! SELECT * FROM users WHERE age > ?
|
||||
//! ").unwrap().cursor().unwrap();
|
||||
//! ").unwrap().cursor();
|
||||
//!
|
||||
//! cursor.bind(&[Value::Integer(50)]).unwrap();
|
||||
//!
|
||||
|
@ -103,7 +103,7 @@ impl<'l> Statement<'l> {
|
||||
|
||||
/// Upgrade to a cursor.
|
||||
#[inline]
|
||||
pub fn cursor(self) -> Result<Cursor<'l>> {
|
||||
pub fn cursor(self) -> Cursor<'l> {
|
||||
::cursor::new(self)
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ fn connection_set_busy_handler() {
|
||||
fn cursor() {
|
||||
let connection = setup(":memory:");
|
||||
let statement = "SELECT id, name FROM users WHERE id = ?";
|
||||
let mut cursor = ok!(connection.prepare(statement)).cursor().unwrap();
|
||||
let mut cursor = ok!(connection.prepare(statement)).cursor();
|
||||
|
||||
ok!(cursor.bind(&[Value::Integer(1)]));
|
||||
assert_eq!(ok!(ok!(cursor.next())), &[Value::Integer(1), Value::String("Alice".to_string())]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user