Class net.nextdb.Insert
Object
|
+--net.nextdb.Insert
- class
net.nextdb.Insert
Insert allows you to add a row of data to a given table.
var conn = new net.nextdb.Connection("accountName","databaseName");
var insert = new net.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
|
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.
|
map
Object map
table
Object table
net.nextdb.Insert
net.nextdb.Insert(<String> tableName)
setParameters
void setParameters(<Object> map)
Parameters:
map - -required collection of name/value pairs, this is a plain old javascript object.
example:
var parameters = new Object();
parameters.fname="Brent";
parameters.lname="Hamby";
parameters.email="brenthamby@someserver.com";
insert.setParameters(parameters);
setPermalinkHandler
void setPermalinkHandler(<Function> callback)
Parameters:
callback - -in the case of binary data inserts, this callback will be passed a permalink to the data.
setRelationship
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.
Parameters:
relationship - -optional used to relate the new row to existing row in another table.
Documentation generated by
JSDoc on Mon Mar 29 20:15:50 2010