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

39 lines
557 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
var Expr = require ('./expr');
/**
* The equivalent of a SQL field.
*
* @param {string} taget The name of the owner table
2016-12-20 09:32:17 +00:00
*/
2016-09-26 09:28:47 +00:00
module.exports = new Class
({
2016-09-26 09:28:47 +00:00
Extends: Expr
,Tag: 'sql-field'
,Properties:
{
2017-04-19 06:16:37 +00:00
/**
* The column name.
*/
name:
{
type: String
,value: null
},
2017-04-19 06:16:37 +00:00
/**
* The source table name or its alias if it has been specified.
*/
target:
{
type: String
,value: null
}
}
2017-04-19 06:16:37 +00:00
,render: function ()
{
var sql = (this.target) ? '`' + this.target + '`.' : '';
return sql + '`' + this.name + '`';
}
});