Skip to content

Conversation

@psteinroe
Copy link
Collaborator

@psteinroe psteinroe commented Nov 1, 2025

adds a new pgls_splinter crate with the basic integration.

its not hooked up yet.

pr includes

  • the query execution
  • the transformation into splinter diagnostics
  • a codegen tool for the diagnostics categories that extracts them from the sql file
  • a build file that downloads and parses the splinter.sql file from the repo. its cached and committed. The build script is just a helper when we want to "upgrade". we only have to change the SHA in build.rs for that.
  • a check that splinter is only executed if supabase roles are in the target database

the query currently crashes when executed against a non-supabase database because of the calls to pg_catalog.has_table_privilege('anon', c.oid, 'SELECT') in some of the rules. for now, we skip splinter if the roles are not there. I opened an issue to ask for permission to add a flag to each rule so it can be used outside of supabase too: supabase/splinter#135. I would rather not make it our own just yet, but thats certainly a simple fix if things take too long.

UPDATE: manually split up the query into supabase-only and generic rules in a follow-up.

follow up prs will include:

  • refactoring of the analyser codegen so we can reuse it for other lint tools to generate config, docs etc
  • integration of the new DatabaseLocation attribute of the diagnostics struct (pr is open)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants