DatabaseTable interface

A JavaScript object implementing the DatabaseTable interface provides access to a table in a relational style database.

Construction

DatabaseTable objects cannot be directly created.

Use the table() function on a Database object to create a named property on that object.

Interface

property name

The name of the database table.

function create(initialValues)

Create a new DatabaseRow object, representing a potential new row in the table. The row is only stored when you call save() on the returned object.

The optional initialValues argument is a JavaScript Object used as a dictionary of field name to field value.

function load(id)

Load a row, given the ID of a row. Return a DatabaseRow object.

function select()

Returns a new DatabaseQuery object for selecting rows from the table.

function deleteRow(id)

Delete the row given the row ID.

If you have a DatabaseRow, you can also call deleteObject() on it.

Returns true if the row was deleted.