[Feature Request] Supports @nullsNotDistinct column attribute
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
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- postgresql, sqlite, typescript
Línea de trabajo
This is a cross-dialect feature: the schema layer must accept a new @nullsNotDistinct column attribute, and the query/migration generators must emit NULLS NOT DISTINCT for postgresql and recent sqlite while compiling null-aware unique constraints for other dialects. Start by tracing how an existing attribute such as @unique is parsed and how unique indices are generated per provider, then run the provider test suites to see current coverage. Done means the attribute is accepted, NULLs compare equal for uniqueness on supporting databases, and documented fallbacks exist for the rest.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is your feature request related to a problem? Please describe.
There is currently no good way to enforce uniqueness on nullable columns when you want two NULL values considered the same.
Describe the solution you'd like
For postgresql & recent versions of sqlite, use NULLS NOT DISTINCT, for other DB, compile queries to null aware operators and their equivalent and @@unique to partial/filtered unique indices.
Describe alternatives you've considered
Use some sentinel values that is not NULL on that column or some generated column. However, whether as an ad-hoc solution or plugin implemented by the user, or as a plugin/new feature added to zenstack itself, it's messy to work with due to a lack of a common null-ish value across various data types except for NULL, as well as need to insert dummy rows to satisfy referential integrity constraint on other tables when the said column is a foreign key.
Additional context
If any support for databases like SQL Server or Oracle were to be added, we should still retain the default defined behavior of considering nulls to be distinct by generating queries and filtered unique indices to enforce the inverse, rather than allow the whims of individual DBMS to define the behavior.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.9k
- Forks
- 157
- Merge medio
- 11 h 42 min
- PR fusionados (30 d)
- 20
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 zenstackhq/zenstack
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
zenstackhq/zenstack#2873 ·
Los mantenedores suelen responder en 1 día
-
runtime
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
zenstackhq/zenstack#2868 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
zenstackhq/zenstack#2694 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
zenstackhq/zenstack#2659 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
zenstackhq/zenstack#2542 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de zenstackhq/zenstack
Issues similares
-
bug(sight): the dashboard's text truncations split surrogate pairs and show broken charactersAbiertocomponent:sight
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agentic-os-org/ANOLISA#6738 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug Durable Agents Observability (AI Telemetry) status: needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
mastra-ai/mastra#26470 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
paperclipai/paperclip#15630 ·
Los mantenedores suelen responder en 1 día
-
[good first issue, hacktoberfest] ⛩️ Add new Theme: Sakura Latte (good-first-issue)Posiblemente ocupada @PGrayCS la tomó hoy. Abiertocommunity first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
lingdojo/kana-dojo#31937 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
feature/cohorts feature/feature-flags team/feature-flags
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día