Skip to content

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

Closed
@kaizendae

Description

@kaizendae

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

Metadata

Metadata

Assignees

Labels

backend:cliIssues relating to the CLI utilitybugLEGACY. Use the Bug issue type instead

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions