![]() ![]() Parameters may not be used for column or table names. This automatically sanitizes inputs RE: issue #57. There are three ways of passing bind parameters: directly in the function's arguments, as an array, and as an object for named parameters. They will be bound to the statement before it is executed. (optional): When the SQL statement contains placeholders, you can pass them in here. If no callback was passed and preparing fails, an error event will be emitted on the underlying Statement object. If the SQL query is invalid and a callback was passed to the function, it is called with an error object containing the error message from SQLite. The function returns the Database object for which it was called to allow for function chaining. Runs the SQL query with the specified parameters and calls the callback afterwards. busyTimeout: provide an integer as a value.Invoked every time an SQL statement executes. Invoked when an SQL statement executes, with a rendering of the statement text. trace: provide a function callback as a value.Set a configuration option for the database. ![]() If closing succeeded, a close event with no parameters is emitted, regardless of whether a callback was provided or not. If no callback is provided and an error occurred, an error event with the error object as the only parameter will be emitted on the database object. callback (optional): If provided, this function will be called when the database was closed successfully or when an error occurred.See the wiki page on debugging for more information. Sets the execution mode to verbose to produce long stack traces. If opening succeeded, an open event with no parameters is emitted, regardless of whether a callback was provided or not. The default value is OPEN_READWRITE | OPEN_CREATE | OPEN_FULLMUTEX.Ĭallback (optional): If provided, this function will be called when the database was opened successfully or when an error occurred. Mode (optional): One or more of sqlite3.OPEN_READONLY, sqlite3.OPEN_READWRITE, sqlite3.OPEN_CREATE, sqlite3.OPEN_FULLMUTEX, sqlite3.OPEN_URI, sqlite3.OPEN_SHAREDCACHE, sqlite3.OPEN_PRIVATECACHE. Anonymous databases are not persisted and when closing the database handle, their contents are lost. There is no separate method to open the database.įilename: Valid values are filenames, ":memory:" for an anonymous in-memory database and an empty string for an anonymous disk-based database. Returns a new Database object and automatically opens the database. Note: excluding a callback does not turn the API synchronous. The docs below show the public interface of the library. Install sqlite3 by following the Installation instructions. ℹ️ Please use the GitHub table-of-contents to browse the API docs.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |