Class: Table

Defined in: src/table.coffee

Overview

A representation of a single database table. It includes information on the fields that this table stores, as well as the relationships between it and other tables, either as N->1 (references) or N->many (collections).

Instance Method Summary

Constructor Details

- (void) constructor()

Constructor. @param opts The configuration options

Options Hash: (opts):

  • name (String) The name of this table
  • attributes (Object<String, Object>) The descriptions of the table's fields.
  • references (Object<String, Object>) The descriptions of the N->1 relationships.
  • attributes (Object<String, Object>) The descriptions of the N->X relationships.

Instance Method Details

- (void) toString()

Stringification.

Stringifies to a readable representation with table name and the names of all fields.

- (Array<String>) parents()

Get the names of all the classes this class directly inherits from.

Returns:

  • (Array<String>) — A copy of the direct inheritance list.