diff options
author | JamesP <jlp765@gmail.com> | 2015-09-06 22:39:23 +1000 |
---|---|---|
committer | JamesP <jlp765@gmail.com> | 2015-09-06 22:39:23 +1000 |
commit | 5ae33434f84602c02b4a6ad52ffab140208eabe5 (patch) | |
tree | 38334cb38fe671a7bb11646bd2a37c30d99fcf63 /lib/impure/db_sqlite.nim | |
parent | 81e41dc795f489fd77c94e2b31d37270476a19aa (diff) | |
download | Nim-5ae33434f84602c02b4a6ad52ffab140208eabe5.tar.gz |
fastRows() iterator doco updated (similar to db_mysql) with sqlite specific
[Edb] error text
Diffstat (limited to 'lib/impure/db_sqlite.nim')
-rw-r--r-- | lib/impure/db_sqlite.nim | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/impure/db_sqlite.nim b/lib/impure/db_sqlite.nim index b3b62109c..53d7570e4 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) |