diff --git a/Makefile b/Makefile index d827c09650..392ec3fd6a 100644 --- a/Makefile +++ b/Makefile @@ -30,9 +30,6 @@ psql: mysqlsh: mysqlsh --sql --user root --password mysecretpassword --database dinotest 127.0.0.1:3306 -fmt: - go fmt ./... - # $ protoc --version # libprotoc 3.17.3 # go install google.golang.org/protobuf/cmd/protoc-gen-go@latest diff --git a/internal/cmd/generate.go b/internal/cmd/generate.go index da46d47d05..8823224636 100644 --- a/internal/cmd/generate.go +++ b/internal/cmd/generate.go @@ -196,7 +196,7 @@ func Generate(ctx context.Context, e Env, dir, filename string, stderr io.Writer files, err = golang.Generate(result, combo) case sql.Gen.Kotlin != nil: out = combo.Kotlin.Out - files, err = kotlin.Generate(result, combo) + resp, err = kotlin.Generate(codeGenRequest(result, combo)) case sql.Gen.Python != nil: out = combo.Python.Out resp, err = python.Generate(codeGenRequest(result, combo)) diff --git a/internal/cmd/shim.go b/internal/cmd/shim.go index 8252fefdd7..e7f2fea697 100644 --- a/internal/cmd/shim.go +++ b/internal/cmd/shim.go @@ -55,6 +55,7 @@ func pluginSettings(cs config.CombinedSettings) *plugin.Settings { Overrides: over, Rename: cs.Rename, Python: pluginPythonCode(cs.Python), + Kotlin: pluginKotlinCode(cs.Kotlin), } } @@ -75,6 +76,14 @@ func pluginPythonType(pt config.PythonType) *plugin.PythonType { } } +func pluginKotlinCode(s config.SQLKotlin) *plugin.KotlinCode { + return &plugin.KotlinCode{ + Out: s.Out, + Package: s.Package, + EmitExactTableNames: s.EmitExactTableNames, + } +} + func pluginCatalog(c *catalog.Catalog) *plugin.Catalog { var schemas []*plugin.Schema for _, s := range c.Schemas { diff --git a/internal/codegen/kotlin/gen.go b/internal/codegen/kotlin/gen.go index 7c39b19e2f..234cde4ebf 100644 --- a/internal/codegen/kotlin/gen.go +++ b/internal/codegen/kotlin/gen.go @@ -11,16 +11,12 @@ import ( "text/template" "github.com/kyleconroy/sqlc/internal/codegen" - "github.com/kyleconroy/sqlc/internal/compiler" - "github.com/kyleconroy/sqlc/internal/config" - "github.com/kyleconroy/sqlc/internal/core" "github.com/kyleconroy/sqlc/internal/inflection" "github.com/kyleconroy/sqlc/internal/metadata" - "github.com/kyleconroy/sqlc/internal/sql/ast" - "github.com/kyleconroy/sqlc/internal/sql/catalog" + "github.com/kyleconroy/sqlc/internal/plugin" ) -func sameTableName(n *ast.TableName, f core.FQN) bool { +func sameTableName(n, f *plugin.Identifier) bool { if n == nil { return false } @@ -28,7 +24,7 @@ func sameTableName(n *ast.TableName, f core.FQN) bool { if n.Schema == "" { schema = "public" } - return n.Catalog == n.Catalog && schema == f.Schema && n.Name == f.Rel + return n.Catalog == n.Catalog && schema == f.Schema && n.Name == f.Name } var ktIdentPattern = regexp.MustCompile("[^a-zA-Z0-9_]+") @@ -52,7 +48,7 @@ type Field struct { } type Struct struct { - Table core.FQN + Table plugin.Identifier Name string Fields []Field JDBCParamBindings []Field @@ -94,7 +90,7 @@ func jdbcSet(t ktType, idx int, name string) string { return fmt.Sprintf(`stmt.setArray(%d, conn.createArrayOf("%s", %s.map { v -> v.value }.toTypedArray()))`, idx, t.DataType, name) } if t.IsEnum { - if t.Engine == config.EnginePostgreSQL { + if t.Engine == "postgresql" { return fmt.Sprintf("stmt.setObject(%d, %s.value, %s)", idx, name, "Types.OTHER") } else { return fmt.Sprintf("stmt.setString(%d, %s.value)", idx, name) @@ -228,25 +224,21 @@ func ktEnumValueName(value string) string { return strings.ToUpper(id) } -func buildEnums(r *compiler.Result, settings config.CombinedSettings) []Enum { +func buildEnums(req *plugin.CodeGenRequest) []Enum { var enums []Enum - for _, schema := range r.Catalog.Schemas { + for _, schema := range req.Catalog.Schemas { if schema.Name == "pg_catalog" { continue } - for _, typ := range schema.Types { - enum, ok := typ.(*catalog.Enum) - if !ok { - continue - } + for _, enum := range schema.Enums { var enumName string - if schema.Name == r.Catalog.DefaultSchema { + if schema.Name == req.Catalog.DefaultSchema { enumName = enum.Name } else { enumName = schema.Name + "_" + enum.Name } e := Enum{ - Name: DataClassName(enumName, settings), + Name: dataClassName(enumName, req.Settings), Comment: enum.Comment, } for _, v := range enum.Vals { @@ -265,7 +257,7 @@ func buildEnums(r *compiler.Result, settings config.CombinedSettings) []Enum { return enums } -func DataClassName(name string, settings config.CombinedSettings) string { +func dataClassName(name string, settings *plugin.Settings) string { if rename := settings.Rename[name]; rename != "" { return rename } @@ -276,36 +268,36 @@ func DataClassName(name string, settings config.CombinedSettings) string { return out } -func MemberName(name string, settings config.CombinedSettings) string { - return codegen.LowerTitle(DataClassName(name, settings)) +func memberName(name string, settings *plugin.Settings) string { + return codegen.LowerTitle(dataClassName(name, settings)) } -func buildDataClasses(r *compiler.Result, settings config.CombinedSettings) []Struct { +func buildDataClasses(req *plugin.CodeGenRequest) []Struct { var structs []Struct - for _, schema := range r.Catalog.Schemas { + for _, schema := range req.Catalog.Schemas { if schema.Name == "pg_catalog" { continue } for _, table := range schema.Tables { var tableName string - if schema.Name == r.Catalog.DefaultSchema { + if schema.Name == req.Catalog.DefaultSchema { tableName = table.Rel.Name } else { tableName = schema.Name + "_" + table.Rel.Name } - structName := DataClassName(tableName, settings) - if !settings.Go.EmitExactTableNames { + structName := dataClassName(tableName, req.Settings) + if !req.Settings.Kotlin.EmitExactTableNames { structName = inflection.Singular(structName) } s := Struct{ - Table: core.FQN{Schema: schema.Name, Rel: table.Rel.Name}, + Table: plugin.Identifier{Schema: schema.Name, Name: table.Rel.Name}, Name: structName, Comment: table.Comment, } for _, column := range table.Columns { s.Fields = append(s.Fields, Field{ - Name: MemberName(column.Name, settings), - Type: makeType(r, compiler.ConvertColumn(table.Rel, column), settings), + Name: memberName(column.Name, req.Settings), + Type: makeType(req, column), Comment: column.Comment, }) } @@ -324,7 +316,7 @@ type ktType struct { IsArray bool IsNull bool DataType string - Engine config.Engine + Engine string } func (t ktType) String() string { @@ -366,25 +358,25 @@ func (t ktType) IsUUID() bool { return t.Name == "UUID" } -func makeType(r *compiler.Result, col *compiler.Column, settings config.CombinedSettings) ktType { - typ, isEnum := ktInnerType(r, col, settings) +func makeType(req *plugin.CodeGenRequest, col *plugin.Column) ktType { + typ, isEnum := ktInnerType(req, col) return ktType{ Name: typ, IsEnum: isEnum, IsArray: col.IsArray, IsNull: !col.NotNull, - DataType: col.DataType, - Engine: settings.Package.Engine, + DataType: dataType(col.Type), + Engine: req.Settings.Engine, } } -func ktInnerType(r *compiler.Result, col *compiler.Column, settings config.CombinedSettings) (string, bool) { +func ktInnerType(req *plugin.CodeGenRequest, col *plugin.Column) (string, bool) { // TODO: Extend the engine interface to handle types - switch settings.Package.Engine { - case config.EngineMySQL: - return mysqlType(r, col, settings) - case config.EnginePostgreSQL: - return postgresType(r, col, settings) + switch req.Settings.Engine { + case "mysql": + return mysqlType(req, col) + case "postgresql": + return postgresType(req, col) default: return "Any", false } @@ -392,10 +384,10 @@ func ktInnerType(r *compiler.Result, col *compiler.Column, settings config.Combi type goColumn struct { id int - *compiler.Column + *plugin.Column } -func ktColumnsToStruct(r *compiler.Result, name string, columns []goColumn, settings config.CombinedSettings, namer func(*compiler.Column, int) string) *Struct { +func ktColumnsToStruct(req *plugin.CodeGenRequest, name string, columns []goColumn, namer func(*plugin.Column, int) string) *Struct { gs := Struct{ Name: name, } @@ -406,13 +398,13 @@ func ktColumnsToStruct(r *compiler.Result, name string, columns []goColumn, sett gs.JDBCParamBindings = append(gs.JDBCParamBindings, binding) continue } - fieldName := MemberName(namer(c.Column, c.id), settings) + fieldName := memberName(namer(c.Column, c.id), req.Settings) if v := nameSeen[c.Name]; v > 0 { fieldName = fmt.Sprintf("%s_%d", fieldName, v+1) } field := Field{ Name: fieldName, - Type: makeType(r, c.Column, settings), + Type: makeType(req, c.Column), } gs.Fields = append(gs.Fields, field) gs.JDBCParamBindings = append(gs.JDBCParamBindings, field) @@ -434,14 +426,14 @@ func ktArgName(name string) string { return out } -func ktParamName(c *compiler.Column, number int) string { +func ktParamName(c *plugin.Column, number int) string { if c.Name != "" { return ktArgName(c.Name) } return fmt.Sprintf("dollar_%d", number) } -func ktColumnName(c *compiler.Column, pos int) string { +func ktColumnName(c *plugin.Column, pos int) string { if c.Name != "" { return c.Name } @@ -453,16 +445,16 @@ var postgresPlaceholderRegexp = regexp.MustCompile(`\B\$\d+\b`) // HACK: jdbc doesn't support numbered parameters, so we need to transform them to question marks... // But there's no access to the SQL parser here, so we just do a dumb regexp replace instead. This won't work if // the literal strings contain matching values, but good enough for a prototype. -func jdbcSQL(s string, engine config.Engine) string { - if engine == config.EnginePostgreSQL { +func jdbcSQL(s, engine string) string { + if engine == "postgresql" { return postgresPlaceholderRegexp.ReplaceAllString(s, "?") } return s } -func buildQueries(r *compiler.Result, settings config.CombinedSettings, structs []Struct) ([]Query, error) { - qs := make([]Query, 0, len(r.Queries)) - for _, query := range r.Queries { +func buildQueries(req *plugin.CodeGenRequest, structs []Struct) ([]Query, error) { + qs := make([]Query, 0, len(req.Queries)) + for _, query := range req.Queries { if query.Name == "" { continue } @@ -480,18 +472,18 @@ func buildQueries(r *compiler.Result, settings config.CombinedSettings, structs FieldName: codegen.LowerTitle(query.Name) + "Stmt", MethodName: codegen.LowerTitle(query.Name), SourceName: query.Filename, - SQL: jdbcSQL(query.SQL, settings.Package.Engine), + SQL: jdbcSQL(query.Text, req.Settings.Engine), Comments: query.Comments, } var cols []goColumn for _, p := range query.Params { cols = append(cols, goColumn{ - id: p.Number, + id: int(p.Number), Column: p.Column, }) } - params := ktColumnsToStruct(r, gq.ClassName+"Bindings", cols, settings, ktParamName) + params := ktColumnsToStruct(req, gq.ClassName+"Bindings", cols, ktParamName) gq.Arg = Params{ Struct: params, } @@ -500,7 +492,7 @@ func buildQueries(r *compiler.Result, settings config.CombinedSettings, structs c := query.Columns[0] gq.Ret = QueryValue{ Name: "results", - Typ: makeType(r, c, settings), + Typ: makeType(req, c), } } else if len(query.Columns) > 1 { var gs *Struct @@ -513,9 +505,9 @@ func buildQueries(r *compiler.Result, settings config.CombinedSettings, structs same := true for i, f := range s.Fields { c := query.Columns[i] - sameName := f.Name == MemberName(ktColumnName(c, i), settings) - sameType := f.Type == makeType(r, c, settings) - sameTable := sameTableName(c.Table, s.Table) + sameName := f.Name == memberName(ktColumnName(c, i), req.Settings) + sameType := f.Type == makeType(req, c) + sameTable := sameTableName(c.Table, &s.Table) if !sameName || !sameType || !sameTable { same = false @@ -535,7 +527,7 @@ func buildQueries(r *compiler.Result, settings config.CombinedSettings, structs Column: c, }) } - gs = ktColumnsToStruct(r, gq.ClassName+"Row", columns, settings, ktColumnName) + gs = ktColumnsToStruct(req, gq.ClassName+"Row", columns, ktColumnName) emit = true } gq.Ret = QueryValue{ @@ -741,7 +733,7 @@ type ktTmplCtx struct { Enums []Enum DataClasses []Struct Queries []Query - Settings config.Config + Settings *plugin.Settings // TODO: Race conditions SourceName string @@ -771,16 +763,16 @@ func ktFormat(s string) string { return o } -func Generate(r *compiler.Result, settings config.CombinedSettings) (map[string]string, error) { - enums := buildEnums(r, settings) - structs := buildDataClasses(r, settings) - queries, err := buildQueries(r, settings, structs) +func Generate(req *plugin.CodeGenRequest) (*plugin.CodeGenResponse, error) { + enums := buildEnums(req) + structs := buildDataClasses(req) + queries, err := buildQueries(req, structs) if err != nil { return nil, err } i := &importer{ - Settings: settings, + Settings: req.Settings, Enums: enums, DataClasses: structs, Queries: queries, @@ -797,11 +789,10 @@ func Generate(r *compiler.Result, settings config.CombinedSettings) (map[string] sqlFile := template.Must(template.New("table").Funcs(funcMap).Parse(ktSqlTmpl)) ifaceFile := template.Must(template.New("table").Funcs(funcMap).Parse(ktIfaceTmpl)) - pkg := settings.Package tctx := ktTmplCtx{ - Settings: settings.Global, + Settings: req.Settings, Q: `"""`, - Package: pkg.Gen.Kotlin.Package, + Package: req.Settings.Kotlin.Package, Queries: queries, Enums: enums, DataClasses: structs, @@ -835,5 +826,14 @@ func Generate(r *compiler.Result, settings config.CombinedSettings) (map[string] return nil, err } - return output, nil + resp := plugin.CodeGenResponse{} + + for filename, code := range output { + resp.Files = append(resp.Files, &plugin.File{ + Name: filename, + Contents: []byte(code), + }) + } + + return &resp, nil } diff --git a/internal/codegen/kotlin/imports.go b/internal/codegen/kotlin/imports.go index 068ebbed10..b136af4234 100644 --- a/internal/codegen/kotlin/imports.go +++ b/internal/codegen/kotlin/imports.go @@ -4,11 +4,11 @@ import ( "sort" "strings" - "github.com/kyleconroy/sqlc/internal/config" + "github.com/kyleconroy/sqlc/internal/plugin" ) type importer struct { - Settings config.CombinedSettings + Settings *plugin.Settings DataClasses []Struct Enums []Enum Queries []Query @@ -165,7 +165,7 @@ func (i *importer) queryImports(filename string) [][]string { std := stdImports(uses) std["java.sql.Connection"] = struct{}{} - if hasEnum() && i.Settings.Package.Engine == config.EnginePostgreSQL { + if hasEnum() && i.Settings.Engine == "postgresql" { std["java.sql.Types"] = struct{}{} } diff --git a/internal/codegen/kotlin/mysql_type.go b/internal/codegen/kotlin/mysql_type.go index 1aafee7ce6..69d9dc3d86 100644 --- a/internal/codegen/kotlin/mysql_type.go +++ b/internal/codegen/kotlin/mysql_type.go @@ -3,14 +3,20 @@ package kotlin import ( "log" - "github.com/kyleconroy/sqlc/internal/compiler" - "github.com/kyleconroy/sqlc/internal/config" "github.com/kyleconroy/sqlc/internal/debug" - "github.com/kyleconroy/sqlc/internal/sql/catalog" + "github.com/kyleconroy/sqlc/internal/plugin" ) -func mysqlType(r *compiler.Result, col *compiler.Column, settings config.CombinedSettings) (string, bool) { - columnType := col.DataType +func dataType(n *plugin.Identifier) string { + if n.Schema != "" { + return n.Schema + "." + n.Name + } else { + return n.Name + } +} + +func mysqlType(req *plugin.CodeGenRequest, col *plugin.Column) (string, bool) { + columnType := dataType(col.Type) switch columnType { @@ -52,16 +58,13 @@ func mysqlType(r *compiler.Result, col *compiler.Column, settings config.Combine return "Any", false default: - for _, schema := range r.Catalog.Schemas { - for _, typ := range schema.Types { - switch t := typ.(type) { - case *catalog.Enum: - if t.Name == columnType { - if schema.Name == r.Catalog.DefaultSchema { - return DataClassName(t.Name, settings), true - } - return DataClassName(schema.Name+"_"+t.Name, settings), true + for _, schema := range req.Catalog.Schemas { + for _, enum := range schema.Enums { + if columnType == enum.Name { + if schema.Name == req.Catalog.DefaultSchema { + return dataClassName(enum.Name, req.Settings), true } + return dataClassName(schema.Name+"_"+enum.Name, req.Settings), true } } } diff --git a/internal/codegen/kotlin/postgresql_type.go b/internal/codegen/kotlin/postgresql_type.go index aad440f32d..b2469a7a49 100644 --- a/internal/codegen/kotlin/postgresql_type.go +++ b/internal/codegen/kotlin/postgresql_type.go @@ -3,13 +3,11 @@ package kotlin import ( "log" - "github.com/kyleconroy/sqlc/internal/compiler" - "github.com/kyleconroy/sqlc/internal/config" - "github.com/kyleconroy/sqlc/internal/sql/catalog" + "github.com/kyleconroy/sqlc/internal/plugin" ) -func postgresType(r *compiler.Result, col *compiler.Column, settings config.CombinedSettings) (string, bool) { - columnType := col.DataType +func postgresType(req *plugin.CodeGenRequest, col *plugin.Column) (string, bool) { + columnType := dataType(col.Type) switch columnType { case "serial", "pg_catalog.serial4": @@ -84,20 +82,16 @@ func postgresType(r *compiler.Result, col *compiler.Column, settings config.Comb return "Any", false default: - for _, schema := range r.Catalog.Schemas { + for _, schema := range req.Catalog.Schemas { if schema.Name == "pg_catalog" { continue } - for _, typ := range schema.Types { - enum, ok := typ.(*catalog.Enum) - if !ok { - continue - } + for _, enum := range schema.Enums { if columnType == enum.Name { - if schema.Name == r.Catalog.DefaultSchema { - return DataClassName(enum.Name, settings), true + if schema.Name == req.Catalog.DefaultSchema { + return dataClassName(enum.Name, req.Settings), true } - return DataClassName(schema.Name+"_"+enum.Name, settings), true + return dataClassName(schema.Name+"_"+enum.Name, req.Settings), true } } } diff --git a/internal/plugin/codegen.pb.go b/internal/plugin/codegen.pb.go index a2724eb126..9baf30ae11 100644 --- a/internal/plugin/codegen.pb.go +++ b/internal/plugin/codegen.pb.go @@ -242,6 +242,7 @@ type Settings struct { Overrides []*Override `protobuf:"bytes,6,rep,name=overrides,proto3" json:"overrides,omitempty"` // TODO: Refactor codegen settings Python *PythonCode `protobuf:"bytes,8,opt,name=python,proto3" json:"python,omitempty"` + Kotlin *KotlinCode `protobuf:"bytes,9,opt,name=kotlin,proto3" json:"kotlin,omitempty"` } func (x *Settings) Reset() { @@ -325,6 +326,13 @@ func (x *Settings) GetPython() *PythonCode { return nil } +func (x *Settings) GetKotlin() *KotlinCode { + if x != nil { + return x.Kotlin + } + return nil +} + type PythonCode struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -404,6 +412,69 @@ func (x *PythonCode) GetOut() string { return "" } +type KotlinCode struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EmitExactTableNames bool `protobuf:"varint,1,opt,name=emit_exact_table_names,json=emitExactTableNames,proto3" json:"emit_exact_table_names,omitempty"` + Package string `protobuf:"bytes,2,opt,name=package,proto3" json:"package,omitempty"` + Out string `protobuf:"bytes,3,opt,name=out,proto3" json:"out,omitempty"` +} + +func (x *KotlinCode) Reset() { + *x = KotlinCode{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_codegen_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KotlinCode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KotlinCode) ProtoMessage() {} + +func (x *KotlinCode) ProtoReflect() protoreflect.Message { + mi := &file_plugin_codegen_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KotlinCode.ProtoReflect.Descriptor instead. +func (*KotlinCode) Descriptor() ([]byte, []int) { + return file_plugin_codegen_proto_rawDescGZIP(), []int{5} +} + +func (x *KotlinCode) GetEmitExactTableNames() bool { + if x != nil { + return x.EmitExactTableNames + } + return false +} + +func (x *KotlinCode) GetPackage() string { + if x != nil { + return x.Package + } + return "" +} + +func (x *KotlinCode) GetOut() string { + if x != nil { + return x.Out + } + return "" +} + type Catalog struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -418,7 +489,7 @@ type Catalog struct { func (x *Catalog) Reset() { *x = Catalog{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[5] + mi := &file_plugin_codegen_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -431,7 +502,7 @@ func (x *Catalog) String() string { func (*Catalog) ProtoMessage() {} func (x *Catalog) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[5] + mi := &file_plugin_codegen_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -444,7 +515,7 @@ func (x *Catalog) ProtoReflect() protoreflect.Message { // Deprecated: Use Catalog.ProtoReflect.Descriptor instead. func (*Catalog) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{5} + return file_plugin_codegen_proto_rawDescGZIP(), []int{6} } func (x *Catalog) GetComment() string { @@ -489,7 +560,7 @@ type Schema struct { func (x *Schema) Reset() { *x = Schema{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[6] + mi := &file_plugin_codegen_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -502,7 +573,7 @@ func (x *Schema) String() string { func (*Schema) ProtoMessage() {} func (x *Schema) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[6] + mi := &file_plugin_codegen_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -515,7 +586,7 @@ func (x *Schema) ProtoReflect() protoreflect.Message { // Deprecated: Use Schema.ProtoReflect.Descriptor instead. func (*Schema) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{6} + return file_plugin_codegen_proto_rawDescGZIP(), []int{7} } func (x *Schema) GetComment() string { @@ -559,7 +630,7 @@ type Enum struct { func (x *Enum) Reset() { *x = Enum{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[7] + mi := &file_plugin_codegen_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -572,7 +643,7 @@ func (x *Enum) String() string { func (*Enum) ProtoMessage() {} func (x *Enum) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[7] + mi := &file_plugin_codegen_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -585,7 +656,7 @@ func (x *Enum) ProtoReflect() protoreflect.Message { // Deprecated: Use Enum.ProtoReflect.Descriptor instead. func (*Enum) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{7} + return file_plugin_codegen_proto_rawDescGZIP(), []int{8} } func (x *Enum) GetName() string { @@ -622,7 +693,7 @@ type Table struct { func (x *Table) Reset() { *x = Table{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[8] + mi := &file_plugin_codegen_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -635,7 +706,7 @@ func (x *Table) String() string { func (*Table) ProtoMessage() {} func (x *Table) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[8] + mi := &file_plugin_codegen_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -648,7 +719,7 @@ func (x *Table) ProtoReflect() protoreflect.Message { // Deprecated: Use Table.ProtoReflect.Descriptor instead. func (*Table) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{8} + return file_plugin_codegen_proto_rawDescGZIP(), []int{9} } func (x *Table) GetRel() *Identifier { @@ -685,7 +756,7 @@ type Identifier struct { func (x *Identifier) Reset() { *x = Identifier{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[9] + mi := &file_plugin_codegen_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -698,7 +769,7 @@ func (x *Identifier) String() string { func (*Identifier) ProtoMessage() {} func (x *Identifier) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[9] + mi := &file_plugin_codegen_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -711,7 +782,7 @@ func (x *Identifier) ProtoReflect() protoreflect.Message { // Deprecated: Use Identifier.ProtoReflect.Descriptor instead. func (*Identifier) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{9} + return file_plugin_codegen_proto_rawDescGZIP(), []int{10} } func (x *Identifier) GetCatalog() string { @@ -758,7 +829,7 @@ type Column struct { func (x *Column) Reset() { *x = Column{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[10] + mi := &file_plugin_codegen_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -771,7 +842,7 @@ func (x *Column) String() string { func (*Column) ProtoMessage() {} func (x *Column) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[10] + mi := &file_plugin_codegen_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -784,7 +855,7 @@ func (x *Column) ProtoReflect() protoreflect.Message { // Deprecated: Use Column.ProtoReflect.Descriptor instead. func (*Column) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{10} + return file_plugin_codegen_proto_rawDescGZIP(), []int{11} } func (x *Column) GetName() string { @@ -888,7 +959,7 @@ type Query struct { func (x *Query) Reset() { *x = Query{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[11] + mi := &file_plugin_codegen_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -901,7 +972,7 @@ func (x *Query) String() string { func (*Query) ProtoMessage() {} func (x *Query) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[11] + mi := &file_plugin_codegen_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -914,7 +985,7 @@ func (x *Query) ProtoReflect() protoreflect.Message { // Deprecated: Use Query.ProtoReflect.Descriptor instead. func (*Query) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{11} + return file_plugin_codegen_proto_rawDescGZIP(), []int{12} } func (x *Query) GetText() string { @@ -978,7 +1049,7 @@ type Parameter struct { func (x *Parameter) Reset() { *x = Parameter{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[12] + mi := &file_plugin_codegen_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -991,7 +1062,7 @@ func (x *Parameter) String() string { func (*Parameter) ProtoMessage() {} func (x *Parameter) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[12] + mi := &file_plugin_codegen_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1004,7 +1075,7 @@ func (x *Parameter) ProtoReflect() protoreflect.Message { // Deprecated: Use Parameter.ProtoReflect.Descriptor instead. func (*Parameter) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{12} + return file_plugin_codegen_proto_rawDescGZIP(), []int{13} } func (x *Parameter) GetNumber() int32 { @@ -1034,7 +1105,7 @@ type CodeGenRequest struct { func (x *CodeGenRequest) Reset() { *x = CodeGenRequest{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[13] + mi := &file_plugin_codegen_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1047,7 +1118,7 @@ func (x *CodeGenRequest) String() string { func (*CodeGenRequest) ProtoMessage() {} func (x *CodeGenRequest) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[13] + mi := &file_plugin_codegen_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1060,7 +1131,7 @@ func (x *CodeGenRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CodeGenRequest.ProtoReflect.Descriptor instead. func (*CodeGenRequest) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{13} + return file_plugin_codegen_proto_rawDescGZIP(), []int{14} } func (x *CodeGenRequest) GetSettings() *Settings { @@ -1095,7 +1166,7 @@ type CodeGenResponse struct { func (x *CodeGenResponse) Reset() { *x = CodeGenResponse{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[14] + mi := &file_plugin_codegen_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1108,7 +1179,7 @@ func (x *CodeGenResponse) String() string { func (*CodeGenResponse) ProtoMessage() {} func (x *CodeGenResponse) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[14] + mi := &file_plugin_codegen_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1121,7 +1192,7 @@ func (x *CodeGenResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CodeGenResponse.ProtoReflect.Descriptor instead. func (*CodeGenResponse) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{14} + return file_plugin_codegen_proto_rawDescGZIP(), []int{15} } func (x *CodeGenResponse) GetFiles() []*File { @@ -1158,7 +1229,7 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 0x22, 0x38, 0x0a, 0x0a, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xbb, 0x02, 0x0a, 0x08, 0x53, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xe7, 0x02, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, @@ -1174,115 +1245,125 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x50, 0x79, 0x74, 0x68, 0x6f, - 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x1a, 0x39, 0x0a, - 0x0b, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc7, 0x01, 0x0a, 0x0a, 0x50, 0x79, 0x74, - 0x68, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x16, 0x65, 0x6d, 0x69, 0x74, 0x5f, - 0x65, 0x78, 0x61, 0x63, 0x74, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6d, 0x69, 0x74, 0x45, 0x78, 0x61, - 0x63, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x11, - 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x65, 0x6d, 0x69, 0x74, 0x53, 0x79, 0x6e, - 0x63, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x6d, 0x69, 0x74, - 0x5f, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x72, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x6d, 0x69, 0x74, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x51, - 0x75, 0x65, 0x72, 0x69, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, - 0x75, 0x74, 0x22, 0x88, 0x01, 0x0a, 0x07, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x18, - 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x22, 0x81, 0x01, - 0x0a, 0x06, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, - 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x22, 0x0a, - 0x05, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x05, 0x65, 0x6e, 0x75, 0x6d, - 0x73, 0x22, 0x48, 0x0a, 0x04, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x76, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x76, 0x61, 0x6c, - 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x71, 0x0a, 0x05, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x12, 0x24, 0x0a, 0x03, 0x72, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, + 0x06, 0x6b, 0x6f, 0x74, 0x6c, 0x69, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x4b, 0x6f, 0x74, 0x6c, 0x69, 0x6e, 0x43, 0x6f, 0x64, + 0x65, 0x52, 0x06, 0x6b, 0x6f, 0x74, 0x6c, 0x69, 0x6e, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x6e, + 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc7, 0x01, 0x0a, 0x0a, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x43, + 0x6f, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x16, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x65, 0x78, 0x61, 0x63, + 0x74, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6d, 0x69, 0x74, 0x45, 0x78, 0x61, 0x63, 0x74, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x65, 0x6d, 0x69, 0x74, + 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0f, 0x65, 0x6d, 0x69, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x51, 0x75, 0x65, + 0x72, 0x69, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x61, 0x73, 0x79, + 0x6e, 0x63, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x10, 0x65, 0x6d, 0x69, 0x74, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x51, 0x75, 0x65, 0x72, 0x69, + 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x22, 0x6d, + 0x0a, 0x0a, 0x4b, 0x6f, 0x74, 0x6c, 0x69, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x16, + 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x65, 0x78, 0x61, 0x63, 0x74, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6d, + 0x69, 0x74, 0x45, 0x78, 0x61, 0x63, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6f, + 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x22, 0x88, 0x01, + 0x0a, 0x07, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, + 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, + 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x06, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x05, 0x65, 0x6e, 0x75, 0x6d, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x05, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x22, 0x48, 0x0a, 0x04, + 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x61, 0x6c, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x71, 0x0a, 0x05, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, + 0x24, 0x0a, 0x03, 0x72, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x52, 0x03, 0x72, 0x65, 0x6c, 0x12, 0x28, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, + 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, + 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x52, 0x0a, 0x0a, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, + 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, + 0x67, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xf2, 0x02, + 0x0a, 0x06, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x6e, 0x6f, 0x74, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x6e, 0x6f, 0x74, 0x4e, 0x75, 0x6c, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x61, 0x72, + 0x72, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x41, 0x72, 0x72, + 0x61, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x64, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, + 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x20, 0x0a, 0x0c, 0x69, 0x73, + 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0a, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, + 0x70, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x03, 0x72, 0x65, 0x6c, 0x12, 0x28, 0x0a, 0x07, 0x63, 0x6f, - 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x6c, - 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x52, - 0x0a, 0x0a, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, - 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, - 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0xf2, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x74, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x6e, 0x6f, 0x74, 0x4e, 0x75, 0x6c, 0x6c, 0x12, 0x19, 0x0a, 0x08, - 0x69, 0x73, 0x5f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0c, 0x69, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, - 0x20, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x43, 0x61, 0x6c, - 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, - 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, - 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x69, - 0x61, 0x73, 0x12, 0x26, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x72, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, - 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, - 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x22, 0xd2, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6d, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x12, 0x28, 0x0a, 0x07, 0x63, - 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x07, 0x63, 0x6f, - 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x2d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4b, 0x0a, 0x09, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x26, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, - 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x22, 0x92, 0x01, 0x0a, 0x0e, 0x43, 0x6f, - 0x64, 0x65, 0x47, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x08, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x29, 0x0a, 0x07, 0x63, 0x61, - 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x52, 0x07, 0x63, 0x61, - 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x27, 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x35, - 0x0a, 0x0f, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x22, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0c, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x05, - 0x66, 0x69, 0x6c, 0x65, 0x73, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x79, 0x6c, 0x65, 0x63, 0x6f, 0x6e, 0x72, 0x6f, 0x79, 0x2f, 0x73, - 0x71, 0x6c, 0x63, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x26, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, + 0x70, 0x65, 0x22, 0xd2, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x12, 0x28, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, + 0x12, 0x2d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, + 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x66, + 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, + 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4b, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x06, + 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x06, 0x63, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x22, 0x92, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x08, 0x73, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x29, 0x0a, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, + 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x52, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, + 0x12, 0x27, 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x35, 0x0a, 0x0f, 0x43, 0x6f, 0x64, + 0x65, 0x47, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x05, + 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, + 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, + 0x79, 0x6c, 0x65, 0x63, 0x6f, 0x6e, 0x72, 0x6f, 0x79, 0x2f, 0x73, 0x71, 0x6c, 0x63, 0x2f, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1297,50 +1378,52 @@ func file_plugin_codegen_proto_rawDescGZIP() []byte { return file_plugin_codegen_proto_rawDescData } -var file_plugin_codegen_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_plugin_codegen_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_plugin_codegen_proto_goTypes = []interface{}{ (*File)(nil), // 0: plugin.File (*Override)(nil), // 1: plugin.Override (*PythonType)(nil), // 2: plugin.PythonType (*Settings)(nil), // 3: plugin.Settings (*PythonCode)(nil), // 4: plugin.PythonCode - (*Catalog)(nil), // 5: plugin.Catalog - (*Schema)(nil), // 6: plugin.Schema - (*Enum)(nil), // 7: plugin.Enum - (*Table)(nil), // 8: plugin.Table - (*Identifier)(nil), // 9: plugin.Identifier - (*Column)(nil), // 10: plugin.Column - (*Query)(nil), // 11: plugin.Query - (*Parameter)(nil), // 12: plugin.Parameter - (*CodeGenRequest)(nil), // 13: plugin.CodeGenRequest - (*CodeGenResponse)(nil), // 14: plugin.CodeGenResponse - nil, // 15: plugin.Settings.RenameEntry + (*KotlinCode)(nil), // 5: plugin.KotlinCode + (*Catalog)(nil), // 6: plugin.Catalog + (*Schema)(nil), // 7: plugin.Schema + (*Enum)(nil), // 8: plugin.Enum + (*Table)(nil), // 9: plugin.Table + (*Identifier)(nil), // 10: plugin.Identifier + (*Column)(nil), // 11: plugin.Column + (*Query)(nil), // 12: plugin.Query + (*Parameter)(nil), // 13: plugin.Parameter + (*CodeGenRequest)(nil), // 14: plugin.CodeGenRequest + (*CodeGenResponse)(nil), // 15: plugin.CodeGenResponse + nil, // 16: plugin.Settings.RenameEntry } var file_plugin_codegen_proto_depIdxs = []int32{ - 9, // 0: plugin.Override.table:type_name -> plugin.Identifier + 10, // 0: plugin.Override.table:type_name -> plugin.Identifier 2, // 1: plugin.Override.python_type:type_name -> plugin.PythonType - 15, // 2: plugin.Settings.rename:type_name -> plugin.Settings.RenameEntry + 16, // 2: plugin.Settings.rename:type_name -> plugin.Settings.RenameEntry 1, // 3: plugin.Settings.overrides:type_name -> plugin.Override 4, // 4: plugin.Settings.python:type_name -> plugin.PythonCode - 6, // 5: plugin.Catalog.schemas:type_name -> plugin.Schema - 8, // 6: plugin.Schema.tables:type_name -> plugin.Table - 7, // 7: plugin.Schema.enums:type_name -> plugin.Enum - 9, // 8: plugin.Table.rel:type_name -> plugin.Identifier - 10, // 9: plugin.Table.columns:type_name -> plugin.Column - 9, // 10: plugin.Column.table:type_name -> plugin.Identifier - 9, // 11: plugin.Column.type:type_name -> plugin.Identifier - 10, // 12: plugin.Query.columns:type_name -> plugin.Column - 12, // 13: plugin.Query.params:type_name -> plugin.Parameter - 10, // 14: plugin.Parameter.column:type_name -> plugin.Column - 3, // 15: plugin.CodeGenRequest.settings:type_name -> plugin.Settings - 5, // 16: plugin.CodeGenRequest.catalog:type_name -> plugin.Catalog - 11, // 17: plugin.CodeGenRequest.queries:type_name -> plugin.Query - 0, // 18: plugin.CodeGenResponse.files:type_name -> plugin.File - 19, // [19:19] is the sub-list for method output_type - 19, // [19:19] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name + 5, // 5: plugin.Settings.kotlin:type_name -> plugin.KotlinCode + 7, // 6: plugin.Catalog.schemas:type_name -> plugin.Schema + 9, // 7: plugin.Schema.tables:type_name -> plugin.Table + 8, // 8: plugin.Schema.enums:type_name -> plugin.Enum + 10, // 9: plugin.Table.rel:type_name -> plugin.Identifier + 11, // 10: plugin.Table.columns:type_name -> plugin.Column + 10, // 11: plugin.Column.table:type_name -> plugin.Identifier + 10, // 12: plugin.Column.type:type_name -> plugin.Identifier + 11, // 13: plugin.Query.columns:type_name -> plugin.Column + 13, // 14: plugin.Query.params:type_name -> plugin.Parameter + 11, // 15: plugin.Parameter.column:type_name -> plugin.Column + 3, // 16: plugin.CodeGenRequest.settings:type_name -> plugin.Settings + 6, // 17: plugin.CodeGenRequest.catalog:type_name -> plugin.Catalog + 12, // 18: plugin.CodeGenRequest.queries:type_name -> plugin.Query + 0, // 19: plugin.CodeGenResponse.files:type_name -> plugin.File + 20, // [20:20] is the sub-list for method output_type + 20, // [20:20] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_plugin_codegen_proto_init() } @@ -1410,7 +1493,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Catalog); i { + switch v := v.(*KotlinCode); i { case 0: return &v.state case 1: @@ -1422,7 +1505,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Schema); i { + switch v := v.(*Catalog); i { case 0: return &v.state case 1: @@ -1434,7 +1517,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Enum); i { + switch v := v.(*Schema); i { case 0: return &v.state case 1: @@ -1446,7 +1529,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Table); i { + switch v := v.(*Enum); i { case 0: return &v.state case 1: @@ -1458,7 +1541,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Identifier); i { + switch v := v.(*Table); i { case 0: return &v.state case 1: @@ -1470,7 +1553,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Column); i { + switch v := v.(*Identifier); i { case 0: return &v.state case 1: @@ -1482,7 +1565,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Query); i { + switch v := v.(*Column); i { case 0: return &v.state case 1: @@ -1494,7 +1577,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Parameter); i { + switch v := v.(*Query); i { case 0: return &v.state case 1: @@ -1506,7 +1589,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CodeGenRequest); i { + switch v := v.(*Parameter); i { case 0: return &v.state case 1: @@ -1518,6 +1601,18 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CodeGenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_codegen_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CodeGenResponse); i { case 0: return &v.state @@ -1536,7 +1631,7 @@ func file_plugin_codegen_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_plugin_codegen_proto_rawDesc, NumEnums: 0, - NumMessages: 16, + NumMessages: 17, NumExtensions: 0, NumServices: 0, }, diff --git a/protos/plugin/codegen.proto b/protos/plugin/codegen.proto index 325b87105b..252d24ecd8 100644 --- a/protos/plugin/codegen.proto +++ b/protos/plugin/codegen.proto @@ -48,6 +48,7 @@ message Settings // TODO: Refactor codegen settings PythonCode python = 8; + KotlinCode kotlin = 9; } message PythonCode @@ -59,6 +60,13 @@ message PythonCode string out = 5; } +message KotlinCode +{ + bool emit_exact_table_names = 1; + string package = 2; + string out = 3; +} + message Catalog { string comment = 1;