mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-03-15 06:20:50 +00:00
Reduce the number of semicolons in the examples
This commit is contained in:
parent
557fbeb12d
commit
5f3753e691
@ -14,14 +14,14 @@ connection.execute("
|
||||
INSERT INTO `users` (id, name) VALUES (1, 'Alice');
|
||||
").unwrap();
|
||||
|
||||
connection.process("SELECT * FROM `users`;", |pairs| {
|
||||
connection.process("SELECT * FROM `users`", |pairs| {
|
||||
for &(column, value) in pairs.iter() {
|
||||
println!("{} = {}", column, value.unwrap());
|
||||
}
|
||||
true
|
||||
}).unwrap();
|
||||
|
||||
let mut statement = connection.prepare("SELECT * FROM `users`;").unwrap();
|
||||
let mut statement = connection.prepare("SELECT * FROM `users`").unwrap();
|
||||
while let sqlite::State::Row = statement.step().unwrap() {
|
||||
println!("id = {}", statement.read::<i64>(0).unwrap());
|
||||
println!("name = {}", statement.read::<String>(1).unwrap());
|
||||
|
@ -10,14 +10,14 @@
|
||||
//! INSERT INTO `users` (id, name) VALUES (1, 'Alice');
|
||||
//! ").unwrap();
|
||||
//!
|
||||
//! connection.process("SELECT * FROM `users`;", |pairs| {
|
||||
//! connection.process("SELECT * FROM `users`", |pairs| {
|
||||
//! for &(column, value) in pairs.iter() {
|
||||
//! println!("{} = {}", column, value.unwrap());
|
||||
//! }
|
||||
//! true
|
||||
//! }).unwrap();
|
||||
//!
|
||||
//! let mut statement = connection.prepare("SELECT * FROM `users`;").unwrap();
|
||||
//! let mut statement = connection.prepare("SELECT * FROM `users`").unwrap();
|
||||
//! while let sqlite::State::Row = statement.step().unwrap() {
|
||||
//! println!("id = {}", statement.read::<i64>(0).unwrap());
|
||||
//! println!("name = {}", statement.read::<String>(1).unwrap());
|
||||
|
Loading…
x
Reference in New Issue
Block a user