support more params format and iterable

This commit is contained in:
Mikaël Francoeur
2025-07-15 09:03:13 -04:00
parent b03b06107b
commit cf13911839
4 changed files with 105 additions and 16 deletions

View File

@@ -264,8 +264,11 @@ class Statement {
*
* @param bindParameters - The bind parameters for executing the statement.
*/
iterate(...bindParameters) {
return this.stmt.iterate(bindParameters.flat());
*iterate(...bindParameters) {
// revisit this solution when https://github.com/napi-rs/napi-rs/issues/2574 is fixed
for (const row of this.stmt.iterate(bindParameters.flat())) {
yield row;
}
}
/**