Commit c5cd5ee2 by Konstantin Käfer

add documentation for Database#exec

parent 0eb265ad
......@@ -106,6 +106,14 @@ There is currently no way to abort execution.
## Database#exec(sql, [callback])
Runs all SQL queries in the supplied string. No result rows are retrieved. The function returns the Database object to allow for function chaining. If a query fails, no subsequent statements will be executed (wrap it in a transaction if you want all or none to be executed). When all statements have been executed successfully, or when an error occurs, the callback function is called, with the first parameter being either `null` or an error object. When no callback is provided and an error occurs, an `error` event will be emitted on the database object.
Note: This function will only execute statements up to the first NULL byte.
## Database#prepare(sql, [param, ...], [callback])
Prepares the SQL statement and optionally binds the specified parameters and calls the callback when done. The function returns a Statement object.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment