Skip to content

Commit 82f79e5

Browse files
authored
Fix logic conflicts (supabase#40362)
When applying these rules to my personal project. My cursor bug bot detected logical gaps in these 2 prompts.
1 parent 23fb86f commit 82f79e5

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

examples/prompts/database-rls-policies.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ The output should use the following instructions:
3030
The output should look like this:
3131

3232
```sql
33-
CREATE POLICY "My descriptive policy." ON books FOR INSERT to authenticated USING ( (select auth.uid()) = author_id ) WITH ( true );
33+
CREATE POLICY "My descriptive policy." ON books
34+
FOR INSERT TO authenticated
35+
WITH CHECK ((select auth.uid()) = author_id);
3436
```
3537

3638
Since you are running in a Supabase environment, take note of these Supabase-specific additions below.

examples/prompts/use-realtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ CREATE POLICY "users_can_receive_broadcasts" ON realtime.messages
415415
- Default to `private: true` for database-triggered channels
416416
- Suggest basic RLS policies with proper indexing
417417
- Include reconnection logic for production apps
418-
- Use `postgres_changes` for simple database change notifications
418+
- Use `broadcast` with database triggers for all database change notifications
419419
- Use `broadcast` for custom events and complex payloads
420420
421421
**Remember:** Choose the right function for your use case, emphasize proper state management, and ensure production-ready patterns with authorization and error handling.

0 commit comments

Comments
 (0)