Permalink
Browse files

add documentation for Database#exec

  • Loading branch information...
kkaefer committed Feb 23, 2011
1 parent 0eb265a commit c5cd5ee2ee3dfc0dc8dd03dfea7433d904dc19f8
Showing with 8 additions and 0 deletions.
  1. +8 −0 README.md
View
@@ -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.

0 comments on commit c5cd5ee

Please sign in to comment.