Class Index

Classes


v1.2.1

DBCursor

A Cursor to iterate through the results of a query. This object is returned from the DB#queryCursor method, and provides access to the data and metadata of the results. The initial position of the cursor is to be prior to the first row of results.

Summary
Constructor Attributes Constructor Name and Description
This class is used to iterate through the results of a query.
Method Summary
Method Attributes Method Name and Description
Returns the number of columns output by the query.
getColumnName (columnIndex)
Returns the name of a column by its ordinal index.
getValue (columnIndex)
Returns the value of the specified column in the current row of the cursor.
Advances the cursor one row and returns whether or not a "next" row exists.
Resets the cursor's position to be prior to the first row.
Detail
DBCursor ()
This class is used to iterate through the results of a query.
See:
DB#queryCursor
Method Detail
{int} getColumnCount ()
Returns the number of columns output by the query.
Returns:
{int} the number of columns returned by the query.

{string} getColumnName (columnIndex)
Returns the name of a column by its ordinal index.
Parameters:
{int} columnIndex
the index of the column (indexed from 0).
Returns:
{string} the name of the column.

{*} getValue (columnIndex)
Returns the value of the specified column in the current row of the cursor. This method will return whatever datatype is valid for the specific column, and will return the JavaScript 'null' value if the value is null.
Parameters:
{int} columnIndex
the index of the column (indexed from 0).
Returns:
{*} the value for the specified column, or 'null' if null.

{boolean} next ()
Advances the cursor one row and returns whether or not a "next" row exists. A cursor's position is initially set to be prior to the first row.
Returns:
{boolean} 'true' when another row exists, 'false' otherwise.

reset ()
Resets the cursor's position to be prior to the first row.

©2012 Sequel Sphere, LLC.