mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-03-15 06:20:50 +00:00
Fix the reading of string data
This commit is contained in:
parent
a6de11a000
commit
26626fdeeb
@ -199,7 +199,7 @@ impl Readable for Value {
|
||||
Type::Binary => Value::Binary(try!(Readable::read(statement, i))),
|
||||
Type::Float => Value::Float(try!(Readable::read(statement, i))),
|
||||
Type::Integer => Value::Integer(try!(Readable::read(statement, i))),
|
||||
Type::String => Value::Binary(try!(Readable::read(statement, i))),
|
||||
Type::String => Value::String(try!(Readable::read(statement, i))),
|
||||
Type::Null => Value::Null,
|
||||
})
|
||||
}
|
||||
|
@ -72,11 +72,12 @@ fn connection_set_busy_handler() {
|
||||
#[test]
|
||||
fn iterator() {
|
||||
let connection = setup(":memory:");
|
||||
let statement = "SELECT id FROM users WHERE id = ?";
|
||||
let statement = "SELECT id, name FROM users WHERE id = ?";
|
||||
let mut iterator = ok!(connection.prepare(statement)).into_iter().unwrap();
|
||||
|
||||
ok!(iterator.start(&[Value::Integer(1)]));
|
||||
assert_eq!(ok!(ok!(iterator.next())), &[Value::Integer(1)]);
|
||||
assert_eq!(ok!(ok!(iterator.next())), &[Value::Integer(1),
|
||||
Value::String("Alice".to_string())]);
|
||||
assert_eq!(ok!(iterator.next()), None);
|
||||
|
||||
ok!(iterator.start(&[Value::Integer(42)]));
|
||||
|
Loading…
x
Reference in New Issue
Block a user