@sequeljs/ast
Version:
A SQL AST manager for JavaScript
42 lines • 1.13 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Attribute_1 = require("../attributes/Attribute");
const Binary_1 = require("./Binary");
class TableAlias extends Binary_1.default {
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_1.default(this, name);
}
isAbleToTypeCast() {
return ('isAbleToTypeCast' in this.relation && this.relation.isAbleToTypeCast());
}
typeCastForDatabase(attributeName, value) {
return this.relation.typeCastForDatabase(attributeName, value);
}
}
exports.default = TableAlias;
//# sourceMappingURL=TableAlias.js.map