mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-04-01 22:11:07 +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
|
true
|
||||||
}).unwrap();
|
}).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
|
## Contributing
|
||||||
|
@ -16,6 +16,12 @@
|
|||||||
//! }
|
//! }
|
||||||
//! true
|
//! true
|
||||||
//! }).unwrap();
|
//! }).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
|
//! [1]: https://www.sqlite.org
|
||||||
|
Loading…
x
Reference in New Issue
Block a user