LQL→PostgreSQL transpiler emits unquoted column identifiers in pipeline SQL (mixed-case columns case-fold)

Abierto
#84 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
csharp, postgresql, sqlite

Línea de trabajo

Start at RlsPredicateTranspiler.TranslateExistsSubquery and inspect RlsPredicateTranspiler.TriggerGuard.cs, including the QuotePipelineIdentifiersForPostgres workaround. Compare the transpiled PostgreSQL identifiers with the existing DDL quoting, then run PgTriggerGuard_PascalCaseIdentifiers_EnforcedAtRuntime and add the described RLS parity coverage. Done means mixed-case columns work on both SQLite and PostgreSQL and the workaround can be removed.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

Problem

LQL is database platform INDEPENDENT and must behave identically on every platform it transpiles to (CLAUDE.md mandate). The LQL→PostgreSQL transpilation path emits unquoted column identifiers in pipeline SQL (e.g. filter(fn(m) => m.TenantId = ...) → m.TenantId). PostgreSQL case-folds unquoted identifiers to lowercase, so any schema with mixed-case (quoted) column names fails at runtime with 42703 column does not exist — while the identical LQL works fine on SQLite (case-insensitive identifiers).

Where it bites today

  • RLS policy predicates (RlsPredicateTranspiler.TranslateExistsSubquery): the exists() pipeline path emits bare identifiers. Latent bug for any RLS schema using PascalCase columns on Postgres.
  • Declarative trigger guards (issue #82): hit this during E2E testing. Worked around in RlsPredicateTranspiler.TriggerGuard.cs via QuotePipelineIdentifiersForPostgres, which post-processes the transpiled subquery SQL to quote bare identifiers. See regression test PgTriggerGuard_PascalCaseIdentifiers_EnforcedAtRuntime in PostgresDeclarativeTriggerE2ETests.

Correct fix

The core LQL→SQL transpiler should quote all identifiers it emits for PostgreSQL (matching how the DDL generators already quote), so:

  1. The QuotePipelineIdentifiersForPostgres workaround in the trigger-guard path can be deleted.
  2. The RLS policy exists() path gets the same fix (currently unprotected).
  3. SQLite/Postgres behaviour is provably identical for mixed-case schemas (add parity E2E tests).

Acceptance

  • Same LQL predicate over a PascalCase-column table produces working SQL on both SQLite and Postgres.
  • Trigger-guard workaround removed; PgTriggerGuard_PascalCaseIdentifiers_EnforcedAtRuntime still green.
  • New RLS parity test with PascalCase columns green on both platforms.
Lenguaje dominante
C#
Estrellas
68
Forks
4
Merge medio
50 min
PR fusionados (30 d)
2

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Nimblesite/DataProvider

Todos los issues de Nimblesite/DataProvider

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.