API Created for testing purposes from an openapi specification using goapi-gen
.
CRUD methods generated using sqlc
.
It supports CRUD operations for "todo" entities.
- Modify the
todo-spec.yaml
. - Run
go generate ./...
inside root to regenerate the API.
To generate SQL boilerplate for go you need sqlc
installed.
Install it using: go install github.com/kyleconroy/sqlc/cmd/sqlc@latest
- Add new migration files inside the
db/sql/schema
folder. - Add the path to new migration file to
db/sqlc.yaml
inside the schema array. - Run
sqlc generate
insidedb/sql
folder.
- Add or modify files inside the
db/sql/queries..
folder. - If you added a new queries file (e.g. a new entity), also add it to
db/sqlc.yaml
queries array. - Run
sqlc generate
insidedb/sql
folder.
Upload the contents of todo-spec.yaml
to swagger to view the interactive API schema.
run/build the server inside cmd/server
folder