Cursor

NES2+Syntax

							connection.cursor()
database.cursor()

Description

The Cursor object is a core object created when the cursor() method of the Connection or database object is called. A database query is said to return a cursor, so this object contains references to the rows returned from a query.

When working with cursor objects, you should explicitly close them using the close() method when you are finished. Not doing so will call the JavaScript runtime to hold the cursor in memory until the connection or pool to which the cursor was tied goes out of scope.

The Cursor object has several methods and properties associated with it. These are listed in Table 8.5.

Table 8.5. Properties and Methods of the Cursor Object
TypeItemDescription
property ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.