InternalBind a blob (binary) value to a parameter.
1-based parameter index
The binary data
Bind a boolean value to a parameter.
1-based parameter index
The boolean value
Bind a 64-bit double to a parameter.
1-based parameter index
The double value
Bind a 32-bit float to a parameter.
1-based parameter index
The float value
Bind a 16-bit signed integer to a parameter.
1-based parameter index
The integer value (-32768 to 32767)
Bind a 32-bit signed integer to a parameter.
1-based parameter index
The integer value
Bind a 64-bit signed integer to a parameter.
1-based parameter index
The integer value (BigInt or number)
Bind an 8-bit signed integer to a parameter.
1-based parameter index
The integer value (-128 to 127)
Bind a NULL value to a parameter.
1-based parameter index
Bind a 16-bit unsigned integer to a parameter.
1-based parameter index
The integer value (0 to 65535)
Bind a 32-bit unsigned integer to a parameter.
1-based parameter index
The integer value
Bind a 64-bit unsigned integer to a parameter.
1-based parameter index
The integer value (BigInt or number)
Bind an 8-bit unsigned integer to a parameter.
1-based parameter index
The integer value (0 to 255)
Bind a string value to a parameter.
1-based parameter index
The string value
Clear all parameter bindings.
Close the prepared statement and release resources.
Execute the prepared statement and return the number of affected rows.
Use this for INSERT, UPDATE, DELETE statements.
Promise resolving to the number of rows affected
Execute the prepared statement and return results.
Promise resolving to array of result rows as objects
A prepared SQL statement with parameter binding.
Prepared statements are more secure (prevent SQL injection) and can be more efficient when executing the same query multiple times with different parameters.
Bind methods are synchronous (store locally), while run() and execute() are async (send to worker).
Example