This module provides a simple wrapper that allows PostGIS geometry types to be used in Bun.
It builds on the awesome ewkb
support already in Orb.
Only pgx supported
Supports Point/MultiPoint, Linestring/MultiLinestring, Polygon/MultiPolygon.
Use it in a struct and tag the type appropriately if you want Bun to be able to create the table:
type SampleStruct struct {
bun.BaseModel `bun:"bunpostgis_test_table"`
GeoField bunpostgis.PostgisGeometry `bun:"type:Geometry"`
Name string
}
See test/postgis_test.go
for a full example
Tests have been refactored into their own package to avoid unessesary imports when using the library.
This test expects Postgres environment variables to be present to configure the database connection -- intended mostly for CI.