class sqlite3.SQLite3.Cursor
Description
Class used to execute SQL statements, usually ones returning data.
You cannot construct a cursor object directly, use sqlite.SQLite3#query to create one.
Methods
Instance methods
-
__iterator__ #
sqlite3.SQLite3.Cursor#__iterator__() ⇒ IteratorIterator support for Spidermonkey’s Iterator/Generators. This behaviour lets you write:
for (row in myCursor) { ... }and each row will only be fetched from SQLite as needed, by calling sqlite3.SQLite3.Cursor#next.
-
bind #
sqlite3.SQLite3.Cursor#bind(params) ⇒ undefined-
params(Object|Array) – parameters to bind to the placeholders in the SQL
Bind placeholder values. Accepts either an Array or an Object. SQLite bind params are 1 based. However when an array is passed the first bind param is pulled from the 0th element of the array, etc.
-
-
close #
sqlite3.SQLite3.Cursor#close() ⇒ undefinedClose this cursor. Force it to be closed now, instead of waiting for it to get garbage collected.
You don’t have to call this method, but its probably a good idea to call if you know you wont need to use this cursor any more, since garbage collection might take a long time to run.
-
next #
sqlite3.SQLite3.Cursor#next([want_object]) ⇒ Array | Object- want_object (Boolean): get the next row as an object or as an array
Get next row from this cursor. This is the alternative way of getting at the results if you don’t like the iterator style (or if the JS engine doesn’t support it).
If you pass as optional parameter true next will return an Object with the column names as id. For no parameter or anything else it will return an array.
-
reset #
sqlite3.SQLite3.Cursor#reset() ⇒ undefinedReset the cursor back to the start. This will also clear any errors.
This does not clear any bound parameters.