I have a requirement to create a cube that is based on an existing PostgreSQL user-defined function with a string parameter as input. And the parameters will be supplied from the Rest API call to Cube.js. Is it possible to build such a cube? Or what's the best way to implement it?
Below is a sample code I tried but it gives me an error "Referencev_value is not defined"
cube('New1', {
sql: () => SELECT * FROM test.ufn_function(${v_value}),
dimensions: {
is_total: {
sql: 'id',
type: 'number',
primary_key: true,
shown: true
},
"name": {
sql: '"name"',
type: 'number'
}
},
});
Related Cube.js-generated SQL
this is not getting generated due to error.
Can some one help me here?