fixes #3220 lib/impure/db_mysql.nim getValue()
mysql connector command out of sync error due to breaking the fastRows iterator loop
This commit is contained in:
parent
370781b773
commit
1b47941b01
1 changed files with 1 additions and 4 deletions
|
|
@ -206,10 +206,7 @@ proc getValue*(db: DbConn, query: SqlQuery,
|
||||||
## executes the query and returns the first column of the first row of the
|
## executes the query and returns the first column of the first row of the
|
||||||
## result dataset. Returns "" if the dataset contains no rows or the database
|
## result dataset. Returns "" if the dataset contains no rows or the database
|
||||||
## value is NULL.
|
## value is NULL.
|
||||||
result = ""
|
result = getRow(db, query, args)[0]
|
||||||
for row in fastRows(db, query, args):
|
|
||||||
result = row[0]
|
|
||||||
break
|
|
||||||
|
|
||||||
proc tryInsertId*(db: DbConn, query: SqlQuery,
|
proc tryInsertId*(db: DbConn, query: SqlQuery,
|
||||||
args: varargs[string, `$`]): int64 {.tags: [FWriteDb].} =
|
args: varargs[string, `$`]): int64 {.tags: [FWriteDb].} =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue