hyperf / hyperf/database

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

Đang mở
#27 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
PHP
Star
20
Fork
18
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
php
Lĩnh vực
databases
Loại issue
Tính năng
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.