declarative schema ignores grants with columns on views
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 65/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- postgresql, sql, typescript
Línea de trabajo
Look at the declarative schema sync logic in the CLI, likely in a file handling PostgreSQL grants and view parsing. The issue is that column-specific grants on views are not being output. Start by searching for 'GRANT' and 'VIEW' in the codebase, then examine how grants are collected and compared. The test case provided gives a clear reproduction; verify the missing grant statement is generated. Check the output of the sync command against the expected SQL.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Affected area
Database
Supabase CLI version
v2.117.0
Operating system
macOS
Installation method
brew
Command
supabase db schema declarative sync
Actual output
CREATE TABLE "private"."items" (
"id" integer NOT NULL,
"name" text NOT NULL,
"is_active" boolean NOT NULL DEFAULT true,
CONSTRAINT "items_pkey" PRIMARY KEY (id)
);
CREATE VIEW "api"."items" WITH (security_invoker=true) AS SELECT id,
name,
is_active
FROM private.items;
GRANT INSERT ("name") ON TABLE "private"."items" TO "authenticated";
GRANT DELETE, INSERT, MAINTAIN, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON TABLE "private"."items" TO "postgres", "service_role";
GRANT DELETE, INSERT, MAINTAIN, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON TABLE "api"."items" TO "postgres", "service_role";
Expected behavior
Output should include the missing grant statement as described in "steps to reproduce" section
GRANT INSERT ("name") ON TABLE "api"."items" TO "authenticated";
Steps to reproduce
- Create minimal declaration files:
supabase/database/private/schema.sql
CREATE SCHEMA "private";
GRANT CREATE, USAGE ON SCHEMA "private" TO "postgres";
GRANT USAGE ON SCHEMA "private" TO "service_role", "supabase_auth_admin";
supabase/database/api/schema.sql
CREATE SCHEMA "api";
GRANT USAGE ON SCHEMA "api" TO "authenticated";
GRANT CREATE, USAGE ON SCHEMA "api" TO "postgres";
GRANT USAGE ON SCHEMA "api" TO "service_role";
supabase/database/private/tables/items.sql
CREATE TABLE "private"."items"(
"id" integer NOT NULL PRIMARY KEY,
"name" text NOT NULL,
"is_active" boolean NOT NULL DEFAULT TRUE
);
GRANT DELETE, INSERT, MAINTAIN, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON TABLE "private"."items" TO "postgres", "service_role";
GRANT INSERT ("name") ON TABLE "private"."items" TO "authenticated";
supabase/database/api/views/.sql
CREATE VIEW "api"."items" WITH ( security_invoker = TRUE
) AS
SELECT
id,
name,
is_active
FROM
private.items;
GRANT DELETE, INSERT, MAINTAIN, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON TABLE "api"."items" TO "postgres", "service_role";
GRANT INSERT ("name") ON TABLE "api"."items" TO "authenticated";
- Execute
supabase db schema declarative sync
Crash report ID
No response
Docker and service versions
Additional context
No response
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.4k
- Forks
- 523
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 287
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de supabase/cli
-
🐛 Bug supabase/cli
-
🐛 Bug supabase/cli
-
🐛 Bug supabase/cli
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
-
🐛 Bug supabase/cli
-
🐛 Bug supabase/cli
Todos los issues de supabase/cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
receptron/mulmoterminal#2264 ·
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
components-web-app/docs#96 ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
simonsobs/tileviewer#114 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100