Add sqlc.yaml and gen-db task for SQLC code generation

This commit is contained in:
Luis Eduardo Jeréz Girón
2024-07-19 23:53:07 -06:00
parent b97e6296f7
commit ea2926716d
2 changed files with 18 additions and 3 deletions

11
sqlc.yaml Normal file
View File

@@ -0,0 +1,11 @@
version: "2"
sql:
- engine: "postgresql"
schema: "./internal/database/migrations/"
queries:
- "./internal/service/*/"
gen:
go:
package: "dbgen"
out: "./internal/database/dbgen/"

View File

@@ -17,6 +17,7 @@ tasks:
build:
deps:
- clean
- gen-db
- gen-css
cmds:
- task fmt
@@ -33,6 +34,12 @@ tasks:
goose:
cmd: eval $(go run ./cmd/goose/. {{.CLI_ARGS}})
gen-db:
cmd: sqlc generate
reset-db:
cmd: go run ./cmd/resetdb/.
gen-css:
cmd: >
npm run tailwindcss --
@@ -58,6 +65,3 @@ tasks:
fixperms: # Fixes the permissions of the files in the project
cmd: ./scripts/fixperms.sh
reset-db:
cmd: go run ./cmd/resetdb/.