Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

`Utopia\Database\Adapter::getIntLimit()` is not enforced

Abierto
#94 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
php
Área
databases

Línea de trabajo

Start with the createAttribute() check in src/Database/Database.php at the linked lines, then trace how integer attributes currently set $size and how adapters implement getIntLimit(). Compare the two enforcement options described in the issue and define the expected behavior for create and update paths. Done means integer limits are enforced consistently without relying on an unhandled PDO database exception.

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

Descripción

Each adapter must implement the getIntLimit() method, but it isn't enforced due to how we interpret $size for integer attributes.

In the case of strings, $size is pretty obvious - the length of the string. However, for integers (and before BIGINT), we just set $size = 0, so this check in createAttribute() would never actually prevent PDO from throwing the database exception:

https://github.com/utopia-php/database/blob/af512b7a00cc7c6e30fa03efbc5fd7e77a93e2df/src/Database/Database.php#L433-L437

Options to enforce int limit:

  • Check values for getIntLimit() as a filter when creating/updating documents
  • Get PDO error codes when size is exceeded and throw a custom Utopia\Database exception
Lenguaje dominante
PHP
Estrellas
74
Forks
59
Merge medio
10 h 45 min
PR fusionados (30 d)
20

Guía de contribución

Abrir la guía de contribución

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 utopia-php/database

Todos los issues de utopia-php/database

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.