win10, nim 0.14.2
Will crash when I use fastRows and instantRows iterator.
echo buf, rowRes,":",cCnt, ";"
rowRes[colId-1] = $buf.cstring # line:341 db_odbc.nim
result:
你好 nil:19;
Traceback (most recent call last)
db_odbc.nim(342) temp
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Crash to rowRes is nil.IIRC, fastRows should not be interupted (no good if you want to break the loop).
The snippet you show doesn't give the full picture of how you are using the iterator.
Can you show more example code?
Use odbc bind mssql database, Run db_odbc.nim's example.
var theDb = open("localhost", "nim", "nim", "test")
for x in theDb.fastRows(sql"select * from qqq"):
echo x
#qqq table
name | id |
你好 xxx