From fd368cb6e24cce3e2f7b7594a7858201a9510161 Mon Sep 17 00:00:00 2001 From: Gary Feng Date: Mon, 29 Apr 2024 13:58:55 -0400 Subject: [PATCH] support Geometry too --- trino/trino.go | 2 +- trino/trino_test.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/trino/trino.go b/trino/trino.go index e16bdb8..4c46158 100644 --- a/trino/trino.go +++ b/trino/trino.go @@ -1469,7 +1469,7 @@ func (c *typeConverter) ConvertValue(v interface{}) (driver.Value, error) { return nil, err } return vv.Bool, err - case "json", "char", "varchar", "varbinary", "interval year to month", "interval day to second", "decimal", "ipaddress", "uuid", "SphericalGeography", "unknown": + case "json", "char", "varchar", "varbinary", "interval year to month", "interval day to second", "decimal", "ipaddress", "uuid", "Geometry", "SphericalGeography", "unknown": vv, err := scanNullString(v) if !vv.Valid { return nil, err diff --git a/trino/trino_test.go b/trino/trino_test.go index 31b9d99..6c29884 100644 --- a/trino/trino_test.go +++ b/trino/trino_test.go @@ -1419,6 +1419,13 @@ func TestTypeConversion(t *testing.T) { []interface{}{"b"}, }, }, + { + DataType: "Geometry", + RawType: "Geometry", + ResponseUnmarshalledSample: "Point (0 0)", + ExpectedGoValue: "Point (0 0)", + }, + { DataType: "SphericalGeography", RawType: "SphericalGeography",