-
Notifications
You must be signed in to change notification settings - Fork 131
/
sqlc.yaml
158 lines (156 loc) · 6.64 KB
/
sqlc.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
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
version: "2"
sql:
- engine: "postgresql"
queries: "backend/sql/postgresql/queries"
schema: "backend/sql/postgresql/schema"
gen:
go:
package: "db_queries"
out: "backend/gen/go/db"
sql_package: "pgx/v5"
emit_interface: true
emit_methods_with_db_argument: true
overrides:
- column: neosync_api.connections.connection_config
go_type:
import: github.com/nucleuscloud/neosync/backend/sql/postgresql/models
package: pg_models
type: ConnectionConfig
pointer: true
- column: neosync_api.jobs.mappings
go_type:
import: github.com/nucleuscloud/neosync/backend/sql/postgresql/models
package: pg_models
type: JobMapping
pointer: true
slice: true
- column: neosync_api.jobs.virtual_foreign_keys
go_type:
import: github.com/nucleuscloud/neosync/backend/sql/postgresql/models
package: pg_models
type: VirtualForeignConstraint
pointer: true
slice: true
- column: neosync_api.jobs.connection_options
go_type:
import: github.com/nucleuscloud/neosync/backend/sql/postgresql/models
package: pg_models
type: JobSourceOptions
pointer: true
- column: neosync_api.job_destination_connection_associations.options
go_type:
import: github.com/nucleuscloud/neosync/backend/sql/postgresql/models
package: pg_models
type: JobDestinationOptions
pointer: true
- column: neosync_api.transformers.transformer_config
go_type:
import: github.com/nucleuscloud/neosync/backend/sql/postgresql/models
package: pg_models
type: TransformerConfig
pointer: true
- column: neosync_api.accounts.temporal_config
go_type:
import: github.com/nucleuscloud/neosync/backend/sql/postgresql/models
package: pg_models
type: TemporalConfig
pointer: true
- column: neosync_api.jobs.sync_options
go_type:
import: github.com/nucleuscloud/neosync/backend/sql/postgresql/models
package: pg_models
type: ActivityOptions
pointer: true
- column: neosync_api.jobs.workflow_options
go_type:
import: github.com/nucleuscloud/neosync/backend/sql/postgresql/models
package: pg_models
type: WorkflowOptions
pointer: true
- column: neosync_api.accounts.onboarding_config
go_type:
import: github.com/nucleuscloud/neosync/backend/sql/postgresql/models
package: pg_models
type: AccountOnboardingConfig
pointer: true
- engine: "mysql"
queries: "backend/pkg/dbschemas/sql/mysql/queries"
schema: "backend/pkg/dbschemas/sql/mysql/schema"
gen:
go:
package: mysql_queries
out: "backend/gen/go/db/dbschemas/mysql"
emit_interface: true
emit_methods_with_db_argument: true
emit_result_struct_pointers: true
emit_params_struct_pointers: true
emit_pointers_for_null_types: true
- engine: "postgresql"
queries: "backend/pkg/dbschemas/sql/postgresql/queries"
gen:
go:
package: "pg_queries"
out: "backend/gen/go/db/dbschemas/postgresql"
emit_interface: true
emit_methods_with_db_argument: true
emit_result_struct_pointers: true
emit_params_struct_pointers: true
emit_pointers_for_null_types: true
overrides:
# - column: information_schema.columns.table_schema
# go_type: string
# - column: information_schema.columns.table_name
# go_type: string
# - column: information_schema.columns.column_name
# go_type: string
# - column: information_schema.columns.ordinal_position
# go_type: int
# - column: information_schema.columns.column_default
# go_type: "string"
# nullable: true # this only appears to work on models
# - column: information_schema.columns.is_nullable
# go_type: string
# - column: information_schema.columns.data_type
# go_type: string
# - column: information_schema.columns.character_maximum_length
# go_type: int
# - column: information_schema.columns.numeric_precision
# go_type: int
# - column: information_schema.columns.numeric_scale
# go_type: int
# - column: information_schema.tables.table_schema
# go_type: string
# - column: information_schema.tables.table_name
# go_type: string
# - column: information_schema.referential_constraints.constraint_name
# go_type: string
# - column: information_schema.referential_constraints.constraint_schema
# go_type: string
# - column: information_schema.key_column_usage.table_schema
# go_type: string
# - column: information_schema.key_column_usage.table_name
# go_type: string
# - column: information_schema.key_column_usage.column_name
# go_type: string
# - column: information_schema.table_constraints.table_schema
# go_type: string
# - column: information_schema.table_constraints.table_name
# go_type: string
# - column: information_schema.table_constraints.constraint_name
# go_type: string
# - column: information_schema.constraint_column_usage.table_schema
# go_type: string
# - column: information_schema.constraint_column_usage.table_name
# go_type: string
# - column: information_schema.constraint_column_usage.column_name
# go_type: string
- column: information_schema.role_table_grants.table_schema
go_type: string
- column: information_schema.role_table_grants.table_name
go_type: string
- column: information_schema.role_table_grants.privilege_type
go_type: string
- column: pg_catalog.pg_constraint.connamespace # this is normally an int but we are casting it in queries to the friendly name
go_type: string
- column: pg_catalog.pg_constraint.conrelid # this is normally an int but we are casting it in queries to the friendly name
go_type: string