From 5ae33434f84602c02b4a6ad52ffab140208eabe5 Mon Sep 17 00:00:00 2001 From: JamesP Date: Sun, 6 Sep 2015 22:39:23 +1000 Subject: [PATCH] fastRows() iterator doco updated (similar to db_mysql) with sqlite specific [Edb] error text --- lib/impure/db_sqlite.nim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/impure/db_sqlite.nim b/lib/impure/db_sqlite.nim index b3b62109cf..53d7570e47 100644 --- a/lib/impure/db_sqlite.nim +++ b/lib/impure/db_sqlite.nim @@ -130,9 +130,13 @@ proc setRow(stmt: Pstmt, r: var Row, cols: cint) = iterator fastRows*(db: DbConn, query: SqlQuery, args: varargs[string, `$`]): Row {.tags: [FReadDb].} = - ## executes the query and iterates over the result dataset. This is very - ## fast, but potenially dangerous: If the for-loop-body executes another - ## query, the results can be undefined. For Sqlite it is safe though. + ## Executes the query and iterates over the result dataset. + ## + ## This is very fast, but potentially dangerous. Use this iterator only + ## if you require **ALL** the rows. + ## + ## Breaking the fastRows() iterator during a loop will cause the next + ## database query to raise an [EDb] exception ``unable to close due to ...``. var stmt = setupQuery(db, query, args) var L = (column_count(stmt)) var result = newRow(L)