
supabase/splinter
Database managementЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
supabase / Splinter - кандидат на агентские навыки, импортированный из https://github.com/supabase/splinter.
Обзор
supabase / Splinter - кандидат на агентские навыки, импортированный из https://github.com/supabase/splinter.
Обзор (машинный перевод)
Документация: [[Т0]]
Исходный код: [[Т1]]
Splinter поддерживает набор штрихов для проектов Supabase. Он использует SQL-запросы для выявления общих проблем схемы базы данных. Некоторые шрифты являются общими для проектов Postgres, в то время как другие специфичны для функций Supabase, хранящих свои данные в Postgres, например, аут и хранилище.
Использование
Если вы заинтересованы только в создании проекта, один запрос, содержащий последнюю версию всех шрифтов, доступен в виде осколков. sql в корне репо.
API-разоблачения и pgrst.db_schemas
Несколько шрифтов (например, auth_users_exposed, materialized_view_in_api, foreign_table_in_api) сообщают только об объектах, которые доступны через API данных, то есть об объектах в схеме, перечисленной в pgrst.db_schemas. PostgREST устанавливает это значение во время выполнения, но оно ** не ** присутствует в простом соединении psql.
Когда pgrst.db_schemas не установлен, эти линты по умолчанию только для схемы public. Если ваш проект раскрывает дополнительные схемы, установите значение, чтобы соответствовать конфигурации PostgREST, прежде чем запускать винты, чтобы эти схемы также были покрыты:
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
splinter (Supabase Postgres LINTER)
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.
API-exposure lints and pgrst.db_schemas
Several lints (e.g. auth_users_exposed, materialized_view_in_api, foreign_table_in_api) only report objects that are reachable through the Data API — that is, objects in a schema listed in the pgrst.db_schemas setting. PostgREST sets this value at runtime, but it is not present in a plain psql connection.
When pgrst.db_schemas is unset, these lints default to the public schema only. If your project exposes additional schemas, set the value to match your PostgREST config before running the lints so those schemas are covered too:
set pgrst.db_schemas = 'public, graphql_public, ...';
Without this, exposures in non-public schemas will not be reported.
Lint Interface
Each lint creates a view that returns a common interface. The interface is:
- name (text) not null – Name of the lint
- title (text) not null – Human readable title of the lint
- level (text) not null – The level of issue. One of ERROR/WARN/INFO
- facing (text) not null – Is it an internal (to supabase) or an external (user centric) lint. One of INTERNAL/EXTERNAL
- categories (text[]) not null – Relevant tags for the issue. Any/All of SECURITY/PERFORMANCE (list may grow)
- description (text) not null – This is a description of the lint and why its an issue
- detail (text) not null – A text description of the issue that includes references to the specific table/column/constraint/whatever that fails the lint
- remediation (text) optional – A reference to documentation to describe the issue and how to resolve it
- metadata (jsonb) optional – Lint specific information, for example referenced entities, or entity types
Рекомендуемые инструменты
Попробуйте другой запрос или уберите фильтр.
Установка
npx skillfish add supabase/splinter