mirror of
https://github.com/Sosokker/go-chi-oapi-codegen-todolist.git
synced 2025-12-19 05:54:07 +01:00
40 lines
1.2 KiB
YAML
40 lines
1.2 KiB
YAML
version: "2"
|
|
sql:
|
|
- engine: "postgresql"
|
|
queries: "internal/repository/sqlc/queries/"
|
|
schema: "migrations/" # Path to your latest schema or combined migrations
|
|
gen:
|
|
go:
|
|
package: "generated"
|
|
sql_package: "pgx/v5"
|
|
out: "internal/repository/sqlc/generated"
|
|
# Emit interfaces for easier mocking (optional but good practice)
|
|
emit_interface: true
|
|
# Use pgx/v5 types
|
|
emit_exact_table_names: false
|
|
emit_json_tags: true
|
|
json_tags_case_style: "camel"
|
|
# Map Postgres types to Go types, including nulls
|
|
overrides:
|
|
- db_type: "uuid"
|
|
go_type: "github.com/google/uuid.UUID"
|
|
nullable: false
|
|
|
|
- db_type: "timestamptz"
|
|
go_type: "time.Time"
|
|
nullable: false
|
|
|
|
- db_type: "text"
|
|
nullable: true
|
|
go_type: "database/sql.NullString"
|
|
|
|
- db_type: "timestamptz"
|
|
go_type:
|
|
import: "time"
|
|
type: "Time"
|
|
- db_type: "timestamptz"
|
|
go_type:
|
|
import: "time"
|
|
type: "Time"
|
|
pointer: true
|
|
nullable: true |