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:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user