diff --git a/README.md b/README.md index 204e558..97c6278 100644 --- a/README.md +++ b/README.md @@ -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::(0).unwrap()); + println!("name = {}", statement.read::(1).unwrap()); +} ``` ## Contributing diff --git a/src/lib.rs b/src/lib.rs index 2c673ff..a38079d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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::(0).unwrap()); +//! println!("name = {}", statement.read::(1).unwrap()); +//! } //! ``` //! //! [1]: https://www.sqlite.org