File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,29 @@ impl<'conn> Statement<'conn> {
237
237
/// `Connection` as this `Statement`, if the `Transaction` is not
238
238
/// active, or if the number of parameters provided does not match the
239
239
/// number of parameters expected.
240
+ ///
241
+ /// # Examples
242
+ ///
243
+ /// ```no_run
244
+ /// extern crate fallible_iterator;
245
+ /// extern crate postgres;
246
+ ///
247
+ /// use fallible_iterator::FallibleIterator;
248
+ /// # use postgres::{Connection, TlsMode};
249
+ ///
250
+ /// # fn main() {
251
+ /// # let conn = Connection::connect("", TlsMode::None).unwrap();
252
+ /// let stmt = conn.prepare("SELECT foo FROM bar WHERE baz = $1").unwrap();
253
+ /// let trans = conn.transaction().unwrap();
254
+ /// # let baz = true;
255
+ /// let mut rows = stmt.lazy_query(&trans, &[&baz], 100).unwrap();
256
+ ///
257
+ /// while let Some(row) = rows.next().unwrap() {
258
+ /// let foo: i32 = row.get("foo");
259
+ /// println!("foo: {}", foo);
260
+ /// }
261
+ /// # }
262
+ /// ```
240
263
pub fn lazy_query < ' trans , ' stmt > (
241
264
& ' stmt self ,
242
265
trans : & ' trans Transaction ,
You can’t perform that action at this time.
0 commit comments