command
module
Version:
v0.0.0-...-ded5120
Opens a new window with list of versions in this module.
Published: Aug 24, 2021
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Fomapi
Setup local development
-
Docker desktop
-
TablePlus
-
Golang
-
Migrate
$ curl -L https://packagecloud.io/golang-migrate/migrate/gpgkey | apt-key add -
$ echo "deb https://packagecloud.io/golang-migrate/migrate/ubuntu/ focal main" > /etc/apt/sources.list.d/migrate.list
$ apt-get update
$ apt-get install -y migrate
-
Sqlc
Ubuntu
sudo snap install sqlc
Docker
docker pull kjconroy/sqlc
Run sqlc
using docker run
:
docker run --rm -v $(pwd):/src -w /src kjconroy/sqlc generate
-
Gomock
go install github.com/golang/mock/mockgen@v1.6.0
Setup infrastructure
-
Start postgres container:
make postgres
-
Create database:
make createdb
-
Run db migration up all versions:
make migrateup
-
Run db migration down all versions:
make migratedown
How to generate code
-
Generate SQL CRUD with sqlc:
make sqlc
-
Generate DB mock with gomock:
make mock
-
Create a new db migration:
migrate create -ext sql -dir db/migration -seq <migration_name>
How to run
-
Run server:
make server
-
Run test:
make test
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
|
|
db
|
|
mock
Package mockdb is a generated GoMock package.
|
Package mockdb is a generated GoMock package. |
|
|
|
|
Click to show internal directories.
Click to hide internal directories.