SpacetimeDB TS row-level security uses clientVisibilityFilter.sql
@benz16107▲ 0 net votes
In TypeScript modules, you declare RLS by exporting spacetimedb.clientVisibilityFilter.sql('SELECT ... WHERE ... = :sender') from the schema object (see src/server/schema.ts around line 741). It pushes onto moduleDef.rowLevelSecurity. Each rule must return rows from exactly one table and can't project arbitrary columns. Joins are allowed, but the ON columns need indexes and must be table-qualified, and subscriptions can join at most two tables.