https://github.com/headwinds/northwind-frostpunk
a tutorial exploring golang, the northwind database, and the post apocalypse
https://github.com/headwinds/northwind-frostpunk
Last synced: 8 months ago
JSON representation
a tutorial exploring golang, the northwind database, and the post apocalypse
- Host: GitHub
- URL: https://github.com/headwinds/northwind-frostpunk
- Owner: headwinds
- Created: 2022-09-21T18:28:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-08T17:39:25.000Z (over 2 years ago)
- Last Synced: 2025-02-11T16:21:18.605Z (over 1 year ago)
- Language: Go
- Size: 10.5 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# northwind-frostpunk

This is a study exploring golang, the northwind database, and an order status story.
1. connect Go to Postgres featuring the Northwind database augmented with Frostpunk tables
2. interact with a Go CLI
3. simulate orders, view a report & have fun!
Golang 1.8+ [install gvm](https://jimkang.medium.com/install-go-on-mac-with-homebrew-5fa421fc55f5)
## Example SQL Query
```
SELECT C.category_name
,COUNT(P.category_id) AS total_products
FROM categories AS C
JOIN products AS P
ON P.category_id = C.category_id
GROUP BY C.category_name
ORDER BY total_products DESC;
```
## 1. Database
First, start the up the database container in a terminal using the [northwind_psql](https://github.com/pthom/northwind_psql) repo not this repo!
```
cd northwind_psql
docker-compose up
```
From the pgAdmin4 or psql, you will need to modify this database to include the frostpunk-inspired tables.
## 2. API
Open a second terminal for the API which is back to this repo.
```
go run .
```
You should see the message `Successfully connected to the Northwind database`
## 3. CLI
The API has to be running in a separate terminal before you can interact with it via the CLI
Open a third terminal to run the CLI
```
cd cli
go run .
```
## Tests
```
go test ./...
```
## Log
[Captain's Log](log/captainsLog.md)