rill icon indicating copy to clipboard operation
rill copied to clipboard

Support query specific attributes for drivers

Open grahamplata opened this issue 2 months ago • 1 comments

Support query specific attributes for ClickHouse. This enables end users to enrich queries and leverage our internal routing to our row_filters.

ClickHouse Docs: custom settings

Example with ClickHouse SQL and Yaml

-- models/metrics.yaml
type: metrics_view
model: metrics

# ...snip

query_attributes:
  prefix_partner_id: '{{ .user.partner_id }}'

Relates to: https://github.com/rilldata/rill/pull/8120 Custom user attributes support

After the above is merged I can leverage the security context for {{ .user.specific }} attributes

Checklist:

  • [x] Covered by tests
  • [x] Ran it and it works as intended
  • [x] Reviewed the diff before requesting a review
  • [ ] Checked for unhandled edge cases
  • [x] Linked the issues it closes
  • [ ] Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • [x] Intend to cherry-pick into the release branch
  • [x] I'm proud of this work!

grahamplata avatar Nov 05 '25 19:11 grahamplata

Updated test instance to support sql_ prefix for query attribute testing Docs: custom settings

grahamplata avatar Nov 13 '25 15:11 grahamplata