UNPKG

@sequeljs/ast

Version:

A SQL AST manager for JavaScript

39 lines 1 kB
import Attribute from '../attributes/Attribute'; import Binary from './Binary'; export default class TableAlias extends Binary { get name() { return this.right; } set name(val) { this.right = val; } get relation() { return this.left; } set relation(val) { this.left = val; } get tableAlias() { return this.name; } set tableAlias(val) { this.name = val; } get tableName() { return this.relation && typeof this.relation === 'object' && 'name' in this.relation ? this.relation.name : this.name; } get(name) { return new Attribute(this, name); } isAbleToTypeCast() { return ('isAbleToTypeCast' in this.relation && this.relation.isAbleToTypeCast()); } typeCastForDatabase(attributeName, value) { return this.relation.typeCastForDatabase(attributeName, value); } } //# sourceMappingURL=TableAlias.js.map