kubo / rust-oracle

Oracle driver for Rust
193 stars 43 forks source link

Prefetch example tweak #42

Closed cjbj closed 3 years ago

cjbj commented 3 years ago

@kubo apologies if you already have this queued up from the email I sent about it.

I think the comment in connection.js about prefetch size could should show a value one greater than the number of rows. I.e this:

    /// let mut stmt = conn
    ///     .statement("select empno, ename from emp order by empno fetch first 10 rows only")
    ///     .prefetch_rows(10)
    ///     .build()?;

could be:

    /// let mut stmt = conn
    ///     .statement("select empno, ename from emp order by empno fetch first 10 rows only")
    ///     .prefetch_rows(11)  /// add one to avoid a round-trip to check for end-of-fetch
    ///     .build()?;

It depends what cases you want to show.

kubo commented 3 years ago

@cjbj Thanks for pointing and sorry for too late reply. I received your email.

cjbj commented 3 years ago

@kubo thank you for all your great work.