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

[BUG]: RLS "using" rule not applied to supabase #4078

Open
1 task done
SemStassen opened this issue Feb 5, 2025 · 0 comments
Open
1 task done

[BUG]: RLS "using" rule not applied to supabase #4078

SemStassen opened this issue Feb 5, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@SemStassen
Copy link

SemStassen commented Feb 5, 2025

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

0.38.2

What version of drizzle-kit are you using?

0.30.1

Other packages

No response

Describe the Bug

When pushing the DB schema to the remote - in my case SupaBase - RLS policies are added, however the USING clause is missing.

For example:

export const userPreferencesTable = pgTable(
  "user_preferences",
  {
    ...userPreferencesDefinition,
  },
  (t) => [
    pgPolicy("user_preferences_access_by_user_uuid", {
      as: "permissive",
      to: "public",
      for: "all",
      using: sql`false`,
    }),
  ],
);

Ends up in the SupaBase dashboard as:

alter policy "user_preferences_access_by_user_uuid"
on "public"."user_preferences"
to public
using (
    -- Provide a SQL expression for the using statement
);

The using clause is still empty.

I would greatly appreciate if this could be looked into!

EDIT:

I also noticed changes to the RLS rules are not picked up when pulling and pushing the schema.
It says no changes detected

@SemStassen SemStassen added the bug Something isn't working label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant