Prepares the SQL statement and optionally binds the specified parameters and calls the callback when done. Comments are not allowed and will lead to runtime errors. Note: This function will only execute statements up to the first NULL byte. When no callback is provided and an error occurs, an error event will be emitted on the database object. 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. If a query fails, no subsequent statements will be executed (wrap it in a transaction if you want all or none to be executed). The function returns the Database object to allow for function chaining. Runs all SQL queries in the supplied string. There is currently no way to abort execution. If you know that a query only returns a very limited number of rows, it might be more convenient to use Database#all to retrieve all rows at once. The order of calls correspond exactly to the order of rows in the result set. In all other cases, the callback is called once for every retrieved row. If the result set succeeds but is empty, the callback is never called (this will change in the future). Var stmt = db.prepare("INSERT INTO lorem VALUES(?)") ĭb.each("SELECT rowid AS id, info FROM lorem", function(err, row). USAGE var db = new sqlite3.Database(':memory:') ĭb.run("CREATE TABLE lorem (info TEXT)") Node-sqlite3 - Asynchronous, non-blocking SQLite3 bindings for node.js 0.2.* and 0.4.*.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |