supabase / splinter

Supabase Postgres Linter
https://supabase.github.io/splinter/
68 stars 6 forks source link
linter postgres supabase

splinter (Supabase Postgres LINTER)

PostgreSQL version License tests


Documentation: https://supabase.github.io/splinter

Source Code: https://github.com/supabase/splinter


Splinter maintains a set of lints for Supabase projects. It uses SQL queries to identify common database schema issues. Some lints are general purpose for Postgres projects while others are specific to Supabase features storing their data in Postgres e.g. auth and storage.

Usage

If you are only interested in linting a project, a single query containing the latest version of all lints is availble in splinter.sql in the repo root.

Lint Interface

Each lint creates a view that returns a common interface. The interface is:

Deploying to supabase/supabase

To deploy lints to Supabase prod, open a PR against supabase/supabase updating the lint query

If the update includes a new lint, update getHumanReadableTitle and LINT_TYPES.

Example PR

Development

Supabase PostgreSQL 15+

Setup:

git clone https://github.com/supabase/splinter.git
cd splinter

Tests

All lints tests with a true positive example.

To run the test suite:

docker rmi -f dockerfiles-test && SUPABASE_VERSION=15.1.1.13 docker-compose -f dockerfiles/docker-compose.yml run --rm test