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%
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. |
||
|---|---|---|
| cmd/jet | ||
| db | ||
| sql | ||
| .air.toml | ||
| .gitignore | ||
| default.nix | ||
| dog.go | ||
| flake.lock | ||
| flake.nix | ||
| go.mod | ||
| go.sum | ||
| lefthook.yml | ||
| main.go | ||
| README.md | ||
| report.go | ||
| target.go | ||
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