Top Tweets for #space_id
Was reviewing our database PRs for OpenPrompt OS tonight and found a gem my co-founder wired up on top of Prisma.
Relying purely on ‘WHERE space_id = ?’ in application code is always one forgotten filter away from a cross-tenant data leak. Instead of trusting the ORM alone, he added a custom SQL layer for Postgres Row-Level Security (RLS) + strict constraints:
- Every request runs ‘SET LOCAL https://t.co/cWAC1oGuDK_id’ inside the transaction
- ‘FORCE ROW LEVEL SECURITY’ on all tenant tables (‘saved_prompts’, ‘subscriptions’, ‘space_members’)
- XOR ‘CHECK’ constraints for guest vs. workspace usage counters
- Partial unique indexes to guarantee at most one active subscription per workspace
Even if an API route forgets a filter, Postgres blocks the leak at the database engine level. Huge shoutout to @m_praki for locking this in early.
Are you enforcing multi tenant isolation in Postgres RLS, or keeping checks in your API layer?
Most Popular Users

Elon Musk 
@elonmusk
239.8M followers

Barack Obama 
@barackobama
118.6M followers

Cristiano Ronaldo 
@cristiano
114.3M followers

Donald J. Trump 
@realdonaldtrump
111.7M followers

Narendra Modi 
@narendramodi
106.9M followers

Rihanna 
@rihanna
98.6M followers

NASA 
@nasa
92.1M followers

Justin Bieber 
@justinbieber
91.7M followers

KATY PERRY 
@katyperry
89.9M followers

Taylor Swift 
@taylorswift13
83.9M followers

Lady Gaga 
@ladygaga
75.4M followers

Virat Kohli 
@imvkohli
73.3M followers

Kim Kardashian 
@kimkardashian
70.8M followers

YouTube 
@youtube
68.6M followers

Neymar Jr 
@neymarjr
66.3M followers

Bill Gates 
@billgates
65.1M followers

Selena Gomez 
@selenagomez
63M followers

The Ellen Show
@theellenshow
62.1M followers

CNN 
@cnn
61.7M followers

X 
@x
60.6M followers
