Complete Intro To SQL by Brian Holt, but using Golang, sqlx and sql-migrate
(Assuming the database dirty exists)
~/go/bin/sql-migrate up -config=migrations-config.yml
To create a new migration
~/go/bin/sql-migrate new -config=migrations-config.yml <name>
To undo
the last migration
~/go/bin/sql-migrate down -config=migrations-config.yml
or to undo all migrations
~/go/bin/sql-migrate down -config=migrations-config.yml -limit=0
go run main.go
Install Gin
go install github.com/codegangsta/gin
~/go/bin/gin --bin bin/gin-bin --appPort 8080 --immediate run .
curl --location --request GET 'localhost:8080/ingredients/search?term=a&page=1'
curl --location --request GET 'localhost:8080/ingredients/type?type=fruit'
curl --location 'localhost:8080/recipes/search'
curl --location 'localhost:8080/recipes/get?id=1'
- Connection
- https://www.alexedwards.net/blog/serving-static-sites-with-go
- Guide to SQLx
- Code for the SQL apps project
- Intro to Go by Brenna Martenson
- PostgreSql Window function
- https://stackoverflow.com/questions/18635671/how-to-define-multiple-name-tags-in-a-struct
- https://stackoverflow.com/questions/12334697/variadic-functions-parameters-pass-through
- https://stackoverflow.com/questions/8270816/converting-go-struct-to-json
- https://www.postgresql.org/docs/current/sql-explain.html
- https://stackoverflow.com/questions/56244336/go-package-with-multiple-files-how-to-structure