fastRows() iterator doco updated (similar to db_mysql) with sqlite specific
[Edb] error text
This commit is contained in:
parent
81e41dc795
commit
5ae33434f8
1 changed files with 7 additions and 3 deletions
|
|
@ -130,9 +130,13 @@ proc setRow(stmt: Pstmt, r: var Row, cols: cint) =
|
||||||
|
|
||||||
iterator fastRows*(db: DbConn, query: SqlQuery,
|
iterator fastRows*(db: DbConn, query: SqlQuery,
|
||||||
args: varargs[string, `$`]): Row {.tags: [FReadDb].} =
|
args: varargs[string, `$`]): Row {.tags: [FReadDb].} =
|
||||||
## executes the query and iterates over the result dataset. This is very
|
## Executes the query and iterates over the result dataset.
|
||||||
## fast, but potenially dangerous: If the for-loop-body executes another
|
##
|
||||||
## query, the results can be undefined. For Sqlite it is safe though.
|
## 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 stmt = setupQuery(db, query, args)
|
||||||
var L = (column_count(stmt))
|
var L = (column_count(stmt))
|
||||||
var result = newRow(L)
|
var result = newRow(L)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue