Class: exports.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(opts, model)

Constructor. @param opts The configuration options

Parameters:

  • model ( Model ) The model this table belongs to.

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.

# (Promise<String>) getDisplayName() Bound

Get a human readable display name, as configured for this class.

This is the same as table.model.makePath(table.name).getDisplayName(), but you don't need to make sure you have access to the model.

Returns:

  • ( Promise<String> ) — A promise to yield a display name.

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: