Skip to content
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

Update passing-dynamic-parameters-in-a-query.mdx #9384

Merged
merged 2 commits into from
Apr 8, 2025

Conversation

morgan-at-cube
Copy link
Contributor

FILTER_PARAMS should always be used in this use case to avoid a massive cross join. I also added a simpler code snippet that is easier to adapt to any use case rather than the original verbose version. cc @paco-valdez who I consulted on this approach.

Check List

  • Tests have been run in packages where changes made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Issue Reference this PR resolves

[For example #12]

Description of Changes Made (if issue reference is not provided)

[Description goes here]

FILTER_PARAMS should always be used in this use case to avoid a massive cross join. I also added a simpler code snippet that is easier to adapt to any use case rather than the original verbose version.
@github-actions github-actions bot added the pr:community Contribution from Cube.js community members. label Mar 24, 2025
@@ -77,7 +86,7 @@ cubes:
sql: id
type: count
filters:
- sql: "gender = 'female' and city = city_filter"
- sql: "gender = 'female'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's missing the closing double quote:

 - sql: "gender = 'female'"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops! Thanks for catching!! Added it back

@igorlukanin igorlukanin merged commit 09a94cb into cube-js:master Apr 8, 2025
1 check passed
@igorlukanin igorlukanin added the docs Issues that require a documentation improvement label Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Issues that require a documentation improvement pr:community Contribution from Cube.js community members.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants