hyperf / hyperf/database

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

Ouverte
#27 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
PHP
Étoiles
20
Forks
18
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

目前 `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,
};
}
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
php
Domaine
databases
Type d'issue
Fonctionnalité
Difficulté
2/5
Temps estimé
1-3 heures
Activité
Calme
Clarté
À clarifier
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.