DbObject - do-/node-doix-db GitHub Wiki

DbObject is a class describing an element of database schema, such as DbRelation (DbTable, DbView etc.) a DbRoutine of some kind or another entity.

Properties

Name Type Description
model DbModel The model this object belongs to.
schema DbSchema The schema this object belongs to.
name String logical name of this object in the containing schema.map.
schemaName String Physical name of the schema, alias for schema.schemaName.
localName String Alias for name.
qName String fully qualified and quoted name of the object safe to be interpolated in SQL, DDL etc. Set by a DbLang descendant
comment String Human readable descriptive text to be set via COMMENT ON like SQL statements

Constructor

This class is considered abstract, so the constructor

new DbObject ({name})

should never be called explicitly. Moreover, all its ancestors should be created only by calling DbSchema's create method (normally, in the course of adding).

In the base implementation, the constructor basically just copies all properties from the given argument to this plus copies name to localName.

Properties

Name Type Description Notes
schema DbSchema The schema this object belongs to
model DbModel The model this object belongs to (via schema)
name String logical name of this object in the containing DbSchema
schemaName String Physical name of the schema Copy of schema.schemaName, unquoted
localName String Physical name of the object in the schema Often a copy of name, unquoted
fullName String The object's name to use with DbModel's find Copy of name for the defaultSchema, ${schema.name}.${name} otherwise
qName String Qualified name quoted name of the object safe to be interpolated in SQL, DDL etc. Set by a DbLang descendant

Methods

setLang

With the given DbLang lang, calculates all properties specific to this language/dialect.

In the base implementation, sets the qName calculated as lang.getDbObjectName (this).