Skip to content

feat: add read access functionality - #24

Merged
ptlc8 merged 3 commits into
masterfrom
kf/add-readonly
Oct 20, 2026
Merged

ptlc8 merged 3 commits into
masterfrom
kf/add-readonly

Conversation

@ptlc8

@ptlc8 ptlc8 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Adds a ReadAccess construct for existing and future PostgreSQL tables, with optional RLS bypass. Grants are additive and retained on removal.

@linear-code

linear-code Bot commented Oct 19, 2026

Copy link
Copy Markdown

CR-711

@greptile-apps

greptile-apps Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; the previous coverage gap is addressed and no new actionable issues were found.

Summary

Adds ReadAccess for existing and future PostgreSQL tables.

  • Existing PostgreSQL roles can read current and future tables.

Reviews (2) · Last reviewed commit: "add some test..." · Reviewed by Greptile

@ptlc8

ptlc8 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

GRANT USAGE ON SCHEMA ${schema} TO ${role};
GRANT SELECT ON ALL TABLES IN SCHEMA ${schema} TO ${role};
ALTER DEFAULT PRIVILEGES FOR ROLE ${creators} IN SCHEMA ${schema} GRANT SELECT ON TABLES TO ${role};
${bypass ? `ALTER ROLE ${role} BYPASSRLS;` : ""}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

quibble: setting to false is a no-op, and the correct way to remove it is to set NOBYPASSRLS. I don't see why we'd be removing it, but if we do, we'll have to manually change it in the db.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The goal of this was to had the bypass or leave it to the default
but you're right it can be counterintuitive, I juste renamed the option to grantBypassRls instead of bypassRls

@ptlc8
ptlc8 merged commit ac57802 into master Oct 20, 2026
1 check passed
@ptlc8
ptlc8 deleted the kf/add-readonly branch October 20, 2026 16:25
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.

2 participants