Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta
#94 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
25/100
Tipo de issue
Bug
Clareza
Precisa de esclarecimento
Status de atividade
Estagnada
Stack de tecnologia
php
Domínio
databases

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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
Linguagem predominante
PHP
Estrelas
74
Forks
61
Merge médio
1d 4h
PRs com merge (30d)
15

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de utopia-php/database

Todas as issues de utopia-php/database

Issues semelhantes

Mais issues de PHP

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.