bind/js: Add bind method

This commit is contained in:
Diego Reis 2025-05-26 16:04:54 -03:00
parent bce4ac45db
commit 799f4149c5
4 changed files with 79 additions and 10 deletions

View file

@ -224,6 +224,16 @@ class Statement {
columns() {
return this.stmt.columns();
}
/**
* Binds the given parameters to the statement _permanently_
*
* @param bindParameters - The bind parameters for binding the statement.
* @returns this - Statement with binded parameters
*/
bind(...bindParameters) {
return this.stmt.bind(bindParameters.flat());
}
}
module.exports.Database = Database;