-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsqlc.yaml
More file actions
35 lines (32 loc) · 1.04 KB
/
sqlc.yaml
File metadata and controls
35 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
version: "2"
sql:
- engine: "postgresql"
queries: "internal/db/query"
schema: "internal/db/migration"
gen:
go:
package: "store"
out: "internal/store"
sql_package: "pgx/v5"
emit_interface: true
emit_json_tags: true
json_tags_case_style: "camel"
overrides:
- db_type: "timestamptz"
go_type:
import: "time"
type: "Time"
- db_type: "UUID"
go_type: "github.com/google/uuid.UUID"
# Add validator for user columns
- column: users.first_name
go_struct_tag: validate:"required,min=1,max=255"
- column: users.last_name
go_struct_tag: validate:"required,min=1,max=255"
- column: users.email
go_struct_tag: validate:"required,email"
# Add validator for post columns
- column: posts.title
go_struct_tag: validate:"required,min=1,max=255"
- column: posts.content
go_struct_tag: validate:"required"