You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have a project that uses Postgis to handle geospatial data. The issue is that columns using any Postgis types are generated with the postgres.ColumnString type. So when I try to make an insert with the following code the result is wrapped with a string, so postgres never executes the postgis functions.
In the output the value is surrounded by single quotes, so postgres treats it as text instead of geography(POINT, 4326).
Is there any way I could handle this case?
Environment:
OS: linux
Database: postgres
Database driver: pq
Jet version: 2.11.0
Code snippet
Here's the minimal SQL schema to get this to work. this does assume Postgis is installed (see installation instructions here)
CREATE EXTENSION IF NOT EXISTS postgis;
CREATETABLE "address" (
"id"BIGSERIAL UNIQUE PRIMARY KEY,
"coordinates" geography(POINT, 4326) NOT NULL
);
Expected behavior
The insert should return without surrounding the value for column coordinate with single quotes. Like so:
Can Jet generate these types? When I take a look at the database I clearly see all the data types geometry, geography, and all the functions associated with these types. But Jet doesn't seem to generate these types. However, when I create enum types they seem to be getting generated properly as their corresponding go types.
Hi @ayaanqui, geometry, geography and some other types are currently unsupported. All unsupported types are always generated as string. Using generator customization developers can overwrite this behavior, with their types.
Enum types are supported.
Describe the bug
I have a project that uses Postgis to handle geospatial data. The issue is that columns using any Postgis types are generated with the
postgres.ColumnString
type. So when I try to make an insert with the following code the result is wrapped with a string, so postgres never executes the postgis functions.The code above returns this output when use the debugger function:
In the output the value is surrounded by single quotes, so postgres treats it as
text
instead ofgeography(POINT, 4326)
.Is there any way I could handle this case?
Environment:
Code snippet
Here's the minimal SQL schema to get this to work. this does assume Postgis is installed (see installation instructions here)
Expected behavior
The insert should return without surrounding the value for column
coordinate
with single quotes. Like so:The text was updated successfully, but these errors were encountered: