This example uses sqlx along with pgx to connect to a DigitalOcean PostgreSQL database, with support for JSONB (see the favorites
column in the dataset).
- Import the dataset if necessary
- Install the dependencies:
go get -u -v ./...
- Build the app:
go build .
- Prepare your PostgreSQL connection string. See the examples README
- Start the app:
./go-contacts -conn "PostgreSQL Connection String"
- You can alternatively pass the connection string in an environment variable named
DATABASE_URL
- You can alternatively pass the connection string in an environment variable named