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

57 lines
771 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
var Expr = require ('./expr');
2022-05-30 01:30:33 +00:00
var ListHolder = require ('./list-holder');
2016-09-26 09:28:47 +00:00
/**
* The equivalent of a SQL function.
2022-05-26 06:08:31 +00:00
*/
2016-09-26 09:28:47 +00:00
module.exports = new Class
({
2016-09-26 09:28:47 +00:00
Extends: Expr
2022-05-30 01:30:33 +00:00
,Tag: 'sql-function'
,Implements: ListHolder
,Properties:
{
2022-05-30 01:30:33 +00:00
/**
* The function name.
*/
name:
{
type: String
,value: null
},
2022-05-30 01:30:33 +00:00
/**
* The function schema.
*/
schema:
{
type: String
,value: null
},
2022-05-30 01:30:33 +00:00
/**
* The function parameters.
*/
params:
{
2022-05-30 01:30:33 +00:00
type: Array
,set: function (x)
{
this.list = x;
}
,get: function ()
{
return this.list;
}
}
}
2022-05-30 01:30:33 +00:00
,render: function (params)
{
2022-05-30 01:30:33 +00:00
return this.renderPreIdent (this.schema)
+ this.renderIdent (this.name)
+ '('
+ this.renderListWs (this.list, params, ', ')
+ ')';
}
});