cube-js / cube

📊 Cube — The Semantic Layer for Building Data Applications
https://cube.dev
Other
17.85k stars 1.77k forks source link

Adding custom fields to data model schema and retrieving them through API v1/meta #7148

Open techspyne opened 1 year ago

techspyne commented 1 year ago

Is your feature request related to a problem? Please describe.

We would like to use Cube schema as the single source of truth for our SaaS data model, and need to add some data related to how each metric should be described / displayed on the front end. For example, should it be displayed with a specific prefix or suffix (e.g. € or %), how many digits should be displayed, what is the description for each metric ...

Describe the solution you'd like

Two evolutions to data model and API v1/meta would be needed:

Describe alternatives you've considered

Currently our solution is to include a stringified json "description" field in the Cube data models (other names are not accepted), and have our SaaS connect to our Github repo to get the code and parse it, which is fare from optimal

Thanks in advance for your help !

igorlukanin commented 1 year ago

Hey @techspyne 👋 I think that meta options for measures and dimensions are exactly what you're looking for: https://cube.dev/docs/product/data-modeling/reference/dimensions#meta