2016-09-26 09:28:47 +00:00
|
|
|
|
2022-06-06 08:53:59 +00:00
|
|
|
var Expr = require('./expr');
|
2016-09-26 09:28:47 +00:00
|
|
|
|
2015-01-23 13:09:30 +00:00
|
|
|
/**
|
|
|
|
* The equivalent of a SQL field.
|
|
|
|
*
|
|
|
|
* @param {string} taget The name of the owner table
|
2022-05-26 06:08:31 +00:00
|
|
|
*/
|
2022-06-06 08:53:59 +00:00
|
|
|
module.exports = new Class({
|
2016-09-26 09:28:47 +00:00
|
|
|
Extends: Expr
|
2015-01-23 13:09:30 +00:00
|
|
|
,Tag: 'sql-field'
|
2022-06-06 08:53:59 +00:00
|
|
|
,Properties: {
|
2022-05-30 01:30:33 +00:00
|
|
|
/**
|
|
|
|
* The column name.
|
|
|
|
*/
|
2022-06-06 08:53:59 +00:00
|
|
|
name: {
|
2015-01-23 13:09:30 +00:00
|
|
|
type: String
|
|
|
|
,value: null
|
|
|
|
},
|
2022-05-30 01:30:33 +00:00
|
|
|
/**
|
|
|
|
* The source table name or its alias if it has been specified.
|
|
|
|
*/
|
2022-06-06 08:53:59 +00:00
|
|
|
target: {
|
2015-01-23 13:09:30 +00:00
|
|
|
type: String
|
|
|
|
,value: null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-06 08:53:59 +00:00
|
|
|
,render: function() {
|
|
|
|
return this.renderPreIdent(this.target)
|
|
|
|
+ this.renderIdent(this.name);
|
2015-01-23 13:09:30 +00:00
|
|
|
}
|
|
|
|
});
|