A simple test program for testing the ability to perform geometric queries on Postgres databases through jet's schema generation layer.
  • Go 94.4%
  • Nix 5.6%
Find a file
Eli Ribble 49b766adfd
Try doing insertion and query of report via pgx
This is what I'm using in my larger project, and I was hoping to
reproduce an error and fix it, but turns out this works fine. Unlike in
my project.
2026-05-29 22:11:36 +00:00
cmd/jet Add hstore 2026-05-28 16:19:57 +00:00
db Add sample table with nullable location 2026-05-29 21:49:50 +00:00
sql Add sample table with nullable location 2026-05-29 21:49:50 +00:00
.air.toml Don't run air if the build fails 2026-05-27 23:05:20 +00:00
.gitignore Ignore temporary files 2026-05-27 23:30:02 +00:00
default.nix Initial creation of a go program that connects to the DB 2026-05-27 18:49:17 +00:00
dog.go Add sample table with nullable location 2026-05-29 21:49:50 +00:00
flake.lock Initial creation of a go program that connects to the DB 2026-05-27 18:49:17 +00:00
flake.nix Create an air loop for faster iteration 2026-05-27 21:04:54 +00:00
go.mod Try doing insertion and query of report via pgx 2026-05-29 22:11:36 +00:00
go.sum Try doing insertion and query of report via pgx 2026-05-29 22:11:36 +00:00
lefthook.yml Add the ability to query for data from the database. 2026-05-27 23:27:43 +00:00
main.go Try doing insertion and query of report via pgx 2026-05-29 22:11:36 +00:00
README.md Add hstore 2026-05-28 16:19:57 +00:00
report.go Try doing insertion and query of report via pgx 2026-05-29 22:11:36 +00:00
target.go Add sample table with nullable location 2026-05-29 21:49:50 +00:00

go-jet-geo-test

Getting started

Database

Create a database and install the necessary plugins

$ sudo -u postgres psql
postgres=# CREATE DATABASE geotest WITH OWNER eliribble;
postgres=# \c geotest
geotest=# CREATE EXTENSION hstore;
CREATE EXTENSION
geotest=# CREATE EXTENSION postgis;
CREATE EXTENSION
geotest=# \q
$ psql -d geotest
geotest=> SELECT PostGIS_Full_Version();
POSTGIS="3.6.1 0" [EXTENSION] PGSQL="170" ...

Initial Data

You can get the initial data from the PostGIS intro workshop. Alternatively, download it directly with:

$ curl -o postgis-workshop-2020.zip https://s3.amazonaws.com/s3.cleverelephant.ca/postgis-workshop-2020.zip
$ unzip postgis-workshop-2020.zip
$ shp2pgsql -D -D -s 26918 postgis-workshop/data/2000/nyc_census_blocks_2000.shp nyc_census_blocks_2000 | psql -d geotest

Initial Schema

You'll also need the initial schema for the test

$ psql -d geotest -f sql/table.sql

Jet

You have to run jet to generate the tables

$ cd cmd/jet
$ go build
$ ./jet

That'll make some files in db/gen/geotest

Hacking

$ air