feat: improve field type mapping and add sample dataset resource

- Update GUtils.java to handle case-insensitive column type mapping.
- Add "number" type mapping to support more database dialects.
- Add DevResources/Dataset.xml as a sample dataset definition.
This commit is contained in:
2026-03-02 13:23:42 +07:00
parent d501ecec22
commit 4cbfaed8c7
4 changed files with 63 additions and 2 deletions

View File

@@ -34,6 +34,7 @@ public class GUtils {
TYPE_MAPPING.put("float", "NUMBER");
TYPE_MAPPING.put("integer", "NUMBER");
TYPE_MAPPING.put("numeric", "NUMBER");
TYPE_MAPPING.put("number", "NUMBER");
TYPE_MAPPING.put("smallint", "NUMBER");
TYPE_MAPPING.put("timestamp", "DATE");
TYPE_MAPPING.put("text", "STRING");
@@ -80,7 +81,7 @@ public class GUtils {
public static String getFieldType(DasColumn column) {
String columnType = column.getDasType().toDataType().typeName;
String fieldType = TYPE_MAPPING.get(columnType);
String fieldType = TYPE_MAPPING.get(columnType.toLowerCase());
if (fieldType == null) {
fieldType = TYPE_MAPPING.getOrDefault(userDefType.getOrDefault(columnType, "varchar"), "Object");
}