Skip to content

Conversation

@psteinroe
Copy link
Collaborator

@psteinroe psteinroe commented Nov 4, 2025

manually splits the splinter.sql file into generic and supabase-only rules during download in build.rs.

based on the existence of the roles, run either one or both.

also improved the url handling - no manual fix needed anymore.

- Remove empty line after outer attribute in pgls_diagnostics
- Replace useless format! with .to_string() in pgls_splinter
- Refactor loops to use .enumerate() and slice indexing in xtask_codegen
- Add clippy and git commit guidelines to AGENTS.md
Copy link
Collaborator

@juleswritescode juleswritescode left a comment

Choose a reason for hiding this comment

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

very cool! i like how you integrated this into the LSP!


let results = query::load_splinter_results(params.conn).await?;
// Only run Supabase-specific rules if the required roles exist
let has_supabase_roles = check_supabase_roles(params.conn).await?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice! curious: did the supabase team confirm that this check is the best way to identify a supabase database?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nope, but for squawk this is what is required to exist for the rules query to not crash :D

result
}

fn split_queries(content: &str) -> (String, String) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

as I understand it, rules are per default put into the generic category.
what happens if supabase adds a new rule to the spliter that's supabase-specific?
that might break linting in case a table isn't defined for non-supabase databases, right?
should we throw during build if there's an unknown rule in the splinter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

great catch!

Base automatically changed from feat/squawk to main November 7, 2025 15:52
@psteinroe psteinroe merged commit f415087 into main Nov 7, 2025
8 checks passed
@psteinroe psteinroe deleted the refactor/split-splinter-rules branch November 7, 2025 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.

3 participants