Skip to content

Added RLS to llms.txt #321

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Added RLS to llms.txt #321

wants to merge 2 commits into from

Conversation

cloutiertyler
Copy link
Contributor

This PR primarily adds information about RLS to the llms.txt file. I also have added some basic cursor rules.

Testing

I vibe-coded a typescript chat client using the llms.txt file.

Copy link
Contributor

@joshua-spacetime joshua-spacetime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please tell me the AI generated its own llms.txt

Comment on lines +812 to +815
Row Level Security (RLS) allows module authors to grant clients access to specific rows
of tables that are *not* marked as `public`. By default, tables without the `public`
attribute are private and inaccessible to clients. RLS provides a mechanism to selectively
expose certain rows from these private tables based on rules evaluated for each client.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite. Private tables are always private. Access to public tables can be restricted by declaring RLS rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hold on, I don't think that's right though based on my testing. I assumed that was the case, but when I did it the behavior was the opposite. In fact I have a VOD:

https://www.twitch.tv/videos/2436221037?t=02h35m47s

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, actually this is the link: https://www.twitch.tv/videos/2436221037?t=02h31m01s


SpacetimeDB allows defining row-level security rules using the `#[spacetimedb::client_visibility_filter]` attribute. This attribute is applied to a `const` binding of type `Filter` and defines an SQL-like query that determines which rows of a table are visible to clients making subscription requests.
Tables marked `public` are always fully visible to any client that subscribes to them,
and RLS rules do not apply to (and cannot restrict access to) `public` tables.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patently false :)


**How It Works**

RLS rules are attached to private tables (tables without `#[table(..., public)]`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RLS rules are attached to private tables (tables without `#[table(..., public)]`)
RLS rules are attached to public tables (tables with `#[table(..., public)]`)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants