feat: move db gen out, emit json field

This commit is contained in:
Justin Lin
2025-08-26 20:58:39 +10:00
parent e770b31402
commit 7ced3985b1
15 changed files with 63 additions and 90 deletions

View File

@@ -8,6 +8,7 @@ import (
"github.com/jackc/pgx/v5"
"tutorial.sqlc.dev/app/internal/author"
"tutorial.sqlc.dev/app/internal/db"
)
func run() error {
@@ -19,8 +20,9 @@ func run() error {
}
defer conn.Close(ctx)
querier := db.New(conn)
r := gin.Default()
authorCtl := author.NewController(conn)
authorCtl := author.NewController(querier)
author.Register(r, &authorCtl)
r.Run(":8000")