0
1
Fork 0
hedera-web-mindshore/js/sql/field.js

44 lines
609 B
JavaScript

var Expr = require ('./expr');
/**
* The equivalent of a SQL field.
*
* @param {string} taget The name of the owner table
*/
module.exports = new Class
({
Extends: Expr
,Tag: 'sql-field'
,Properties:
{
/**
* The column name.
*/
name:
{
type: String
,value: null
},
/**
* The source table name or its alias if it has been specified.
*/
target:
{
type: String
,value: null
}
}
,render: function ()
{
var sql = '';
if (this.target)
sql += this.renderIdentifier (this.target) +'.';
sql += this.renderIdentifier (this.name);
return sql;
}
});