npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

cf-query

0.0.3 • Public • Published

Query.js

Use ColdFusion/Railo query JSON more easily

Interface

next() - boolean Progresses the current row.

getValue(column) - string/null Return data for the given [column] based on the current row. Returns null if the pointer has progressed beyond the last row. Errors if the column doesn't exist.

getValueAt(column, row) - string/null Return data for the given [column] for the given row. Returns null if the pointer has progressed beyond the last row. Errors if the column doesn't exist.

reset() Sets the pointer back to the start. The start is at the beginning of the query, not the first row so next() will need to be called before the first row is accessed.

getCurrentRow() - numeric Returns the current row.

getRecordCount() - numeric Returns the record count.

Usage

// Create a new clients query - Where json is a ColdFusion query JSON string
var clients = new Query(json);

// Loop over the clients and output their first name
while (clients.next()) {
	console.log(clients.getValue("firstName"));
}

install

npm i cf-query

Downloadsweekly downloads

10

version

0.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability