hyperf / hyperf/database

功能请求:添加更多 JSON 类型映射支持

Abierto
#27 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
PHP
Estrellas
20
Forks
18
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

目前 `ModelUpdateVisitor` 中的 [`formatDatabaseType`](https://github.com/hyperf/database/blob/66a65f726ed8fd08c383d085611e61046d802064/src/Commands/Ast/ModelUpdateVisitor.php#L399) 方法仅支持基础的类型映射。希望能添加对更多 JSON 相关数据库类型的支持,以提高对不同数据库系统的兼容性。

```php
protected function formatDatabaseType(string $type): ?string
{
return match ($type) {
'tinyint', 'smallint', 'mediumint', 'int', 'bigint' => 'integer',
'bool', 'boolean' => 'boolean',
'json' => 'json',
default => null,
};
}
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start in src/Commands/Ast/ModelUpdateVisitor.php at formatDatabaseType, and inspect the surrounding type-mapping logic and database-related tests. Identify which additional JSON database types the supported systems expose, then add mappings and verify that the visitor produces the expected normalized types; the issue does not specify the exact types or test file.

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

Evaluación

Stack tecnológico
php
Área
databases
Tipo de issue
Nueva funcionalidad
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Tranquilo
Claridad
Necesita aclaración
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.