Skip to content

Commit

Permalink
support Geography values as WKT strings
Browse files Browse the repository at this point in the history
  • Loading branch information
fengctor authored and wendigo committed Apr 29, 2024
1 parent d61b3c2 commit 5a52680
Show file tree
Hide file tree
Showing 2 changed files with 7 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", "unknown":
case "json", "char", "varchar", "varbinary", "interval year to month", "interval day to second", "decimal", "ipaddress", "uuid", "SphericalGeography", "unknown":
vv, err := scanNullString(v)
if !vv.Valid {
return nil, err
Expand Down
6 changes: 6 additions & 0 deletions trino/trino_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,12 @@ func TestTypeConversion(t *testing.T) {
[]interface{}{"b"},
},
},
{
DataType: "SphericalGeography",
RawType: "SphericalGeography",
ResponseUnmarshalledSample: "Point (0 0)",
ExpectedGoValue: "Point (0 0)",
},
}

for _, tc := range testcases {
Expand Down

0 comments on commit 5a52680

Please sign in to comment.