DatabaseRow interface

A JavaScript object implementing the DatabaseRow interface provides access to a row of data in a table in a relational style database.

Construction

Use create() or load() on a DatabaseTable object.

Access elements of a DatabaseQuery object.

Interface

property id

The numeric ID of this row in the table.

function save()

Save a new row, or changes to an existing row, to the database.

Returns itself.

function deleteObject()

Deletes this row from the table.

Don’t load a DatabaseRow object just to call deleteObject(). Call deleteRow() on the DatabaseTable object instead.

The name of this function is deleteObject() not deleteRow() for consistency with other interfaces in this API.

Returns true if the row was deleted.

property properties for defined fields

A property is defined for each field defined in the fields argument to create() on the Database object.

For example, if you define a field called example, the rows will have an example property.

When a property is set, the type of the value is checked. Invalidate values will cause an exception to be thrown.

function user defined functions

Functions defined in the methods argument to create() on the Database object are available in every row object.