2016-09-26 09:28:47 +00:00
|
|
|
|
2022-05-30 01:30:33 +00:00
|
|
|
var Target = require ('./target');
|
2016-09-26 09:28:47 +00:00
|
|
|
|
2015-01-23 13:09:30 +00:00
|
|
|
/**
|
2016-09-26 09:28:47 +00:00
|
|
|
* Represents a database table.
|
2022-05-26 06:08:31 +00:00
|
|
|
*/
|
2016-09-26 09:28:47 +00:00
|
|
|
module.exports = new Class
|
2015-01-23 13:09:30 +00:00
|
|
|
({
|
2016-09-26 09:28:47 +00:00
|
|
|
Extends: Target
|
2015-01-23 13:09:30 +00:00
|
|
|
,Properties:
|
|
|
|
{
|
|
|
|
name:
|
|
|
|
{
|
|
|
|
type: String
|
|
|
|
,value: null
|
|
|
|
},
|
2022-05-30 01:30:33 +00:00
|
|
|
alias:
|
|
|
|
{
|
|
|
|
type: String
|
|
|
|
,value: null
|
|
|
|
},
|
2015-01-23 13:09:30 +00:00
|
|
|
schema:
|
|
|
|
{
|
|
|
|
type: String
|
|
|
|
,value: null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-30 01:30:33 +00:00
|
|
|
,render: function ()
|
|
|
|
{
|
|
|
|
var sql = this.renderPreIdent (this.schema)
|
|
|
|
+ this.renderIdent (this.name);
|
|
|
|
|
|
|
|
if (this.alias)
|
|
|
|
sql += ' AS '+ this.renderIdent (this.alias);
|
|
|
|
|
2015-01-23 13:09:30 +00:00
|
|
|
return sql;
|
|
|
|
}
|
|
|
|
});
|