forked from dv-net/dv-processing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpgxgen.yaml
More file actions
193 lines (182 loc) · 5.21 KB
/
pgxgen.yaml
File metadata and controls
193 lines (182 loc) · 5.21 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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
version: 1
sqlc:
- schema_dir: sql/postgres/migrations
models:
move:
output_dir: internal/models
output_file_name: models_gen.go
package_name: models
package_path: github.com/dv-net/dv-processing/internal/models
imports:
- path: github.com/dv-net/dv-processing/internal/models
go_type: WebhookStatus
- path: github.com/dv-net/dv-processing/internal/models
go_type: WebhookKind
- path: github.com/dv-net/dv-processing/internal/models
go_type: TransferTransactionType
- path: github.com/dv-net/dv-processing/internal/models
go_type: TransferTransactionsStatus
crud:
auto_remove_generated_files: true
exclude_table_name_from_methods: true
tables:
# Processed blocks
processed_blocks:
output_dir: sql/postgres/queries/processed_blocks
primary_column: id
methods:
create:
skip_columns:
- updated_at
column_values:
created_at: now()
# Clients
clients:
output_dir: sql/postgres/queries/clients
primary_column: id
methods:
create:
skip_columns:
- id
- updated_at
returning: "*"
column_values:
created_at: now()
find:
name: GetAll
get:
name: GetByID
exists:
name: ExistsByID
where:
id:
# Owners
owners:
output_dir: sql/postgres/queries/owners
primary_column: id
methods:
create:
skip_columns:
- id
- otp_secret
- otp_confirmed
- updated_at
returning: "*"
column_values:
created_at: now()
find:
name: GetAll
get:
name: GetByID
exists:
name: ExistsByExternalID
where:
external_id:
# Transfers
transfers:
output_dir: sql/postgres/queries/transfers
primary_column: id
methods:
create:
skip_columns:
- id
- updated_at
returning: "*"
column_values:
created_at: now()
get:
name: GetByID
# Webhooks
webhooks:
output_dir: sql/postgres/queries/webhooks
primary_column: id
methods:
delete:
name: DeleteByID
# cold wallets
cold_wallets:
output_dir: sql/postgres/queries/wallets_cold
primary_column: id
methods:
create:
returning: "*"
skip_columns:
- id
- is_dirty
- updated_at
column_values:
created_at: now()
# hot wallets
hot_wallets:
output_dir: sql/postgres/queries/wallets_hot
primary_column: id
methods:
create:
returning: "*"
skip_columns:
- id
- is_dirty
- updated_at
column_values:
created_at: now()
exists:
where:
owner_id:
blockchain:
address:
# processing wallets
processing_wallets:
output_dir: sql/postgres/queries/wallets_processing
primary_column: id
methods:
create:
returning: "*"
skip_columns:
- id
- is_dirty
- updated_at
column_values:
created_at: now()
# settings
settings:
output_dir: sql/postgres/queries/settings
primary_column: id
methods:
create:
skip_columns:
- id
- updated_at
returning: "*"
column_values:
created_at: now()
update:
skip_columns:
- id
- created_at
returning: "*"
# transfer_transactions
transfer_transactions:
output_dir: sql/postgres/queries/transfer_transactions
primary_column: id
methods:
create:
skip_columns:
- id
- updated_at
returning: "*"
column_values:
created_at: now()
constants:
tables:
cold_wallets:
output_dir: internal/store/repos/repo_wallets_cold
include_column_names: true
hot_wallets:
output_dir: internal/store/repos/repo_wallets_hot
include_column_names: true
processing_wallets:
output_dir: internal/store/repos/repo_wallets_processing
include_column_names: true
transfers:
output_dir: internal/store/repos/repo_transfers
include_column_names: true