rill
rill copied to clipboard
Support query specific attributes for drivers
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!
Updated test instance to support sql_ prefix for query attribute testing Docs: custom settings