-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpgxgen.yaml
64 lines (63 loc) · 1.59 KB
/
pgxgen.yaml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
version: 1
sqlc:
- schema_dir: sql/migrations
models:
replace_sqlc_nullable_types: true
move:
output_dir: internal/models
output_file_name: models_gen.go
package_name: models
package_path: github.com/sxwebdev/pgxgen-example/internal/models
crud:
auto_remove_generated_files: true
exclude_table_name_from_methods: true
tables:
# Authors
authors:
output_dir: sql/queries/authors
primary_column: id
methods:
create:
skip_columns:
- id
- updated_at
returning: "*"
update:
skip_columns:
- id
- created_at
returning: "*"
find:
order:
by: created_at
direction: DESC
get:
name: GetAuthorByID
delete:
total:
# Books
books:
output_dir: sql/queries/books
primary_column: id
methods:
create:
skip_columns:
- id
- updated_at
returning: "*"
update:
skip_columns:
- id
- created_at
- author_id
returning: "*"
get:
name: GetBookByID
delete:
total:
constants:
tables:
authors:
output_dir: internal/store/repos/repo_authors
books:
output_dir: internal/store/repos/repo_books