Skip to content

Commit

Permalink
add documentation for Database#exec
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaefer committed Feb 23, 2011
1 parent 0eb265a commit c5cd5ee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -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.
Expand Down

0 comments on commit c5cd5ee

Please sign in to comment.