mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 12:04:04 +00:00
perf(rls): wrap current_setting() in the generated tenant policy for per-statement eval
This commit is contained in:
parent
7a1a2162ac
commit
a09ea63967
1 changed files with 2 additions and 2 deletions
|
|
@ -279,7 +279,7 @@ test('trait rls manager generates queries correctly', function() {
|
|||
expect($manager->generateQueries())->toContain(
|
||||
<<<SQL
|
||||
CREATE POLICY posts_rls_policy ON posts USING (
|
||||
tenant_id::text = current_setting('my.current_tenant')
|
||||
tenant_id::text = (select current_setting('my.current_tenant'))
|
||||
);
|
||||
SQL,
|
||||
<<<SQL
|
||||
|
|
@ -287,7 +287,7 @@ test('trait rls manager generates queries correctly', function() {
|
|||
post_id IN (
|
||||
SELECT id
|
||||
FROM posts
|
||||
WHERE tenant_id::text = current_setting('my.current_tenant')
|
||||
WHERE tenant_id::text = (select current_setting('my.current_tenant'))
|
||||
)
|
||||
);
|
||||
SQL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue