Dataset(native)
This class allows manipulate with data returns by SQLite database. This object can be create only by exec function from Database class.
Example
// Returns object constructed from current row as { field1: value1, field2: value2, etc. } function Dataset.rowAsObject() { var names = this.names; if (!names) { names = []; for (var n = 0; n < this.length; ++n) names.push(symbol(this.name(n))); this.names = names; } var obj = {}; var n = 0; for (var v in this) obj[names[n++]] = v; return obj; }
Properties
-
length : Integer
Number of columns.
-
valid : Boolean
Reports true if the buffer contains valid row.
Methods
-
close() : Boolean
Close function release all resources from memory. Dataset object cannot be used longer.
-
name(column [, witch]) : String
This call returns name of column set by integer (first column is 0, second 1 etc) or thanks to second parameter function can return also name of table or databse.
-
next() : Boolean
Advanced recordset to the next record and returns true if operation is successfull. Otherwise function returns false.