Skip to content

Commit

Permalink
support Geometry too
Browse files Browse the repository at this point in the history
  • Loading branch information
fengctor authored and wendigo committed Apr 29, 2024
1 parent 5a52680 commit fd368cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion trino/trino.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions trino/trino_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit fd368cb

Please sign in to comment.