feat: move db gen out, emit json field
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user