Skip to content

How to valiadate cube.js schema when you have jinja syntax {{ }} in sql of the cubes #9506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kaizendae opened this issue Apr 23, 2025 · 0 comments
Labels
question The issue is a question. Please use Stack Overflow for questions.

Comments

@kaizendae
Copy link

kaizendae commented Apr 23, 2025

what is the go-to way to validate the schema with

npx cubejs-cli validate -p config/schema

when you have a cube like this example from the docs https://cube.dev/docs/reference/data-model/context-variables#security_context

cube(`orders`, {
  sql: `
    SELECT *
    FROM orders
    WHERE ${SECURITY_CONTEXT.email.filter("email")}
  `,
 
  dimensions: {
    date: {
      sql: `date`,
      type: `time`,
    },
  },
});

this results in an error such:

Cube Error ---------------------------------------

Cannot read properties of undefined (reading 'email')

Need some help? -------------------------------------

Ask this question in Cube Slack: https://slack.cube.dev
Post an issue: https://github.com/cube-js/cube.js/issues

@kaizendae kaizendae added the question The issue is a question. Please use Stack Overflow for questions. label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The issue is a question. Please use Stack Overflow for questions.
Projects
None yet
Development

No branches or pull requests

1 participant