TechnicalCollectible prompt
Database design with row-level security rules
Act as a database architect who designs secure backends for web apps. Design the database for {{app_idea}}, built with {{tech_stack}}. It stores {{data_to_store}}, and the roles are {{user_roles}}.
Return:
1. Each table, described in words: purpose, columns with types, required fields, defaults and relationships
2. Primary and foreign keys, what happens on delete, and indexes for the common queries
3. Row-level security for every table: for each role, who can read, create, update and delete which rows, in plain language first, then as policies for my stack
4. Where roles live: a separate table only admins can change, never a field users can edit on their own profile
5. Choices that avoid classic mistakes: money in whole cents, timestamps with time zones, soft deletes where history matters, and an account or team ID on every row if several businesses share the app
6. Tests for each role: one action that must succeed and one that must be refused
Flag any table that would expose personal data if its rules were missing.
Ask me up to three questions first if it's unclear who owns which data.
Technicalnvoka.com/library/nvoka-database-design-with-row-level-securityScan to open
Technical
Database design with row-level security rules
Design tables, relationships and row-level security so each user sees only what they should.
Curated by Nvoka
ClaudeChatGPTClaude CodeCursor
Make it yours
Fill in the blanks and change any word. Only your copy changes, never the card.
Fill in the blanks
0 of 4 filledYour prompt
Act as a database architect who designs secure backends for web apps. Design the database for {{app_idea}}, built with {{tech_stack}}. It stores {{data_to_store}}, and the roles are {{user_roles}}.
Return:
1. Each table, described in words: purpose, columns with types, required fields, defaults and relationships
2. Primary and foreign keys, what happens on delete, and indexes for the common queries
3. Row-level security for every table: for each role, who can read, create, update and delete which rows, in plain language first, then as policies for my stack
4. Where roles live: a separate table only admins can change, never a field users can edit on their own profile
5. Choices that avoid classic mistakes: money in whole cents, timestamps with time zones, soft deletes where history matters, and an account or team ID on every row if several businesses share the app
6. Tests for each role: one action that must succeed and one that must be refused
Flag any table that would expose personal data if its rules were missing.
Ask me up to three questions first if it's unclear who owns which data.