I need to define an array of any type that I can past to db_postgres.fastRows(), defined as:
iterator fastRows(db: DbConn; stmtName: SqlPrepared; args: varargs[string, `$`]): Row {...}
However this code fails:
let
id: int64 = 0
values: varargs[string, `$`] = @[ id ]
The error is:
Error: invalid type: 'varargs[string]' for let
How can I fix this?
I do nothing about Nim's db_postgres.
But from the Salewski book,
http://ssalewski.de/nimprogramming.html#_special_argument_types_openarray_and_varargs
and all the other totorials I get the feeling that varargs is only a valid type for proc parameters, but not for ordinary variables. From the procedure signature we see that we can pass single values, which are converted automatically to strings when possible, or we can pass an array or seq with base type string. So why not pass a seq with base type string?