mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-03-15 06:20:50 +00:00
Extend the example
This commit is contained in:
parent
0572f80ed0
commit
961dad0f65
@ -20,6 +20,12 @@ connection.process("SELECT * FROM `users`;", |pairs| {
|
||||
}
|
||||
true
|
||||
}).unwrap();
|
||||
|
||||
let mut statement = connection.prepare("SELECT * FROM `users`;").unwrap();
|
||||
while statement.step().unwrap() == sqlite::State::Row {
|
||||
println!("id = {}", statement.read::<i64>(0).unwrap());
|
||||
println!("name = {}", statement.read::<String>(1).unwrap());
|
||||
}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
@ -16,6 +16,12 @@
|
||||
//! }
|
||||
//! true
|
||||
//! }).unwrap();
|
||||
//!
|
||||
//! let mut statement = connection.prepare("SELECT * FROM `users`;").unwrap();
|
||||
//! while statement.step().unwrap() == sqlite::State::Row {
|
||||
//! println!("id = {}", statement.read::<i64>(0).unwrap());
|
||||
//! println!("name = {}", statement.read::<String>(1).unwrap());
|
||||
//! }
|
||||
//! ```
|
||||
//!
|
||||
//! [1]: https://www.sqlite.org
|
||||
|
Loading…
x
Reference in New Issue
Block a user