This is the abstract Table object. This object contains all the shared methods for the table objects.

Also this object can be used as a wrapper for custom Table methods.


Methods

_actionDelete (The)

private

This is the abstract delete method. When extending from the AbstractTable object this method needs to be overridden.

Parameters

Name Type Description
The CommandContext context of the request.

Returned Value

Promise: The promise containing the result.


_actionInsert (The)

private

This is the abstract insert method. When extending from the AbstractTable object this method needs to be overridden.

Parameters

Name Type Description
The CommandContext context of the request.

Returned Value

Promise: The promise containing the result.


_actionSelect (The)

private

This is the abstract select method. When extending from the AbstractTable object this method needs to be overridden.

Parameters

Name Type Description
The CommandContext context of the request.

Returned Value

Promise: The promise containing the result.


_actionUpdate (The)

private

This is the abstract update method. When extending from the AbstractTable object this method needs to be overridden.

Parameters

Name Type Description
The CommandContext context of the request.

Returned Value

Promise: The promise containing the result.


filterColumns (data)

This method will return an object with columns which are available in the table columns.

Parameters

Name Type Description
data Object The object to filter

Returned Value

Promise: A promise containing all the columns available in the table columns


getAdapter ()

This method will return the adapter connected to the table.

Returned Value

Database: The database object.


getColumns ()

This method returns the columns set on the Table. By default this is an empty array.

Returned Value

Promise: A promise containing the table columns.


getColumns (object, reverse)

This method will rename object keys to their new key when found.

Parameters

Name Type Description
object Object The object to rename the keys of.
reverse Boolean A boolean to reverse the functionality.

Returned Value

Object: The object with the renamed keys.


getIdentityColumn ()

This method will return the unique column, By default this is an empty string.

Returned Value

Promise: The unique column of the table.


getName ()

This method returns the name of the table.

Returned Value

String: The name of the table object.


getQueryBuilder ()

This method will return the query builder object.

Returned Value

QueryBuilder: A QueryBuilder instance of the RaddishDB query builder.


getRow ()

This method will return the Row object related to the Table object.

Returned Value

Promise: A promise containing the related Row object.


getRowset ()

This method will return the Rowset object related to the Table object.

Returned Value

Promise: A promise containing the related Rowset object.


getUniqueColumns ()

This mehtod retuns an array of unique columns.

Returned Value

Promise: A promise containing the unique columns of the table.


mapColumn (key, reverse)

This method check for the column name of the given key, or reversed.

Parameters

Name Type Description
key String The column name to return.
reverse Boolean Reverse the method. (default: false)

Returned Value

String: The new name of the object key.