Skip to content

Commit 5b3e10e

Browse files
chore(proto): reformat protos using buf format -w (#2536)
1 parent 7ff8e6f commit 5b3e10e

File tree

2 files changed

+110
-130
lines changed

2 files changed

+110
-130
lines changed

protos/plugin/codegen.proto

Lines changed: 55 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -4,75 +4,70 @@ package plugin;
44

55
option go_package = "github.com/kyleconroy/sqlc/internal/plugin";
66

7-
message File
8-
{
9-
string name = 1 [json_name="name"];
10-
bytes contents = 2 [json_name="contents"];
7+
message File {
8+
string name = 1 [json_name = "name"];
9+
bytes contents = 2 [json_name = "contents"];
1110
}
1211

1312
message Override {
1413
// PythonType message was field 9
1514
reserved 9;
1615

1716
// name of the type to use, e.g. `github.com/segmentio/ksuid.KSUID` or `mymodule.Type`
18-
string code_type = 1 [json_name="code_type"];
17+
string code_type = 1 [json_name = "code_type"];
1918

2019
// name of the type to use, e.g. `text`
21-
string db_type = 3 [json_name="db_type"];
20+
string db_type = 3 [json_name = "db_type"];
2221

2322
// True if the override should apply to a nullable database type
24-
bool nullable = 5 [json_name="nullable"];
23+
bool nullable = 5 [json_name = "nullable"];
2524

2625
// fully qualified name of the column, e.g. `accounts.id`
27-
string column = 6 [json_name="column"];
26+
string column = 6 [json_name = "column"];
2827

29-
Identifier table = 7 [json_name="table"];
28+
Identifier table = 7 [json_name = "table"];
3029

31-
string column_name = 8 [json_name="column_name"];
30+
string column_name = 8 [json_name = "column_name"];
3231

3332
ParsedGoType go_type = 10;
3433

35-
// True if the override should apply to a unsigned database type
36-
bool unsigned = 11 [json_name="unsigned"];
34+
// True if the override should apply to a unsigned database type
35+
bool unsigned = 11 [json_name = "unsigned"];
3736
}
3837

39-
message ParsedGoType
40-
{
38+
message ParsedGoType {
4139
string import_path = 1;
4240
string package = 2;
4341
string type_name = 3;
4442
bool basic_type = 4;
4543
map<string, string> struct_tags = 5;
4644
}
4745

48-
message Settings
49-
{
46+
message Settings {
5047
// PythonCode message was field 8
5148
// KotlinCode message was field 9
5249
reserved 8, 9;
5350

54-
string version = 1 [json_name="version"];
55-
string engine = 2 [json_name="engine"];
56-
repeated string schema = 3 [json_name="schema"];
57-
repeated string queries = 4 [json_name="queries"];
58-
map<string, string> rename = 5 [json_name="rename"];
59-
repeated Override overrides = 6 [json_name="overrides"];
60-
Codegen codegen = 12 [json_name="codegen"];
51+
string version = 1 [json_name = "version"];
52+
string engine = 2 [json_name = "engine"];
53+
repeated string schema = 3 [json_name = "schema"];
54+
repeated string queries = 4 [json_name = "queries"];
55+
map<string, string> rename = 5 [json_name = "rename"];
56+
repeated Override overrides = 6 [json_name = "overrides"];
57+
Codegen codegen = 12 [json_name = "codegen"];
6158

6259
// TODO: Refactor codegen settings
6360
GoCode go = 10;
6461
JSONCode json = 11;
6562
}
6663

67-
message Codegen
68-
{
69-
string out = 1 [json_name="out"];
70-
string plugin = 2 [json_name="plugin"];
71-
bytes options = 3 [json_name="options"];
64+
message Codegen {
65+
string out = 1 [json_name = "out"];
66+
string plugin = 2 [json_name = "plugin"];
67+
bytes options = 3 [json_name = "options"];
7268
}
7369

74-
message GoCode
75-
{
70+
message GoCode {
7671
bool emit_interface = 1;
7772
bool emit_json_tags = 2;
7873
bool emit_db_tags = 3;
@@ -102,59 +97,51 @@ message GoCode
10297
bool omit_unused_structs = 27;
10398
}
10499

105-
message JSONCode
106-
{
100+
message JSONCode {
107101
string out = 1;
108102
string indent = 2;
109103
string filename = 3;
110104
}
111105

112-
message Catalog
113-
{
106+
message Catalog {
114107
string comment = 1;
115108
string default_schema = 2;
116109
string name = 3;
117110
repeated Schema schemas = 4;
118111
}
119112

120-
message Schema
121-
{
113+
message Schema {
122114
string comment = 1;
123115
string name = 2;
124116
repeated Table tables = 3;
125117
repeated Enum enums = 4;
126118
repeated CompositeType composite_types = 5;
127119
}
128120

129-
message CompositeType
130-
{
121+
message CompositeType {
131122
string name = 1;
132123
string comment = 2;
133124
}
134125

135-
message Enum
136-
{
126+
message Enum {
137127
string name = 1;
138128
repeated string vals = 2;
139129
string comment = 3;
140130
}
141131

142-
message Table
143-
{
132+
message Table {
144133
Identifier rel = 1;
145134
repeated Column columns = 2;
146-
string comment = 3;
135+
string comment = 3;
147136
}
148137

149-
message Identifier
150-
{
138+
message Identifier {
151139
string catalog = 1;
152140
string schema = 2;
153141
string name = 3;
154142
}
155143

156-
message Column
157-
{
144+
message Column {
158145
string name = 1;
159146
bool not_null = 3;
160147
bool is_array = 4;
@@ -174,34 +161,30 @@ message Column
174161
bool unsigned = 16;
175162
}
176163

177-
message Query
178-
{
179-
string text = 1 [json_name="text"];
180-
string name = 2 [json_name="name"];
181-
string cmd = 3 [json_name="cmd"];
182-
repeated Column columns = 4 [json_name="columns"];
183-
repeated Parameter params = 5 [json_name="parameters"];
184-
repeated string comments = 6 [json_name="comments"];
185-
string filename = 7 [json_name="filename"];
186-
Identifier insert_into_table = 8 [json_name="insert_into_table"];
164+
message Query {
165+
string text = 1 [json_name = "text"];
166+
string name = 2 [json_name = "name"];
167+
string cmd = 3 [json_name = "cmd"];
168+
repeated Column columns = 4 [json_name = "columns"];
169+
repeated Parameter params = 5 [json_name = "parameters"];
170+
repeated string comments = 6 [json_name = "comments"];
171+
string filename = 7 [json_name = "filename"];
172+
Identifier insert_into_table = 8 [json_name = "insert_into_table"];
187173
}
188174

189-
message Parameter
190-
{
191-
int32 number = 1 [json_name="number"];
192-
Column column = 2 [json_name="column"];
175+
message Parameter {
176+
int32 number = 1 [json_name = "number"];
177+
Column column = 2 [json_name = "column"];
193178
}
194179

195-
message CodeGenRequest
196-
{
197-
Settings settings = 1 [json_name="settings"];
198-
Catalog catalog = 2 [json_name="catalog"];
199-
repeated Query queries = 3 [json_name="queries"];
200-
string sqlc_version = 4 [json_name="sqlc_version"];
201-
bytes plugin_options = 5 [json_name="plugin_options"];
180+
message CodeGenRequest {
181+
Settings settings = 1 [json_name = "settings"];
182+
Catalog catalog = 2 [json_name = "catalog"];
183+
repeated Query queries = 3 [json_name = "queries"];
184+
string sqlc_version = 4 [json_name = "sqlc_version"];
185+
bytes plugin_options = 5 [json_name = "plugin_options"];
202186
}
203187

204-
message CodeGenResponse
205-
{
206-
repeated File files = 1 [json_name="files"];
207-
}
188+
message CodeGenResponse {
189+
repeated File files = 1 [json_name = "files"];
190+
}

protos/vet/vet.proto

Lines changed: 55 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,88 +4,85 @@ package vet;
44

55
option go_package = "github.com/kyleconroy/sqlc/internal/vet";
66

7-
message Parameter
8-
{
9-
int32 number = 1 [json_name="number"];
7+
message Parameter {
8+
int32 number = 1 [json_name = "number"];
109
}
1110

12-
message Config
13-
{
14-
string version = 1 [json_name="version"];
15-
string engine = 2 [json_name="engine"];
16-
repeated string schema = 3 [json_name="schema"];
17-
repeated string queries = 4 [json_name="queries"];
11+
message Config {
12+
string version = 1 [json_name = "version"];
13+
string engine = 2 [json_name = "engine"];
14+
repeated string schema = 3 [json_name = "schema"];
15+
repeated string queries = 4 [json_name = "queries"];
1816
}
1917

20-
message Query
21-
{
22-
string sql = 1 [json_name="sql"];
23-
string name = 2 [json_name="name"];
24-
string cmd = 3 [json_name="cmd"];
25-
repeated Parameter params = 4 [json_name="parameters"];
18+
message Query {
19+
string sql = 1 [json_name = "sql"];
20+
string name = 2 [json_name = "name"];
21+
string cmd = 3 [json_name = "cmd"];
22+
repeated Parameter params = 4 [json_name = "parameters"];
2623
}
2724

2825
message PostgreSQL {
2926
PostgreSQLExplain explain = 1;
3027
}
3128

3229
message PostgreSQLExplain {
33-
Plan plan = 1 [json_name="Plan"];
34-
map<string, string> settings = 2 [json_name="Settings"];
35-
Planning planning = 3 [json_name="Planning"];
30+
Plan plan = 1 [json_name = "Plan"];
31+
map<string, string> settings = 2 [json_name = "Settings"];
32+
Planning planning = 3 [json_name = "Planning"];
3633

3734
message Plan {
38-
string node_type = 1 [json_name="Node Type"];
39-
string parent_relationship = 2 [json_name="Parent Relationship"];
40-
string relation_name = 3 [json_name="Relation Name"];
41-
string schema = 4 [json_name="Schema"];
42-
string alias = 5 [json_name="Alias"];
43-
bool parallel_aware = 6 [json_name="Parallel Aware"];
44-
bool async_capable = 7 [json_name="Async Capable"];
45-
float startup_cost = 8 [json_name="Startup Cost"];
46-
float total_cost = 9 [json_name="Total Cost"];
47-
uint64 plan_rows = 10 [json_name="Plan Rows"];
48-
uint64 plan_width = 11 [json_name="Plan Width"];
49-
repeated string output = 12 [json_name="Output"];
50-
repeated Plan plans = 13 [json_name="Plans"];
35+
string node_type = 1 [json_name = "Node Type"];
36+
string parent_relationship = 2 [json_name = "Parent Relationship"];
37+
string relation_name = 3 [json_name = "Relation Name"];
38+
string schema = 4 [json_name = "Schema"];
39+
string alias = 5 [json_name = "Alias"];
40+
bool parallel_aware = 6 [json_name = "Parallel Aware"];
41+
bool async_capable = 7 [json_name = "Async Capable"];
42+
float startup_cost = 8 [json_name = "Startup Cost"];
43+
float total_cost = 9 [json_name = "Total Cost"];
44+
uint64 plan_rows = 10 [json_name = "Plan Rows"];
45+
uint64 plan_width = 11 [json_name = "Plan Width"];
46+
repeated string output = 12 [json_name = "Output"];
47+
repeated Plan plans = 13 [json_name = "Plans"];
5148

5249
// Embedded "Blocks" fields
53-
uint64 shared_hit_blocks = 14 [json_name="Shared Hit Blocks"];
54-
uint64 shared_read_blocks = 15 [json_name="Shared Read Blocks"];
55-
uint64 shared_dirtied_blocks = 16 [json_name="Shared Dirtied Blocks"];
56-
uint64 shared_written_blocks = 17 [json_name="Shared Written Blocks"];
57-
uint64 local_hit_blocks = 18 [json_name="Local Hit Blocks"];
58-
uint64 local_read_blocks = 19 [json_name="Local Read Blocks"];
59-
uint64 local_dirtied_blocks = 20 [json_name="Local Dirtied Blocks"];
60-
uint64 local_written_blocks = 21 [json_name="Local Written Blocks"];
61-
uint64 temp_read_blocks = 22 [json_name="Temp Read Blocks"];
62-
uint64 temp_written_blocks = 23 [json_name="Temp Written Blocks"];
50+
uint64 shared_hit_blocks = 14 [json_name = "Shared Hit Blocks"];
51+
uint64 shared_read_blocks = 15 [json_name = "Shared Read Blocks"];
52+
uint64 shared_dirtied_blocks = 16 [json_name = "Shared Dirtied Blocks"];
53+
uint64 shared_written_blocks = 17 [json_name = "Shared Written Blocks"];
54+
uint64 local_hit_blocks = 18 [json_name = "Local Hit Blocks"];
55+
uint64 local_read_blocks = 19 [json_name = "Local Read Blocks"];
56+
uint64 local_dirtied_blocks = 20 [json_name = "Local Dirtied Blocks"];
57+
uint64 local_written_blocks = 21 [json_name = "Local Written Blocks"];
58+
uint64 temp_read_blocks = 22 [json_name = "Temp Read Blocks"];
59+
uint64 temp_written_blocks = 23 [json_name = "Temp Written Blocks"];
6360

6461
// "Node Type": "Sort" fields
65-
repeated string sort_key = 24 [json_name="Sort Key"];
62+
repeated string sort_key = 24 [json_name = "Sort Key"];
6663

6764
// "Node Type": "Hash Join" fields
68-
string join_type = 25 [json_name="Join Type"];
69-
bool inner_unique = 26 [json_name="Inner Unique"];
70-
string hash_cond = 27 [json_name="Hash Cond"];
65+
string join_type = 25 [json_name = "Join Type"];
66+
bool inner_unique = 26 [json_name = "Inner Unique"];
67+
string hash_cond = 27 [json_name = "Hash Cond"];
7168

7269
// "Node Type": "Index Scan" fields
73-
string index_name = 28 [json_name="Index Name"];
74-
string scan_direction = 29 [json_name="Scan Direction"];
75-
string index_cond = 30 [json_name="Index Cond"];
70+
string index_name = 28 [json_name = "Index Name"];
71+
string scan_direction = 29 [json_name = "Scan Direction"];
72+
string index_cond = 30 [json_name = "Index Cond"];
7673
}
7774

7875
message Planning {
79-
uint64 shared_hit_blocks = 1 [json_name="Shared Hit Blocks"];
80-
uint64 shared_read_blocks = 2 [json_name="Shared Read Blocks"];
81-
uint64 shared_dirtied_blocks = 3 [json_name="Shared Dirtied Blocks"];
82-
uint64 shared_written_blocks = 4 [json_name="Shared Written Blocks"];
83-
uint64 local_hit_blocks = 5 [json_name="Local Hit Blocks"];
84-
uint64 local_read_blocks = 6 [json_name="Local Read Blocks"];
85-
uint64 local_dirtied_blocks = 7 [json_name="Local Dirtied Blocks"];
86-
uint64 local_written_blocks = 8 [json_name="Local Written Blocks"];
87-
uint64 temp_read_blocks = 9 [json_name="Temp Read Blocks"];
88-
uint64 temp_written_blocks = 10 [json_name="Temp Written Blocks"];
76+
uint64 shared_hit_blocks = 1 [json_name = "Shared Hit Blocks"];
77+
uint64 shared_read_blocks = 2 [json_name = "Shared Read Blocks"];
78+
uint64 shared_dirtied_blocks = 3 [json_name = "Shared Dirtied Blocks"];
79+
uint64 shared_written_blocks = 4 [json_name = "Shared Written Blocks"];
80+
uint64 local_hit_blocks = 5 [json_name = "Local Hit Blocks"];
81+
uint64 local_read_blocks = 6 [json_name = "Local Read Blocks"];
82+
uint64 local_dirtied_blocks = 7 [json_name = "Local Dirtied Blocks"];
83+
uint64 local_written_blocks = 8 [json_name = "Local Written Blocks"];
84+
uint64 temp_read_blocks = 9 [json_name = "Temp Read Blocks"];
85+
uint64 temp_written_blocks = 10 [json_name = "Temp Written Blocks"];
8986
}
9087
}
9188

0 commit comments

Comments
 (0)