mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-04-25 00:32:14 +00:00
Adjust the example
This commit is contained in:
parent
acf1211eb4
commit
0390d179d5
@ -22,7 +22,7 @@ connection.process("SELECT * FROM `users`;", |pairs| {
|
|||||||
}).unwrap();
|
}).unwrap();
|
||||||
|
|
||||||
let mut statement = connection.prepare("SELECT * FROM `users`;").unwrap();
|
let mut statement = connection.prepare("SELECT * FROM `users`;").unwrap();
|
||||||
while statement.step().unwrap() == sqlite::State::Row {
|
while let sqlite::State::Row = statement.step().unwrap() {
|
||||||
println!("id = {}", statement.read::<i64>(0).unwrap());
|
println!("id = {}", statement.read::<i64>(0).unwrap());
|
||||||
println!("name = {}", statement.read::<String>(1).unwrap());
|
println!("name = {}", statement.read::<String>(1).unwrap());
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
//! }).unwrap();
|
//! }).unwrap();
|
||||||
//!
|
//!
|
||||||
//! let mut statement = connection.prepare("SELECT * FROM `users`;").unwrap();
|
//! let mut statement = connection.prepare("SELECT * FROM `users`;").unwrap();
|
||||||
//! while statement.step().unwrap() == sqlite::State::Row {
|
//! while let sqlite::State::Row = statement.step().unwrap() {
|
||||||
//! println!("id = {}", statement.read::<i64>(0).unwrap());
|
//! println!("id = {}", statement.read::<i64>(0).unwrap());
|
||||||
//! println!("name = {}", statement.read::<String>(1).unwrap());
|
//! println!("name = {}", statement.read::<String>(1).unwrap());
|
||||||
//! }
|
//! }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user