From cafb625e7862637e69cb129f5642dad4d5c810a0 Mon Sep 17 00:00:00 2001 From: Steven Eubank Date: Mon, 31 Aug 2026 11:30:05 +0200 Subject: [PATCH] fix(lints)urls-and-level lint 20 and 21, table bloat and fkey to auth unique advisros both were missing the correct link to docs, which is also less useful for agents. So this replaces the remediation text with a link to the docs which has that info and more I am also updating the performance advisors for table bloat to be a WARN and not just info. In the future for example i will add a lint for autovacuum off, that is an info. This is a current problem and should be a warning. test i understand via vibes that i should update, will need a review --- lints/0020_table_bloat.sql | 4 ++-- lints/0021_fkey_to_auth_unique.sql | 2 +- splinter.sql | 6 +++--- test/expected/0021_fkey_to_auth_unique.out | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lints/0020_table_bloat.sql b/lints/0020_table_bloat.sql index 76e69be..0704a84 100644 --- a/lints/0020_table_bloat.sql +++ b/lints/0020_table_bloat.sql @@ -69,7 +69,7 @@ bloat_data as ( select 'table_bloat' as name, 'Table Bloat' as title, - 'INFO' as level, + 'WARN' as level, 'EXTERNAL' as facing, array['PERFORMANCE'] as categories, 'Detects if a table has excess bloat and may benefit from maintenance operations like vacuum full or cluster.' as description, @@ -78,7 +78,7 @@ select bloat_data.schemaname, bloat_data.object_name ) as detail, - 'Consider running vacuum full (WARNING: incurs downtime) and tweaking autovacuum settings to reduce bloat.' as remediation, + 'https://supabase.com/docs/guides/database/database-linter?lint=0020_table_bloat' as remediation, jsonb_build_object( 'schema', bloat_data.schemaname, 'name', bloat_data.object_name, diff --git a/lints/0021_fkey_to_auth_unique.sql b/lints/0021_fkey_to_auth_unique.sql index a3c308f..dc93aa1 100644 --- a/lints/0021_fkey_to_auth_unique.sql +++ b/lints/0021_fkey_to_auth_unique.sql @@ -13,7 +13,7 @@ select c_rel.relname, -- referencing table c.conname -- fkey name ) as detail, - 'Drop the foreign key constraint that references the auth schema.' as remediation, + 'https://supabase.com/docs/guides/database/database-linter?lint=0021_fkey_to_auth_unique' as remediation, jsonb_build_object( 'schema', n.nspname, 'name', c_rel.relname, diff --git a/splinter.sql b/splinter.sql index 9cd66c9..3c25786 100644 --- a/splinter.sql +++ b/splinter.sql @@ -1074,7 +1074,7 @@ bloat_data as ( select 'table_bloat' as name, 'Table Bloat' as title, - 'INFO' as level, + 'WARN' as level, 'EXTERNAL' as facing, array['PERFORMANCE'] as categories, 'Detects if a table has excess bloat and may benefit from maintenance operations like vacuum full or cluster.' as description, @@ -1083,7 +1083,7 @@ select bloat_data.schemaname, bloat_data.object_name ) as detail, - 'Consider running vacuum full (WARNING: incurs downtime) and tweaking autovacuum settings to reduce bloat.' as remediation, + 'https://supabase.com/docs/guides/database/database-linter?lint=0020_table_bloat' as remediation, jsonb_build_object( 'schema', bloat_data.schemaname, 'name', bloat_data.object_name, @@ -1117,7 +1117,7 @@ select c_rel.relname, -- referencing table c.conname -- fkey name ) as detail, - 'Drop the foreign key constraint that references the auth schema.' as remediation, + 'https://supabase.com/docs/guides/database/database-linter?lint=0021_fkey_to_auth_unique' as remediation, jsonb_build_object( 'schema', n.nspname, 'name', c_rel.relname, diff --git a/test/expected/0021_fkey_to_auth_unique.out b/test/expected/0021_fkey_to_auth_unique.out index d854884..be1fd88 100644 --- a/test/expected/0021_fkey_to_auth_unique.out +++ b/test/expected/0021_fkey_to_auth_unique.out @@ -12,9 +12,9 @@ begin; ); -- 1 issue - fkey ref to unique constraint select * from lint."0021_fkey_to_auth_unique"; - name | title | level | facing | categories | description | detail | remediation | metadata | cache_key ----------------------+---------------------------------------+-------+----------+------------+-----------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+------------------------------------------------------------------+-------------------------------------------------------------------+-------------------------------------------- - fkey_to_auth_unique | Foreign Key to Auth Unique Constraint | ERROR | EXTERNAL | {SECURITY} | Detects user defined foreign keys to unique constraints in the auth schema. | Table `public`.`foo` has a foreign key `foo_un_fkey` referencing an auth unique constraint | Drop the foreign key constraint that references the auth schema. | {"name": "foo", "schema": "public", "foreign_key": "foo_un_fkey"} | fkey_to_auth_unique_public_foo_foo_un_fkey + name | title | level | facing | categories | description | detail | remediation | metadata | cache_key +---------------------+---------------------------------------+-------+----------+------------+-----------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------+-------------------------------------------- + fkey_to_auth_unique | Foreign Key to Auth Unique Constraint | ERROR | EXTERNAL | {SECURITY} | Detects user defined foreign keys to unique constraints in the auth schema. | Table `public`.`foo` has a foreign key `foo_un_fkey` referencing an auth unique constraint | https://supabase.com/docs/guides/database/database-linter?lint=0021_fkey_to_auth_unique | {"name": "foo", "schema": "public", "foreign_key": "foo_un_fkey"} | fkey_to_auth_unique_public_foo_foo_un_fkey (1 row) -- Alter the table adding another fkey based on id @@ -26,9 +26,9 @@ begin; references auth.users(id); -- 1 issue - still only 1 issue because the pkey constraint is okay select * from lint."0021_fkey_to_auth_unique"; - name | title | level | facing | categories | description | detail | remediation | metadata | cache_key ----------------------+---------------------------------------+-------+----------+------------+-----------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+------------------------------------------------------------------+-------------------------------------------------------------------+-------------------------------------------- - fkey_to_auth_unique | Foreign Key to Auth Unique Constraint | ERROR | EXTERNAL | {SECURITY} | Detects user defined foreign keys to unique constraints in the auth schema. | Table `public`.`foo` has a foreign key `foo_un_fkey` referencing an auth unique constraint | Drop the foreign key constraint that references the auth schema. | {"name": "foo", "schema": "public", "foreign_key": "foo_un_fkey"} | fkey_to_auth_unique_public_foo_foo_un_fkey + name | title | level | facing | categories | description | detail | remediation | metadata | cache_key +---------------------+---------------------------------------+-------+----------+------------+-----------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------+-------------------------------------------- + fkey_to_auth_unique | Foreign Key to Auth Unique Constraint | ERROR | EXTERNAL | {SECURITY} | Detects user defined foreign keys to unique constraints in the auth schema. | Table `public`.`foo` has a foreign key `foo_un_fkey` referencing an auth unique constraint | https://supabase.com/docs/guides/database/database-linter?lint=0021_fkey_to_auth_unique | {"name": "foo", "schema": "public", "foreign_key": "foo_un_fkey"} | fkey_to_auth_unique_public_foo_foo_un_fkey (1 row) drop table public.foo;