{@link IndexableArray Indexable array} of columns this foreign key has. Columns are in order their ordinal position within the foreign key.
Comment of the database object defined in database including {@link DbObject#commentData comment data}.
The @{link Index index}} supporting this constraint.
Whether all foreign key columns are mandatory at parent table.
// account table: (PK) id [NN]
// contact table: (PK) id [NN], (FK) account_id [NN]
contactTable.foreignKeys[0].mandatoryParent; // true, because all foreign keys (account_id) is not null.
Match option of ForeignKey. One of FULL
, PARTIAL
, NONE
. TypeScript developers should use {@link MatchOption} enum.
Name of the database object.
Delete action for foreign keys. One of CASCADE
, SET NULL
, SET DEFAULT
, RESTRICT
, NO ACTION
.
TypeScript developers should use Action enum.
Update action for foreign keys. One of CASCADE
, SET NULL
, SET DEFAULT
, RESTRICT
, NO ACTION
.
TypeScript developers should use Action enum.
Table which this constraint defined in.
Data which is extracted from database object's comment. Data is extracted from text between special case-insensitive tag
(default: [pg-structure][/pg-structure]
) and converted to JavaScript object using JSON5.
Token name can be specified by using commentDataToken
arguments.
For details of JSON5, see it's web site: https://json5.org.
// "Account details. [pg-structure]{ extraData: 2 }[/pg-structure] Also used for logging."
table.comment; // "Account details. [pg-structure]{ extraData: 2 }[/pg-structure] Also used for logging."
table.commentWithoutData; // "Account details. Also used for logging."
table.commentData; // { extraData: 2 }
table.commentData.extraData; // 2
Description or comment of the database object defined in database. If comment contains {@link DbObject#commentData comment data}, it is removed.
// "Account details. [pg-structure]{ extraData: 2 }[/pg-structure] Also used for logging."
table.commentWithoutData; // "Account details. Also used for logging."
List of other foreign keys which has same source table and target table.
Full name of the database object including database name.
Full name of the constraint including table name.
Letter casing (i.e snakeCase
or camelCase
) of the database object name.
const name = entity.name; // ProductDetail
const caseType = entity.nameCaseType; // camelCase
const otherEntity = otherEntity.name; // member_protocol
const otherCaseType = otherEntity.nameCaseType; // snakeCase
{@link IndexableArray Indexable array} of columns this foreign key refers. Columns are in order their ordinal position within the foreign key.
Array of columns this foreign key has and refers to.
This is Table instance this foreign key refers to.
Schema of the constraint's table defined in.
Separator used in database object name. Empty string for came case and underscore for (_) snake case.
Generated using TypeDoc
Class which represent a foreign key. Provides attributes and methods for details of the foreign key.