Filter data in SQL with a user attribute
Last updated
Was this helpful?
Last updated
Was this helpful?
In this section, we'll explore the process of efficiently filtering tables using user attributes, utilizing the PostgreSQL connector as our example. This feature enables the dynamic application of row-level security, proving especially valuable in scenarios with a multi-tenant data architecture. In such setups, where data for all users is housed within a common table, our user-friendly approach empowers you to seamlessly implement and manage security measures tailored to your unique requirements.
Dive into the following guide to manage RLS directly within the SQL query:
When creating a dataset from a connector, switch to code-mode.
Write your SQL query to fetch data by filtering the data based on the user attribute (customer_key in the example below) by using the syntax {{user.attributes.your_attribute}}
More on variable syntaxes in this .