Need to define a cube based on a Postgre sql User defined function with string parameter
- Dominant language
- Rust
- Stars
- 20.8k
- Forks
- 2.1k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 181
Description
**Problem**
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."
```js
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 an error.
Can someone help me here? Or guide me with proper way to create a cube using user-defined functions with parameters
Contributor guide
Assessment
This issue has not been assessed yet.