package
3.0.0+incompatible
Repository: https://github.com/samwang0723/jarvis.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Database

Migrations are generated using golang-migrate.

Install golang-migrate

    # brew install golang-migrate
    # go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
    # -tags are what driver we want to install on our machine

Generate migrations

action can be create / alter / drop

    migrate create -ext sql -dir database/migrations -tz Asia/Taipei -seq {action}_{table}_{detail}

Queries

If using sqlc, queries needs to be manually created in ./queries, and Go code for querying can be generated by running make sqlc command. The command will additionally generate a gomock file for Querier interface for unit tests.

Files will be created under /internal/db. DO NOT MANUALLY MODIFY GENERATED FILES. as they will be overwritten upon re-generation.