From fe0f4ee99681ecdce87e9c230d92ca5dd0df5eb3 Mon Sep 17 00:00:00 2001 From: Zerkath <24889977+Zerkath@users.noreply.github.com> Date: Fri, 2 May 2025 15:27:42 +0300 Subject: [PATCH 1/2] fix: missing numeric type mappings --- internal/core/postgresql_type.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/core/postgresql_type.go b/internal/core/postgresql_type.go index ce53e19..c8dbb27 100644 --- a/internal/core/postgresql_type.go +++ b/internal/core/postgresql_type.go @@ -11,28 +11,28 @@ func postgresType(req *plugin.GenerateRequest, col *plugin.Column) (string, bool columnType := sdk.DataType(col.Type) switch columnType { - case "serial", "pg_catalog.serial4": + case "serial", "serial4", "pg_catalog.serial4": return "Int", false - case "bigserial", "pg_catalog.serial8": + case "bigserial", "serial8", "pg_catalog.serial8": return "Long", false - case "smallserial", "pg_catalog.serial2": + case "smallserial", "serial2", "pg_catalog.serial2": return "Short", false case "integer", "int", "int4", "pg_catalog.int4": return "Int", false - case "bigint", "pg_catalog.int8": + case "bigint", "int8", "pg_catalog.int8": return "Long", false - case "smallint", "pg_catalog.int2": + case "smallint", "int2", "pg_catalog.int2": return "Short", false - case "float", "double precision", "pg_catalog.float8": + case "float", "double precision", "float8", "pg_catalog.float8": return "Double", false - case "real", "pg_catalog.float4": + case "real", "float4", "pg_catalog.float4": return "Float", false case "pg_catalog.numeric": From 70219f54ecce7b7f7b69ea12522edb215b94c40e Mon Sep 17 00:00:00 2001 From: Zerkath <24889977+Zerkath@users.noreply.github.com> Date: Fri, 2 May 2025 15:35:22 +0300 Subject: [PATCH 2/2] fix: missing numeric & dates --- internal/core/postgresql_type.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/core/postgresql_type.go b/internal/core/postgresql_type.go index c8dbb27..98d4b83 100644 --- a/internal/core/postgresql_type.go +++ b/internal/core/postgresql_type.go @@ -35,7 +35,7 @@ func postgresType(req *plugin.GenerateRequest, col *plugin.Column) (string, bool case "real", "float4", "pg_catalog.float4": return "Float", false - case "pg_catalog.numeric": + case "numeric", "pg_catalog.numeric": return "java.math.BigDecimal", false case "bool", "pg_catalog.bool": @@ -52,13 +52,13 @@ func postgresType(req *plugin.GenerateRequest, col *plugin.Column) (string, bool // Date and time mappings from https://jdbc.postgresql.org/documentation/head/java8-date-time.html return "LocalDate", false - case "pg_catalog.time", "pg_catalog.timetz": + case "time", "pg_catalog.time", "timetz", "pg_catalog.timetz": return "LocalTime", false - case "pg_catalog.timestamp": + case "timestamp", "pg_catalog.timestamp": return "LocalDateTime", false - case "pg_catalog.timestamptz", "timestamptz": + case "timestamptz", "pg_catalog.timestamptz": // TODO return "OffsetDateTime", false