NextDB.net

Class nextdb.Query

Object
   |
   +--nextdb.Query

class nextdb.Query


Query is a class that represents a 'named' query Queries are for retrieving data from your database. Queries to your databases are made by referencing the queries that you developed on the NextDB admin pages. For obvious security reasons, the query language syntax is not exposed at the JavaScript level. Executing SQL from the browser would pose obvious security problems. Rather, you reference a query by its name. The query request is sent asynchronously to the server, and your callback function handles the response-- standard AJAX programming. Behind the scenes we are using a communication mechanism that side steps the 'server of origin' policy of the XMLHTTPRequest. So you can access NextDB from a page loaded from a server different than www.nextdb. This enables mashups in the true sense of the word.


    var conn = new nextdb.Connection("accountName","databaseName");
    var query = new nextdb.Query("QUERY1");
    conn.executeQuery(query,
        function(rows,error){
            if(error){
                alert(error.message);
            } else {
                alert(rows);
            }
        });



Defined in api.docs.js


Constructor Summary
nextdb.Query(<String> name)
           
 
Method Summary
 void setPageSize(<int> num)
           must be no greater than 100
 void setParameters(<Object> map)
           required collection of name/value pairs, this is a plain old javascript object
for example query.setParameters({fname:"Brent",lname:"Jones"});
 void setStartAfter(num)
           To move forward to the next page of query results call setStartAfter with the value of the last PK on the current page, then re-execute the query.
 void setStartAfterValue(<object> val)
           If you have an ORDERBY clause in the query you can set the value to start after with this field.

Constructor Detail

nextdb.Query

nextdb.Query(<String> name)

Method Detail

setPageSize

void setPageSize(<int> num)

setParameters

void setParameters(<Object> map)

setStartAfter

void setStartAfter(num)

setStartAfterValue

void setStartAfterValue(<object> val)

NextDB.net

Documentation generated by JSDoc on Fri Apr 1 10:54:23 2011