NextDB.net

Class nextdb.Insert

Object
   |
   +--nextdb.Insert

class nextdb.Insert


A simple insert just takes the table name in the constructor, then an object of name/value pairs as the data to insert into that table. The fields of the object must correspond to the columns of the database. The values for the fields are the values that will make up the new row. Your callback function is passed an encrypted key (PK) referencing the row that you have inserted. A very simple insert looks like this:


    var conn = new nextdb.Connection("accountName","databaseName");
    var insert = new nextdb.Insert("TABLE1");
    var params = {
        first_name : "John",
        last_name : "Doe"
    }
    insert.setParameters(params);
    conn.executeInsert(insert,
    function(rowId,error){
        if(error){
            alert(error.message);
        } else {
            alert("success! "+rowId)
        }
    });


Defined in api.docs.js


Field Summary
 Object map
          
 Object table
          
 
Constructor Summary
nextdb.Insert(<String> tableName)
           
 
Method Summary
 void setParameters(<Object> map)
          
 void setPermalinkHandler(<Function> callback)
          
 void setRelationship(<Relationship> relationship)
           Set the rowId and relationship name to automatically link this inserted row to another row in a different table according to the named relationship.

Field Detail

map

Object map

table

Object table

Constructor Detail

nextdb.Insert

nextdb.Insert(<String> tableName)

Method Detail

setParameters

void setParameters(<Object> map)

setPermalinkHandler

void setPermalinkHandler(<Function> callback)

setRelationship

void setRelationship(<Relationship> relationship)

NextDB.net

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