Skip to content

Commit

Permalink
Add sqlc.yaml and gen-db task for SQLC code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardolat committed Jul 20, 2024
1 parent b97e629 commit ea29267
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
11 changes: 11 additions & 0 deletions sqlc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "2"

sql:
- engine: "postgresql"
schema: "./internal/database/migrations/"
queries:
- "./internal/service/*/"
gen:
go:
package: "dbgen"
out: "./internal/database/dbgen/"
10 changes: 7 additions & 3 deletions taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ tasks:
build:
deps:
- clean
- gen-db
- gen-css
cmds:
- task fmt
Expand All @@ -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 --
Expand All @@ -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/.

0 comments on commit ea29267

Please sign in to comment.