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

55 lines
676 B
JavaScript

var Target = require ('./target');
var ListHolder = require ('./list-holder');
/**
* The equivalent of a SQL join.
*/
var Klass = new Class ();
module.exports = Klass;
var Type = {
INNER : 0,
LEFT : 1,
RIGHT : 2
};
Klass.extend
({
Type: Type
});
Klass.implement
({
Extends: Target
,Implements: ListHolder
,Tag: 'sql-join'
,Properties:
{
/**
* The right targets.
*/
targets:
{
type: Array
,set: function (x)
{
this.list = x;
}
,get: function ()
{
return this.list;
}
}
}
,render: function (params)
{
return '('
+ this.target.render (params)
+ ' '
+ this.renderList (this.list, params)
+ ')';
}
});