diff --git a/docs/reference/language-support.rst b/docs/reference/language-support.rst index 34a4967a24..068c8a9518 100644 --- a/docs/reference/language-support.rst +++ b/docs/reference/language-support.rst @@ -1,13 +1,13 @@ Database and language support ############################# -======== ============ ============ =============== -Language MySQL PostgreSQL SQLite -======== ============ ============ =============== -Go Stable Stable Beta -Kotlin Beta Beta Not implemented -Python Beta Beta Not implemented -======== ============ ============ =============== +======== ================ ============ ============ =============== +Language Plugin MySQL PostgreSQL SQLite +======== ================= ============ ============ =============== +Go (built-in) Stable Stable Beta +Kotlin sqlc-gen-kotlin Beta Beta Not implemented +Python sqlc-gen-python Beta Beta Not implemented +======== ================= ============ ============ =============== Future Language Support ************************ diff --git a/internal/cmd/generate.go b/internal/cmd/generate.go index 49334893d2..37c513b6e1 100644 --- a/internal/cmd/generate.go +++ b/internal/cmd/generate.go @@ -13,7 +13,6 @@ import ( "github.com/kyleconroy/sqlc/internal/codegen/golang" "github.com/kyleconroy/sqlc/internal/codegen/json" - "github.com/kyleconroy/sqlc/internal/codegen/kotlin" "github.com/kyleconroy/sqlc/internal/codegen/python" "github.com/kyleconroy/sqlc/internal/compiler" "github.com/kyleconroy/sqlc/internal/config" @@ -142,12 +141,6 @@ func Generate(ctx context.Context, e Env, dir, filename string, stderr io.Writer Gen: config.SQLGen{Go: sql.Gen.Go}, }) } - if sql.Gen.Kotlin != nil { - pairs = append(pairs, outPair{ - SQL: sql, - Gen: config.SQLGen{Kotlin: sql.Gen.Kotlin}, - }) - } if sql.Gen.Python != nil { pairs = append(pairs, outPair{ SQL: sql, @@ -197,10 +190,6 @@ func Generate(ctx context.Context, e Env, dir, filename string, stderr io.Writer name = combo.Go.Package lang = "golang" - case sql.Gen.Kotlin != nil: - lang = "kotlin" - name = combo.Kotlin.Package - case sql.Gen.Python != nil: lang = "python" name = combo.Python.Package @@ -301,10 +290,6 @@ func codegen(ctx context.Context, combo config.CombinedSettings, sql outPair, re out = combo.Go.Out handler = ext.HandleFunc(golang.Generate) - case sql.Gen.Kotlin != nil: - out = combo.Kotlin.Out - handler = ext.HandleFunc(kotlin.Generate) - case sql.Gen.Python != nil: out = combo.Python.Out handler = ext.HandleFunc(python.Generate) diff --git a/internal/cmd/shim.go b/internal/cmd/shim.go index 550c415b88..b83a400903 100644 --- a/internal/cmd/shim.go +++ b/internal/cmd/shim.go @@ -59,7 +59,6 @@ func pluginSettings(cs config.CombinedSettings) *plugin.Settings { Rename: cs.Rename, Codegen: pluginCodegen(cs.Codegen), Python: pluginPythonCode(cs.Python), - Kotlin: pluginKotlinCode(cs.Kotlin), Go: pluginGoCode(cs.Go), Json: pluginJSONCode(cs.JSON), } @@ -137,15 +136,6 @@ 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, - InflectionExcludeTableNames: s.InflectionExcludeTableNames, - } -} - func pluginJSONCode(s config.SQLJSON) *plugin.JSONCode { return &plugin.JSONCode{ Out: s.Out, diff --git a/internal/codegen/kotlin/gen.go b/internal/codegen/kotlin/gen.go deleted file mode 100644 index 71242969da..0000000000 --- a/internal/codegen/kotlin/gen.go +++ /dev/null @@ -1,883 +0,0 @@ -package kotlin - -import ( - "bufio" - "bytes" - "context" - "errors" - "fmt" - "regexp" - "sort" - "strconv" - "strings" - "text/template" - - "github.com/kyleconroy/sqlc/internal/codegen/sdk" - "github.com/kyleconroy/sqlc/internal/inflection" - "github.com/kyleconroy/sqlc/internal/metadata" - "github.com/kyleconroy/sqlc/internal/plugin" -) - -var ktIdentPattern = regexp.MustCompile("[^a-zA-Z0-9_]+") - -type Constant struct { - Name string - Type string - Value string -} - -type Enum struct { - Name string - Comment string - Constants []Constant -} - -type Field struct { - ID int - Name string - Type ktType - Comment string -} - -type Struct struct { - Table plugin.Identifier - Name string - Fields []Field - Comment string -} - -type QueryValue struct { - Emit bool - Name string - Struct *Struct - Typ ktType -} - -func (v QueryValue) EmitStruct() bool { - return v.Emit -} - -func (v QueryValue) IsStruct() bool { - return v.Struct != nil -} - -func (v QueryValue) isEmpty() bool { - return v.Typ == (ktType{}) && v.Name == "" && v.Struct == nil -} - -func (v QueryValue) Type() string { - if v.Typ != (ktType{}) { - return v.Typ.String() - } - if v.Struct != nil { - return v.Struct.Name - } - panic("no type for QueryValue: " + v.Name) -} - -func jdbcSet(t ktType, idx int, name string) string { - if t.IsEnum && t.IsArray { - 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 == "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) - } - } - if t.IsArray { - return fmt.Sprintf(`stmt.setArray(%d, conn.createArrayOf("%s", %s.toTypedArray()))`, idx, t.DataType, name) - } - if t.IsTime() { - return fmt.Sprintf("stmt.setObject(%d, %s)", idx, name) - } - if t.IsInstant() { - return fmt.Sprintf("stmt.setTimestamp(%d, Timestamp.from(%s))", idx, name) - } - if t.IsUUID() { - return fmt.Sprintf("stmt.setObject(%d, %s)", idx, name) - } - return fmt.Sprintf("stmt.set%s(%d, %s)", t.Name, idx, name) -} - -type Params struct { - Struct *Struct - binding []int -} - -func (v Params) isEmpty() bool { - return len(v.Struct.Fields) == 0 -} - -func (v Params) Args() string { - if v.isEmpty() { - return "" - } - var out []string - fields := v.Struct.Fields - for _, f := range fields { - out = append(out, f.Name+": "+f.Type.String()) - } - if len(v.binding) > 0 { - lookup := map[int]int{} - for i, v := range v.binding { - lookup[v] = i - } - sort.Slice(out, func(i, j int) bool { - return lookup[fields[i].ID] < lookup[fields[j].ID] - }) - } - if len(out) < 3 { - return strings.Join(out, ", ") - } - return "\n" + indent(strings.Join(out, ",\n"), 6, -1) -} - -func (v Params) Bindings() string { - if v.isEmpty() { - return "" - } - var out []string - if len(v.binding) > 0 { - for i, idx := range v.binding { - f := v.Struct.Fields[idx-1] - out = append(out, jdbcSet(f.Type, i+1, f.Name)) - } - } else { - for i, f := range v.Struct.Fields { - out = append(out, jdbcSet(f.Type, i+1, f.Name)) - } - } - return indent(strings.Join(out, "\n"), 10, 0) -} - -func jdbcGet(t ktType, idx int) string { - if t.IsEnum && t.IsArray { - return fmt.Sprintf(`(results.getArray(%d).array as Array).map { v -> %s.lookup(v)!! }.toList()`, idx, t.Name) - } - if t.IsEnum { - return fmt.Sprintf("%s.lookup(results.getString(%d))!!", t.Name, idx) - } - if t.IsArray { - return fmt.Sprintf(`(results.getArray(%d).array as Array<%s>).toList()`, idx, t.Name) - } - if t.IsTime() { - return fmt.Sprintf(`results.getObject(%d, %s::class.java)`, idx, t.Name) - } - if t.IsInstant() { - return fmt.Sprintf(`results.getTimestamp(%d).toInstant()`, idx) - } - if t.IsUUID() { - var nullCast string - if t.IsNull { - nullCast = "?" - } - return fmt.Sprintf(`results.getObject(%d) as%s %s`, idx, nullCast, t.Name) - } - return fmt.Sprintf(`results.get%s(%d)`, t.Name, idx) -} - -func (v QueryValue) ResultSet() string { - var out []string - if v.Struct == nil { - return jdbcGet(v.Typ, 1) - } - for i, f := range v.Struct.Fields { - out = append(out, jdbcGet(f.Type, i+1)) - } - ret := indent(strings.Join(out, ",\n"), 4, -1) - ret = indent(v.Struct.Name+"(\n"+ret+"\n)", 12, 0) - return ret -} - -func indent(s string, n int, firstIndent int) string { - lines := strings.Split(s, "\n") - buf := bytes.NewBuffer(nil) - for i, l := range lines { - indent := n - if i == 0 && firstIndent != -1 { - indent = firstIndent - } - if i != 0 { - buf.WriteRune('\n') - } - for i := 0; i < indent; i++ { - buf.WriteRune(' ') - } - buf.WriteString(l) - } - return buf.String() -} - -// A struct used to generate methods and fields on the Queries struct -type Query struct { - ClassName string - Cmd string - Comments []string - MethodName string - FieldName string - ConstantName string - SQL string - SourceName string - Ret QueryValue - Arg Params -} - -func ktEnumValueName(value string) string { - id := strings.Replace(value, "-", "_", -1) - id = strings.Replace(id, ":", "_", -1) - id = strings.Replace(id, "/", "_", -1) - id = ktIdentPattern.ReplaceAllString(id, "") - return strings.ToUpper(id) -} - -func buildEnums(req *plugin.CodeGenRequest) []Enum { - var enums []Enum - for _, schema := range req.Catalog.Schemas { - if schema.Name == "pg_catalog" || schema.Name == "information_schema" { - continue - } - for _, enum := range schema.Enums { - var enumName string - if schema.Name == req.Catalog.DefaultSchema { - enumName = enum.Name - } else { - enumName = schema.Name + "_" + enum.Name - } - e := Enum{ - Name: dataClassName(enumName, req.Settings), - Comment: enum.Comment, - } - for _, v := range enum.Vals { - e.Constants = append(e.Constants, Constant{ - Name: ktEnumValueName(v), - Value: v, - Type: e.Name, - }) - } - enums = append(enums, e) - } - } - if len(enums) > 0 { - sort.Slice(enums, func(i, j int) bool { return enums[i].Name < enums[j].Name }) - } - return enums -} - -func dataClassName(name string, settings *plugin.Settings) string { - if rename := settings.Rename[name]; rename != "" { - return rename - } - out := "" - for _, p := range strings.Split(name, "_") { - out += strings.Title(p) - } - return out -} - -func memberName(name string, settings *plugin.Settings) string { - return sdk.LowerTitle(dataClassName(name, settings)) -} - -func buildDataClasses(req *plugin.CodeGenRequest) []Struct { - var structs []Struct - for _, schema := range req.Catalog.Schemas { - if schema.Name == "pg_catalog" || schema.Name == "information_schema" { - continue - } - for _, table := range schema.Tables { - var tableName string - if schema.Name == req.Catalog.DefaultSchema { - tableName = table.Rel.Name - } else { - tableName = schema.Name + "_" + table.Rel.Name - } - structName := dataClassName(tableName, req.Settings) - if !req.Settings.Kotlin.EmitExactTableNames { - structName = inflection.Singular(inflection.SingularParams{ - Name: structName, - Exclusions: req.Settings.Kotlin.InflectionExcludeTableNames, - }) - } - s := Struct{ - 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, req.Settings), - Type: makeType(req, column), - Comment: column.Comment, - }) - } - structs = append(structs, s) - } - } - if len(structs) > 0 { - sort.Slice(structs, func(i, j int) bool { return structs[i].Name < structs[j].Name }) - } - return structs -} - -type ktType struct { - Name string - IsEnum bool - IsArray bool - IsNull bool - DataType string - Engine string -} - -func (t ktType) String() string { - v := t.Name - if t.IsArray { - v = fmt.Sprintf("List<%s>", v) - } else if t.IsNull { - v += "?" - } - return v -} - -func (t ktType) jdbcSetter() string { - return "set" + t.jdbcType() -} - -func (t ktType) jdbcType() string { - if t.IsArray { - return "Array" - } - if t.IsEnum || t.IsTime() { - return "Object" - } - if t.IsInstant() { - return "Timestamp" - } - return t.Name -} - -func (t ktType) IsTime() bool { - return t.Name == "LocalDate" || t.Name == "LocalDateTime" || t.Name == "LocalTime" || t.Name == "OffsetDateTime" -} - -func (t ktType) IsInstant() bool { - return t.Name == "Instant" -} - -func (t ktType) IsUUID() bool { - return t.Name == "UUID" -} - -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: sdk.DataType(col.Type), - Engine: req.Settings.Engine, - } -} - -func ktInnerType(req *plugin.CodeGenRequest, col *plugin.Column) (string, bool) { - // TODO: Extend the engine interface to handle types - switch req.Settings.Engine { - case "mysql": - return mysqlType(req, col) - case "postgresql": - return postgresType(req, col) - default: - return "Any", false - } -} - -type goColumn struct { - id int - *plugin.Column -} - -func ktColumnsToStruct(req *plugin.CodeGenRequest, name string, columns []goColumn, namer func(*plugin.Column, int) string) *Struct { - gs := Struct{ - Name: name, - } - idSeen := map[int]Field{} - nameSeen := map[string]int{} - for _, c := range columns { - if _, ok := idSeen[c.id]; ok { - continue - } - 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{ - ID: c.id, - Name: fieldName, - Type: makeType(req, c.Column), - } - gs.Fields = append(gs.Fields, field) - nameSeen[c.Name]++ - idSeen[c.id] = field - } - return &gs -} - -func ktArgName(name string) string { - out := "" - for i, p := range strings.Split(name, "_") { - if i == 0 { - out += strings.ToLower(p) - } else { - out += strings.Title(p) - } - } - return out -} - -func ktParamName(c *plugin.Column, number int) string { - if c.Name != "" { - return ktArgName(c.Name) - } - return fmt.Sprintf("dollar_%d", number) -} - -func ktColumnName(c *plugin.Column, pos int) string { - if c.Name != "" { - return c.Name - } - return fmt.Sprintf("column_%d", pos+1) -} - -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, engine string) (string, []string) { - if engine != "postgresql" { - return s, nil - } - var args []string - q := postgresPlaceholderRegexp.ReplaceAllStringFunc(s, func(placeholder string) string { - args = append(args, placeholder) - return "?" - }) - return q, args -} - -func parseInts(s []string) ([]int, error) { - if len(s) == 0 { - return nil, nil - } - var refs []int - for _, v := range s { - i, err := strconv.Atoi(strings.TrimPrefix(v, "$")) - if err != nil { - return nil, err - } - refs = append(refs, i) - } - return refs, nil -} - -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 - } - if query.Cmd == "" { - continue - } - if query.Cmd == metadata.CmdCopyFrom { - return nil, errors.New("Support for CopyFrom in Kotlin is not implemented") - } - - ql, args := jdbcSQL(query.Text, req.Settings.Engine) - refs, err := parseInts(args) - if err != nil { - return nil, fmt.Errorf("Invalid parameter reference: %w", err) - } - gq := Query{ - Cmd: query.Cmd, - ClassName: strings.Title(query.Name), - ConstantName: sdk.LowerTitle(query.Name), - FieldName: sdk.LowerTitle(query.Name) + "Stmt", - MethodName: sdk.LowerTitle(query.Name), - SourceName: query.Filename, - SQL: ql, - Comments: query.Comments, - } - - var cols []goColumn - for _, p := range query.Params { - cols = append(cols, goColumn{ - id: int(p.Number), - Column: p.Column, - }) - } - params := ktColumnsToStruct(req, gq.ClassName+"Bindings", cols, ktParamName) - gq.Arg = Params{ - Struct: params, - binding: refs, - } - - if len(query.Columns) == 1 { - c := query.Columns[0] - gq.Ret = QueryValue{ - Name: "results", - Typ: makeType(req, c), - } - } else if len(query.Columns) > 1 { - var gs *Struct - var emit bool - - for _, s := range structs { - if len(s.Fields) != len(query.Columns) { - continue - } - same := true - for i, f := range s.Fields { - c := query.Columns[i] - sameName := f.Name == memberName(ktColumnName(c, i), req.Settings) - sameType := f.Type == makeType(req, c) - sameTable := sdk.SameTableName(c.Table, &s.Table, req.Catalog.DefaultSchema) - - if !sameName || !sameType || !sameTable { - same = false - } - } - if same { - gs = &s - break - } - } - - if gs == nil { - var columns []goColumn - for i, c := range query.Columns { - columns = append(columns, goColumn{ - id: i, - Column: c, - }) - } - gs = ktColumnsToStruct(req, gq.ClassName+"Row", columns, ktColumnName) - emit = true - } - gq.Ret = QueryValue{ - Emit: emit, - Name: "results", - Struct: gs, - } - } - - qs = append(qs, gq) - } - sort.Slice(qs, func(i, j int) bool { return qs[i].MethodName < qs[j].MethodName }) - return qs, nil -} - -var ktIfaceTmpl = `// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc {{.SqlcVersion}} - -package {{.Package}} - -{{range imports .SourceName}} -{{range .}}import {{.}} -{{end}} -{{end}} - -interface Queries { - {{- range .Queries}} - @Throws(SQLException::class) - {{- if eq .Cmd ":one"}} - fun {{.MethodName}}({{.Arg.Args}}): {{.Ret.Type}}? - {{- end}} - {{- if eq .Cmd ":many"}} - fun {{.MethodName}}({{.Arg.Args}}): List<{{.Ret.Type}}> - {{- end}} - {{- if eq .Cmd ":exec"}} - fun {{.MethodName}}({{.Arg.Args}}) - {{- end}} - {{- if eq .Cmd ":execrows"}} - fun {{.MethodName}}({{.Arg.Args}}): Int - {{- end}} - {{- if eq .Cmd ":execresult"}} - fun {{.MethodName}}({{.Arg.Args}}): Long - {{- end}} - {{end}} -} -` - -var ktModelsTmpl = `// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc {{.SqlcVersion}} - -package {{.Package}} - -{{range imports .SourceName}} -{{range .}}import {{.}} -{{end}} -{{end}} - -{{range .Enums}} -{{if .Comment}}{{comment .Comment}}{{end}} -enum class {{.Name}}(val value: String) { - {{- range $i, $e := .Constants}} - {{- if $i }},{{end}} - {{.Name}}("{{.Value}}") - {{- end}}; - - companion object { - private val map = {{.Name}}.values().associateBy({{.Name}}::value) - fun lookup(value: String) = map[value] - } -} -{{end}} - -{{range .DataClasses}} -{{if .Comment}}{{comment .Comment}}{{end}} -data class {{.Name}} ( {{- range $i, $e := .Fields}} - {{- if $i }},{{end}} - {{- if .Comment}} - {{comment .Comment}}{{else}} - {{- end}} - val {{.Name}}: {{.Type}} - {{- end}} -) -{{end}} -` - -var ktSqlTmpl = `// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc {{.SqlcVersion}} - -package {{.Package}} - -{{range imports .SourceName}} -{{range .}}import {{.}} -{{end}} -{{end}} - -{{range .Queries}} -const val {{.ConstantName}} = {{$.Q}}-- name: {{.MethodName}} {{.Cmd}} -{{.SQL}} -{{$.Q}} - -{{if .Ret.EmitStruct}} -data class {{.Ret.Type}} ( {{- range $i, $e := .Ret.Struct.Fields}} - {{- if $i }},{{end}} - val {{.Name}}: {{.Type}} - {{- end}} -) -{{end}} -{{end}} - -class QueriesImpl(private val conn: Connection) : Queries { -{{range .Queries}} -{{if eq .Cmd ":one"}} -{{range .Comments}}//{{.}} -{{end}} - @Throws(SQLException::class) - override fun {{.MethodName}}({{.Arg.Args}}): {{.Ret.Type}}? { - return conn.prepareStatement({{.ConstantName}}).use { stmt -> - {{.Arg.Bindings}} - - val results = stmt.executeQuery() - if (!results.next()) { - return null - } - val ret = {{.Ret.ResultSet}} - if (results.next()) { - throw SQLException("expected one row in result set, but got many") - } - ret - } - } -{{end}} - -{{if eq .Cmd ":many"}} -{{range .Comments}}//{{.}} -{{end}} - @Throws(SQLException::class) - override fun {{.MethodName}}({{.Arg.Args}}): List<{{.Ret.Type}}> { - return conn.prepareStatement({{.ConstantName}}).use { stmt -> - {{.Arg.Bindings}} - - val results = stmt.executeQuery() - val ret = mutableListOf<{{.Ret.Type}}>() - while (results.next()) { - ret.add({{.Ret.ResultSet}}) - } - ret - } - } -{{end}} - -{{if eq .Cmd ":exec"}} -{{range .Comments}}//{{.}} -{{end}} - @Throws(SQLException::class) - {{ if $.EmitInterface }}override {{ end -}} - override fun {{.MethodName}}({{.Arg.Args}}) { - conn.prepareStatement({{.ConstantName}}).use { stmt -> - {{ .Arg.Bindings }} - - stmt.execute() - } - } -{{end}} - -{{if eq .Cmd ":execrows"}} -{{range .Comments}}//{{.}} -{{end}} - @Throws(SQLException::class) - {{ if $.EmitInterface }}override {{ end -}} - override fun {{.MethodName}}({{.Arg.Args}}): Int { - return conn.prepareStatement({{.ConstantName}}).use { stmt -> - {{ .Arg.Bindings }} - - stmt.execute() - stmt.updateCount - } - } -{{end}} - -{{if eq .Cmd ":execresult"}} -{{range .Comments}}//{{.}} -{{end}} - @Throws(SQLException::class) - {{ if $.EmitInterface }}override {{ end -}} - override fun {{.MethodName}}({{.Arg.Args}}): Long { - return conn.prepareStatement({{.ConstantName}}, Statement.RETURN_GENERATED_KEYS).use { stmt -> - {{ .Arg.Bindings }} - - stmt.execute() - - val results = stmt.generatedKeys - if (!results.next()) { - throw SQLException("no generated key returned") - } - results.getLong(1) - } - } -{{end}} -{{end}} -} -` - -type ktTmplCtx struct { - Q string - Package string - Enums []Enum - DataClasses []Struct - Queries []Query - Settings *plugin.Settings - SqlcVersion string - - // TODO: Race conditions - SourceName string - - EmitJSONTags bool - EmitPreparedQueries bool - EmitInterface bool -} - -func Offset(v int) int { - return v + 1 -} - -func ktFormat(s string) string { - // TODO: do more than just skip multiple blank lines, like maybe run ktlint to format - skipNextSpace := false - var lines []string - for _, l := range strings.Split(s, "\n") { - isSpace := len(strings.TrimSpace(l)) == 0 - if !isSpace || !skipNextSpace { - lines = append(lines, l) - } - skipNextSpace = isSpace - } - o := strings.Join(lines, "\n") - o += "\n" - return o -} - -func Generate(ctx context.Context, 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: req.Settings, - Enums: enums, - DataClasses: structs, - Queries: queries, - } - - funcMap := template.FuncMap{ - "lowerTitle": sdk.LowerTitle, - "comment": sdk.DoubleSlashComment, - "imports": i.Imports, - "offset": Offset, - } - - modelsFile := template.Must(template.New("table").Funcs(funcMap).Parse(ktModelsTmpl)) - sqlFile := template.Must(template.New("table").Funcs(funcMap).Parse(ktSqlTmpl)) - ifaceFile := template.Must(template.New("table").Funcs(funcMap).Parse(ktIfaceTmpl)) - - tctx := ktTmplCtx{ - Settings: req.Settings, - Q: `"""`, - Package: req.Settings.Kotlin.Package, - Queries: queries, - Enums: enums, - DataClasses: structs, - SqlcVersion: req.SqlcVersion, - } - - output := map[string]string{} - - execute := func(name string, t *template.Template) error { - var b bytes.Buffer - w := bufio.NewWriter(&b) - tctx.SourceName = name - err := t.Execute(w, tctx) - w.Flush() - if err != nil { - return err - } - if !strings.HasSuffix(name, ".kt") { - name += ".kt" - } - output[name] = ktFormat(b.String()) - return nil - } - - if err := execute("Models.kt", modelsFile); err != nil { - return nil, err - } - if err := execute("Queries.kt", ifaceFile); err != nil { - return nil, err - } - if err := execute("QueriesImpl.kt", sqlFile); err != nil { - return nil, err - } - - 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 deleted file mode 100644 index b136af4234..0000000000 --- a/internal/codegen/kotlin/imports.go +++ /dev/null @@ -1,179 +0,0 @@ -package kotlin - -import ( - "sort" - "strings" - - "github.com/kyleconroy/sqlc/internal/plugin" -) - -type importer struct { - Settings *plugin.Settings - DataClasses []Struct - Enums []Enum - Queries []Query -} - -func (i *importer) usesType(typ string) bool { - for _, strct := range i.DataClasses { - for _, f := range strct.Fields { - if f.Type.Name == typ { - return true - } - } - } - return false -} - -func (i *importer) Imports(filename string) [][]string { - switch filename { - case "Models.kt": - return i.modelImports() - case "Querier.kt": - return i.interfaceImports() - default: - return i.queryImports(filename) - } -} - -func (i *importer) interfaceImports() [][]string { - uses := func(name string) bool { - for _, q := range i.Queries { - if !q.Ret.isEmpty() { - if strings.HasPrefix(q.Ret.Type(), name) { - return true - } - } - if !q.Arg.isEmpty() { - for _, f := range q.Arg.Struct.Fields { - if strings.HasPrefix(f.Type.Name, name) { - return true - } - } - } - } - return false - } - - std := stdImports(uses) - stds := make([]string, 0, len(std)) - for s := range std { - stds = append(stds, s) - } - - sort.Strings(stds) - return [][]string{stds} -} - -func (i *importer) modelImports() [][]string { - std := make(map[string]struct{}) - if i.usesType("Instant") { - std["java.time.Instant"] = struct{}{} - std["java.sql.Timestamp"] = struct{}{} - } - if i.usesType("LocalDate") { - std["java.time.LocalDate"] = struct{}{} - } - if i.usesType("LocalTime") { - std["java.time.LocalTime"] = struct{}{} - } - if i.usesType("LocalDateTime") { - std["java.time.LocalDateTime"] = struct{}{} - } - if i.usesType("OffsetDateTime") { - std["java.time.OffsetDateTime"] = struct{}{} - } - if i.usesType("UUID") { - std["java.util.UUID"] = struct{}{} - } - - stds := make([]string, 0, len(std)) - for s := range std { - stds = append(stds, s) - } - - sort.Strings(stds) - return [][]string{stds} -} - -func stdImports(uses func(name string) bool) map[string]struct{} { - std := map[string]struct{}{ - "java.sql.SQLException": {}, - "java.sql.Statement": {}, - } - if uses("Instant") { - std["java.time.Instant"] = struct{}{} - std["java.sql.Timestamp"] = struct{}{} - } - if uses("LocalDate") { - std["java.time.LocalDate"] = struct{}{} - } - if uses("LocalTime") { - std["java.time.LocalTime"] = struct{}{} - } - if uses("LocalDateTime") { - std["java.time.LocalDateTime"] = struct{}{} - } - if uses("OffsetDateTime") { - std["java.time.OffsetDateTime"] = struct{}{} - } - if uses("UUID") { - std["java.util.UUID"] = struct{}{} - } - - return std -} - -func (i *importer) queryImports(filename string) [][]string { - uses := func(name string) bool { - for _, q := range i.Queries { - if !q.Ret.isEmpty() { - if q.Ret.Struct != nil { - for _, f := range q.Ret.Struct.Fields { - if f.Type.Name == name { - return true - } - } - } - if q.Ret.Type() == name { - return true - } - } - if !q.Arg.isEmpty() { - for _, f := range q.Arg.Struct.Fields { - if f.Type.Name == name { - return true - } - } - } - } - return false - } - - hasEnum := func() bool { - for _, q := range i.Queries { - if !q.Arg.isEmpty() { - for _, f := range q.Arg.Struct.Fields { - if f.Type.IsEnum { - return true - } - } - } - } - return false - } - - std := stdImports(uses) - std["java.sql.Connection"] = struct{}{} - if hasEnum() && i.Settings.Engine == "postgresql" { - std["java.sql.Types"] = struct{}{} - } - - stds := make([]string, 0, len(std)) - for s := range std { - stds = append(stds, s) - } - - sort.Strings(stds) - return [][]string{stds} -} diff --git a/internal/codegen/kotlin/mysql_type.go b/internal/codegen/kotlin/mysql_type.go deleted file mode 100644 index 1bc50df177..0000000000 --- a/internal/codegen/kotlin/mysql_type.go +++ /dev/null @@ -1,70 +0,0 @@ -package kotlin - -import ( - "log" - - "github.com/kyleconroy/sqlc/internal/codegen/sdk" - "github.com/kyleconroy/sqlc/internal/debug" - "github.com/kyleconroy/sqlc/internal/plugin" -) - -func mysqlType(req *plugin.CodeGenRequest, col *plugin.Column) (string, bool) { - columnType := sdk.DataType(col.Type) - - switch columnType { - - case "varchar", "text", "char", "tinytext", "mediumtext", "longtext": - return "String", false - - case "int", "integer", "smallint", "mediumint", "year": - return "Int", false - - case "bigint": - return "Long", false - - case "blob", "binary", "varbinary", "tinyblob", "mediumblob", "longblob": - return "String", false - - case "double", "double precision", "real": - return "Double", false - - case "decimal", "dec", "fixed": - return "String", false - - case "enum": - // TODO: Proper Enum support - return "String", false - - case "date", "datetime", "time": - return "LocalDateTime", false - - case "timestamp": - return "Instant", false - - case "boolean", "bool", "tinyint": - return "Boolean", false - - case "json": - return "String", false - - case "any": - return "Any", false - - default: - 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 - } - } - } - if debug.Active { - log.Printf("Unknown MySQL type: %s\n", columnType) - } - return "Any", false - - } -} diff --git a/internal/codegen/kotlin/postgresql_type.go b/internal/codegen/kotlin/postgresql_type.go deleted file mode 100644 index 55111b6b6f..0000000000 --- a/internal/codegen/kotlin/postgresql_type.go +++ /dev/null @@ -1,102 +0,0 @@ -package kotlin - -import ( - "log" - - "github.com/kyleconroy/sqlc/internal/codegen/sdk" - "github.com/kyleconroy/sqlc/internal/plugin" -) - -func postgresType(req *plugin.CodeGenRequest, col *plugin.Column) (string, bool) { - columnType := sdk.DataType(col.Type) - - switch columnType { - case "serial", "pg_catalog.serial4": - return "Int", false - - case "bigserial", "pg_catalog.serial8": - return "Long", false - - case "smallserial", "pg_catalog.serial2": - return "Short", false - - case "integer", "int", "int4", "pg_catalog.int4": - return "Int", false - - case "bigint", "pg_catalog.int8": - return "Long", false - - case "smallint", "pg_catalog.int2": - return "Short", false - - case "float", "double precision", "pg_catalog.float8": - return "Double", false - - case "real", "pg_catalog.float4": - return "Float", false - - case "pg_catalog.numeric": - return "java.math.BigDecimal", false - - case "bool", "pg_catalog.bool": - return "Boolean", false - - case "jsonb": - // TODO: support json and byte types - return "String", false - - case "bytea", "blob", "pg_catalog.bytea": - return "String", false - - case "date": - // Date and time mappings from https://jdbc.postgresql.org/documentation/head/java8-date-time.html - return "LocalDate", false - - case "pg_catalog.time", "pg_catalog.timetz": - return "LocalTime", false - - case "pg_catalog.timestamp": - return "LocalDateTime", false - - case "pg_catalog.timestamptz", "timestamptz": - // TODO - return "OffsetDateTime", false - - case "text", "pg_catalog.varchar", "pg_catalog.bpchar", "string": - return "String", false - - case "uuid": - return "UUID", false - - case "inet": - // TODO - return "net.IP", false - - case "void": - // TODO - // A void value always returns NULL. Since there is no built-in NULL - // value into the SQL package, we'll use sql.NullBool - return "sql.NullBool", false - - case "any": - // TODO - return "Any", false - - default: - for _, schema := range req.Catalog.Schemas { - if schema.Name == "pg_catalog" || schema.Name == "information_schema" { - continue - } - 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 - } - } - } - log.Printf("unknown PostgreSQL type: %s\n", columnType) - return "Any", false - } -} diff --git a/internal/config/config.go b/internal/config/config.go index 7335bb0b2c..dde2823f3a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -79,8 +79,7 @@ type Plugin struct { } type Gen struct { - Go *GenGo `json:"go,omitempty" yaml:"go"` - Kotlin *GenKotlin `json:"kotlin,omitempty" yaml:"kotlin"` + Go *GenGo `json:"go,omitempty" yaml:"go"` } type GenGo struct { @@ -88,10 +87,6 @@ type GenGo struct { Rename map[string]string `json:"rename,omitempty" yaml:"rename"` } -type GenKotlin struct { - Rename map[string]string `json:"rename,omitempty" yaml:"rename"` -} - type SQL struct { Engine Engine `json:"engine,omitempty" yaml:"engine"` Schema Paths `json:"schema" yaml:"schema"` @@ -110,7 +105,6 @@ type Codegen struct { type SQLGen struct { Go *SQLGo `json:"go,omitempty" yaml:"go"` - Kotlin *SQLKotlin `json:"kotlin,omitempty" yaml:"kotlin"` Python *SQLPython `json:"python,omitempty" yaml:"python"` JSON *SQLJSON `json:"json,omitempty" yaml:"json"` } @@ -141,13 +135,6 @@ type SQLGo struct { InflectionExcludeTableNames []string `json:"inflection_exclude_table_names,omitempty" yaml:"inflection_exclude_table_names"` } -type SQLKotlin struct { - EmitExactTableNames bool `json:"emit_exact_table_names,omitempty" yaml:"emit_exact_table_names"` - Package string `json:"package" yaml:"package"` - Out string `json:"out" yaml:"out"` - InflectionExcludeTableNames []string `json:"inflection_exclude_table_names,omitempty" yaml:"inflection_exclude_table_names"` -} - type SQLPython struct { EmitExactTableNames bool `json:"emit_exact_table_names" yaml:"emit_exact_table_names"` EmitSyncQuerier bool `json:"emit_sync_querier" yaml:"emit_sync_querier"` @@ -226,7 +213,6 @@ type CombinedSettings struct { Global Config Package SQL Go SQLGo - Kotlin SQLKotlin Python SQLPython JSON SQLJSON Rename map[string]string @@ -245,16 +231,10 @@ func Combine(conf Config, pkg SQL) CombinedSettings { cs.Rename = conf.Gen.Go.Rename cs.Overrides = append(cs.Overrides, conf.Gen.Go.Overrides...) } - if conf.Gen.Kotlin != nil { - cs.Rename = conf.Gen.Kotlin.Rename - } if pkg.Gen.Go != nil { cs.Go = *pkg.Gen.Go cs.Overrides = append(cs.Overrides, pkg.Gen.Go.Overrides...) } - if pkg.Gen.Kotlin != nil { - cs.Kotlin = *pkg.Gen.Kotlin - } if pkg.Gen.Python != nil { cs.Python = *pkg.Gen.Python cs.Overrides = append(cs.Overrides, pkg.Gen.Python.Overrides...) diff --git a/internal/config/v_two.go b/internal/config/v_two.go index 1410deaa21..29546992d3 100644 --- a/internal/config/v_two.go +++ b/internal/config/v_two.go @@ -39,7 +39,6 @@ func v2ParseConfig(rd io.Reader) (Config, error) { builtins := map[string]struct{}{ "go": {}, "json": {}, - "kotlin": {}, "python": {}, } plugins := map[string]struct{}{} @@ -83,19 +82,6 @@ func v2ParseConfig(rd io.Reader) (Config, error) { } } } - if conf.SQL[j].Gen.Kotlin != nil { - fmt.Fprintf(os.Stderr, "WARNING: Built-in Kotlin support is deprecated.\n") - fmt.Fprintf(os.Stderr, " It will be removed in the next version (1.17.0).\n") - fmt.Fprintf(os.Stderr, " You will need to migrate to the sqlc-gen-kotlin plugin. See the step-by-step guide here:\n") - fmt.Fprintf(os.Stderr, " https://docs.sqlc.dev/en/latest/guides/migrating-to-sqlc-gen-kotlin.html\n") - - if conf.SQL[j].Gen.Kotlin.Out == "" { - return conf, ErrNoOutPath - } - if conf.SQL[j].Gen.Kotlin.Package == "" { - return conf, ErrNoPackageName - } - } if conf.SQL[j].Gen.Python != nil { fmt.Fprintf(os.Stderr, "WARNING: Built-in Python support is deprecated.\n") fmt.Fprintf(os.Stderr, " It will be removed in the next version (1.17.0).\n") diff --git a/internal/endtoend/testdata/codegen_json/gen/codegen.json b/internal/endtoend/testdata/codegen_json/gen/codegen.json index ed86efad70..91c79e0924 100644 --- a/internal/endtoend/testdata/codegen_json/gen/codegen.json +++ b/internal/endtoend/testdata/codegen_json/gen/codegen.json @@ -24,12 +24,6 @@ "emit_pydantic_models": false, "inflection_exclude_table_names": [] }, - "kotlin": { - "emit_exact_table_names": false, - "package": "", - "out": "", - "inflection_exclude_table_names": [] - }, "go": { "emit_interface": false, "emit_json_tags": false, diff --git a/internal/endtoend/testdata/deprecated_kotlin/.gitignore b/internal/endtoend/testdata/deprecated_kotlin/.gitignore deleted file mode 100644 index fbb16c8de7..0000000000 --- a/internal/endtoend/testdata/deprecated_kotlin/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/.gradle/ -/.idea/ -/build/ -/out/ diff --git a/internal/endtoend/testdata/deprecated_kotlin/sqlc.json b/internal/endtoend/testdata/deprecated_kotlin/sqlc.json deleted file mode 100644 index cbf223408c..0000000000 --- a/internal/endtoend/testdata/deprecated_kotlin/sqlc.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": "2", - "sql": [ - { - "schema": "src/main/resources/authors/postgresql/schema.sql", - "queries": "src/main/resources/authors/postgresql/query.sql", - "engine": "postgresql", - "gen": { - "kotlin": { - "out": "src/main/kotlin/com/example/authors/postgresql", - "package": "com.example.authors.postgresql" - } - } - } - ] -} diff --git a/internal/endtoend/testdata/deprecated_kotlin/src/main/kotlin/com/example/authors/postgresql/Models.kt b/internal/endtoend/testdata/deprecated_kotlin/src/main/kotlin/com/example/authors/postgresql/Models.kt deleted file mode 100644 index 74964c09ac..0000000000 --- a/internal/endtoend/testdata/deprecated_kotlin/src/main/kotlin/com/example/authors/postgresql/Models.kt +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc v1.16.0 - -package com.example.authors.postgresql - -data class Author ( - val id: Long, - val name: String, - val bio: String? -) - diff --git a/internal/endtoend/testdata/deprecated_kotlin/src/main/kotlin/com/example/authors/postgresql/Queries.kt b/internal/endtoend/testdata/deprecated_kotlin/src/main/kotlin/com/example/authors/postgresql/Queries.kt deleted file mode 100644 index 25009036c7..0000000000 --- a/internal/endtoend/testdata/deprecated_kotlin/src/main/kotlin/com/example/authors/postgresql/Queries.kt +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc v1.16.0 - -package com.example.authors.postgresql - -import java.sql.Connection -import java.sql.SQLException -import java.sql.Statement - -interface Queries { - @Throws(SQLException::class) - fun createAuthor(name: String, bio: String?): Author? - - @Throws(SQLException::class) - fun deleteAuthor(id: Long) - - @Throws(SQLException::class) - fun getAuthor(id: Long): Author? - - @Throws(SQLException::class) - fun listAuthors(): List - -} - diff --git a/internal/endtoend/testdata/deprecated_kotlin/src/main/kotlin/com/example/authors/postgresql/QueriesImpl.kt b/internal/endtoend/testdata/deprecated_kotlin/src/main/kotlin/com/example/authors/postgresql/QueriesImpl.kt deleted file mode 100644 index 7115502afa..0000000000 --- a/internal/endtoend/testdata/deprecated_kotlin/src/main/kotlin/com/example/authors/postgresql/QueriesImpl.kt +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by sqlc. DO NOT EDIT. -// versions: -// sqlc v1.16.0 - -package com.example.authors.postgresql - -import java.sql.Connection -import java.sql.SQLException -import java.sql.Statement - -const val createAuthor = """-- name: createAuthor :one -INSERT INTO authors ( - name, bio -) VALUES ( - ?, ? -) -RETURNING id, name, bio -""" - -const val deleteAuthor = """-- name: deleteAuthor :exec -DELETE FROM authors -WHERE id = ? -""" - -const val getAuthor = """-- name: getAuthor :one -SELECT id, name, bio FROM authors -WHERE id = ? LIMIT 1 -""" - -const val listAuthors = """-- name: listAuthors :many -SELECT id, name, bio FROM authors -ORDER BY name -""" - -class QueriesImpl(private val conn: Connection) : Queries { - - @Throws(SQLException::class) - override fun createAuthor(name: String, bio: String?): Author? { - return conn.prepareStatement(createAuthor).use { stmt -> - stmt.setString(1, name) - stmt.setString(2, bio) - - val results = stmt.executeQuery() - if (!results.next()) { - return null - } - val ret = Author( - results.getLong(1), - results.getString(2), - results.getString(3) - ) - if (results.next()) { - throw SQLException("expected one row in result set, but got many") - } - ret - } - } - - @Throws(SQLException::class) - override fun deleteAuthor(id: Long) { - conn.prepareStatement(deleteAuthor).use { stmt -> - stmt.setLong(1, id) - - stmt.execute() - } - } - - @Throws(SQLException::class) - override fun getAuthor(id: Long): Author? { - return conn.prepareStatement(getAuthor).use { stmt -> - stmt.setLong(1, id) - - val results = stmt.executeQuery() - if (!results.next()) { - return null - } - val ret = Author( - results.getLong(1), - results.getString(2), - results.getString(3) - ) - if (results.next()) { - throw SQLException("expected one row in result set, but got many") - } - ret - } - } - - @Throws(SQLException::class) - override fun listAuthors(): List { - return conn.prepareStatement(listAuthors).use { stmt -> - - val results = stmt.executeQuery() - val ret = mutableListOf() - while (results.next()) { - ret.add(Author( - results.getLong(1), - results.getString(2), - results.getString(3) - )) - } - ret - } - } - -} - diff --git a/internal/endtoend/testdata/deprecated_kotlin/src/main/resources/authors/postgresql/query.sql b/internal/endtoend/testdata/deprecated_kotlin/src/main/resources/authors/postgresql/query.sql deleted file mode 100644 index 75e38b2caf..0000000000 --- a/internal/endtoend/testdata/deprecated_kotlin/src/main/resources/authors/postgresql/query.sql +++ /dev/null @@ -1,19 +0,0 @@ --- name: GetAuthor :one -SELECT * FROM authors -WHERE id = $1 LIMIT 1; - --- name: ListAuthors :many -SELECT * FROM authors -ORDER BY name; - --- name: CreateAuthor :one -INSERT INTO authors ( - name, bio -) VALUES ( - $1, $2 -) -RETURNING *; - --- name: DeleteAuthor :exec -DELETE FROM authors -WHERE id = $1; diff --git a/internal/endtoend/testdata/deprecated_kotlin/src/main/resources/authors/postgresql/schema.sql b/internal/endtoend/testdata/deprecated_kotlin/src/main/resources/authors/postgresql/schema.sql deleted file mode 100644 index b4fad78497..0000000000 --- a/internal/endtoend/testdata/deprecated_kotlin/src/main/resources/authors/postgresql/schema.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLE authors ( - id BIGSERIAL PRIMARY KEY, - name text NOT NULL, - bio text -); diff --git a/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json b/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json index 4c06afbc48..d22bdff03d 100644 --- a/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json +++ b/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json @@ -24,12 +24,6 @@ "emit_pydantic_models": false, "inflection_exclude_table_names": [] }, - "kotlin": { - "emit_exact_table_names": false, - "package": "", - "out": "", - "inflection_exclude_table_names": [] - }, "go": { "emit_interface": false, "emit_json_tags": false, diff --git a/internal/plugin/codegen.pb.go b/internal/plugin/codegen.pb.go index 564024ef35..74d215922c 100644 --- a/internal/plugin/codegen.pb.go +++ b/internal/plugin/codegen.pb.go @@ -330,7 +330,6 @@ type Settings struct { Codegen *Codegen `protobuf:"bytes,12,opt,name=codegen,proto3" json:"codegen,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"` Go *GoCode `protobuf:"bytes,10,opt,name=go,proto3" json:"go,omitempty"` Json *JSONCode `protobuf:"bytes,11,opt,name=json,proto3" json:"json,omitempty"` } @@ -423,13 +422,6 @@ func (x *Settings) GetPython() *PythonCode { return nil } -func (x *Settings) GetKotlin() *KotlinCode { - if x != nil { - return x.Kotlin - } - return nil -} - func (x *Settings) GetGo() *GoCode { if x != nil { return x.Go @@ -610,77 +602,6 @@ func (x *PythonCode) GetInflectionExcludeTableNames() []string { return nil } -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"` - InflectionExcludeTableNames []string `protobuf:"bytes,4,rep,name=inflection_exclude_table_names,json=inflectionExcludeTableNames,proto3" json:"inflection_exclude_table_names,omitempty"` -} - -func (x *KotlinCode) Reset() { - *x = KotlinCode{} - if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[7] - 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[7] - 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{7} -} - -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 "" -} - -func (x *KotlinCode) GetInflectionExcludeTableNames() []string { - if x != nil { - return x.InflectionExcludeTableNames - } - return nil -} - type GoCode struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -712,7 +633,7 @@ type GoCode struct { func (x *GoCode) Reset() { *x = GoCode{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[8] + mi := &file_plugin_codegen_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -725,7 +646,7 @@ func (x *GoCode) String() string { func (*GoCode) ProtoMessage() {} func (x *GoCode) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[8] + mi := &file_plugin_codegen_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -738,7 +659,7 @@ func (x *GoCode) ProtoReflect() protoreflect.Message { // Deprecated: Use GoCode.ProtoReflect.Descriptor instead. func (*GoCode) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{8} + return file_plugin_codegen_proto_rawDescGZIP(), []int{7} } func (x *GoCode) GetEmitInterface() bool { @@ -901,7 +822,7 @@ type JSONCode struct { func (x *JSONCode) Reset() { *x = JSONCode{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[9] + mi := &file_plugin_codegen_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -914,7 +835,7 @@ func (x *JSONCode) String() string { func (*JSONCode) ProtoMessage() {} func (x *JSONCode) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[9] + mi := &file_plugin_codegen_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -927,7 +848,7 @@ func (x *JSONCode) ProtoReflect() protoreflect.Message { // Deprecated: Use JSONCode.ProtoReflect.Descriptor instead. func (*JSONCode) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{9} + return file_plugin_codegen_proto_rawDescGZIP(), []int{8} } func (x *JSONCode) GetOut() string { @@ -965,7 +886,7 @@ type Catalog struct { func (x *Catalog) Reset() { *x = Catalog{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[10] + mi := &file_plugin_codegen_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -978,7 +899,7 @@ func (x *Catalog) String() string { func (*Catalog) ProtoMessage() {} func (x *Catalog) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[10] + mi := &file_plugin_codegen_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -991,7 +912,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{10} + return file_plugin_codegen_proto_rawDescGZIP(), []int{9} } func (x *Catalog) GetComment() string { @@ -1037,7 +958,7 @@ type Schema struct { func (x *Schema) Reset() { *x = Schema{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[11] + mi := &file_plugin_codegen_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1050,7 +971,7 @@ func (x *Schema) String() string { func (*Schema) ProtoMessage() {} func (x *Schema) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[11] + mi := &file_plugin_codegen_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1063,7 +984,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{11} + return file_plugin_codegen_proto_rawDescGZIP(), []int{10} } func (x *Schema) GetComment() string { @@ -1113,7 +1034,7 @@ type CompositeType struct { func (x *CompositeType) Reset() { *x = CompositeType{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[12] + mi := &file_plugin_codegen_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1126,7 +1047,7 @@ func (x *CompositeType) String() string { func (*CompositeType) ProtoMessage() {} func (x *CompositeType) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[12] + mi := &file_plugin_codegen_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1139,7 +1060,7 @@ func (x *CompositeType) ProtoReflect() protoreflect.Message { // Deprecated: Use CompositeType.ProtoReflect.Descriptor instead. func (*CompositeType) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{12} + return file_plugin_codegen_proto_rawDescGZIP(), []int{11} } func (x *CompositeType) GetName() string { @@ -1169,7 +1090,7 @@ type Enum struct { func (x *Enum) Reset() { *x = Enum{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[13] + mi := &file_plugin_codegen_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1182,7 +1103,7 @@ func (x *Enum) String() string { func (*Enum) ProtoMessage() {} func (x *Enum) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[13] + mi := &file_plugin_codegen_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1195,7 +1116,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{13} + return file_plugin_codegen_proto_rawDescGZIP(), []int{12} } func (x *Enum) GetName() string { @@ -1232,7 +1153,7 @@ type Table struct { func (x *Table) Reset() { *x = Table{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[14] + mi := &file_plugin_codegen_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1245,7 +1166,7 @@ func (x *Table) String() string { func (*Table) ProtoMessage() {} func (x *Table) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[14] + mi := &file_plugin_codegen_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1258,7 +1179,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{14} + return file_plugin_codegen_proto_rawDescGZIP(), []int{13} } func (x *Table) GetRel() *Identifier { @@ -1295,7 +1216,7 @@ type Identifier struct { func (x *Identifier) Reset() { *x = Identifier{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[15] + mi := &file_plugin_codegen_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1308,7 +1229,7 @@ func (x *Identifier) String() string { func (*Identifier) ProtoMessage() {} func (x *Identifier) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[15] + mi := &file_plugin_codegen_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1321,7 +1242,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{15} + return file_plugin_codegen_proto_rawDescGZIP(), []int{14} } func (x *Identifier) GetCatalog() string { @@ -1367,7 +1288,7 @@ type Column struct { func (x *Column) Reset() { *x = Column{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[16] + mi := &file_plugin_codegen_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1380,7 +1301,7 @@ func (x *Column) String() string { func (*Column) ProtoMessage() {} func (x *Column) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[16] + mi := &file_plugin_codegen_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1393,7 +1314,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{16} + return file_plugin_codegen_proto_rawDescGZIP(), []int{15} } func (x *Column) GetName() string { @@ -1491,7 +1412,7 @@ type Query struct { func (x *Query) Reset() { *x = Query{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[17] + mi := &file_plugin_codegen_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1504,7 +1425,7 @@ func (x *Query) String() string { func (*Query) ProtoMessage() {} func (x *Query) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[17] + mi := &file_plugin_codegen_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1517,7 +1438,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{17} + return file_plugin_codegen_proto_rawDescGZIP(), []int{16} } func (x *Query) GetText() string { @@ -1588,7 +1509,7 @@ type Parameter struct { func (x *Parameter) Reset() { *x = Parameter{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[18] + mi := &file_plugin_codegen_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1601,7 +1522,7 @@ func (x *Parameter) String() string { func (*Parameter) ProtoMessage() {} func (x *Parameter) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[18] + mi := &file_plugin_codegen_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1614,7 +1535,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{18} + return file_plugin_codegen_proto_rawDescGZIP(), []int{17} } func (x *Parameter) GetNumber() int32 { @@ -1646,7 +1567,7 @@ type CodeGenRequest struct { func (x *CodeGenRequest) Reset() { *x = CodeGenRequest{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[19] + mi := &file_plugin_codegen_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1659,7 +1580,7 @@ func (x *CodeGenRequest) String() string { func (*CodeGenRequest) ProtoMessage() {} func (x *CodeGenRequest) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[19] + mi := &file_plugin_codegen_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1672,7 +1593,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{19} + return file_plugin_codegen_proto_rawDescGZIP(), []int{18} } func (x *CodeGenRequest) GetSettings() *Settings { @@ -1721,7 +1642,7 @@ type CodeGenResponse struct { func (x *CodeGenResponse) Reset() { *x = CodeGenResponse{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[20] + mi := &file_plugin_codegen_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1734,7 +1655,7 @@ func (x *CodeGenResponse) String() string { func (*CodeGenResponse) ProtoMessage() {} func (x *CodeGenResponse) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[20] + mi := &file_plugin_codegen_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1747,7 +1668,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{20} + return file_plugin_codegen_proto_rawDescGZIP(), []int{19} } func (x *CodeGenResponse) GetFiles() []*File { @@ -1804,7 +1725,7 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 0x63, 0x74, 0x54, 0x61, 0x67, 0x73, 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, 0xd8, 0x03, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x74, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb2, 0x03, 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, 0x09, 0x52, 0x06, @@ -1823,234 +1744,221 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 0x52, 0x07, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 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, 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, 0x12, 0x1e, 0x0a, 0x02, 0x67, 0x6f, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x47, 0x6f, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x02, 0x67, - 0x6f, 0x12, 0x24, 0x0a, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x43, 0x6f, 0x64, - 0x65, 0x52, 0x04, 0x6a, 0x73, 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, 0x4d, 0x0a, 0x07, 0x43, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x12, 0x10, 0x0a, - 0x03, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x22, 0x91, 0x03, 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, 0x12, 0x30, 0x0a, 0x14, 0x65, - 0x6d, 0x69, 0x74, 0x5f, 0x70, 0x79, 0x64, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x5f, 0x6d, 0x6f, 0x64, - 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x65, 0x6d, 0x69, 0x74, 0x50, - 0x79, 0x64, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x12, 0x37, 0x0a, - 0x15, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, - 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x13, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x43, 0x0a, 0x1e, 0x69, 0x6e, 0x66, 0x6c, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1b, - 0x69, 0x6e, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x63, 0x6c, 0x75, 0x64, - 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x42, 0x18, 0x0a, 0x16, 0x5f, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xb2, 0x01, 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, 0x12, 0x43, 0x0a, 0x1e, 0x69, 0x6e, 0x66, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1b, 0x69, - 0x6e, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0xf8, 0x07, 0x0a, 0x06, 0x47, - 0x6f, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, - 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x24, 0x0a, 0x0e, - 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x65, 0x6d, 0x69, 0x74, 0x4a, 0x73, 0x6f, 0x6e, 0x54, 0x61, - 0x67, 0x73, 0x12, 0x20, 0x0a, 0x0c, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x64, 0x62, 0x5f, 0x74, 0x61, - 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x65, 0x6d, 0x69, 0x74, 0x44, 0x62, - 0x54, 0x61, 0x67, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x65, - 0x70, 0x61, 0x72, 0x65, 0x64, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, - 0x64, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 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, 0x05, 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, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x73, 0x6c, 0x69, 0x63, - 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x65, 0x6d, 0x69, 0x74, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x6d, 0x69, - 0x74, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, - 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6d, 0x69, 0x74, 0x45, 0x78, - 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x3d, 0x0a, - 0x1b, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x74, 0x72, - 0x75, 0x63, 0x74, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x18, 0x65, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, 0x74, - 0x72, 0x75, 0x63, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x1b, - 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x75, - 0x63, 0x74, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x18, 0x65, 0x6d, 0x69, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x53, 0x74, 0x72, - 0x75, 0x63, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x12, 0x40, 0x0a, 0x1d, 0x65, - 0x6d, 0x69, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, - 0x5f, 0x64, 0x62, 0x5f, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x19, 0x65, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x57, - 0x69, 0x74, 0x68, 0x44, 0x62, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2f, 0x0a, - 0x14, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x5f, 0x63, 0x61, 0x73, 0x65, 0x5f, - 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6a, 0x73, 0x6f, - 0x6e, 0x54, 0x61, 0x67, 0x73, 0x43, 0x61, 0x73, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x75, 0x74, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x71, - 0x6c, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x73, 0x71, 0x6c, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x2d, 0x0a, 0x13, 0x6f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x64, 0x62, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x44, 0x62, 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x17, 0x6f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6c, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x6f, 0x75, 0x74, - 0x70, 0x75, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x37, 0x0a, 0x18, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x71, 0x75, 0x65, 0x72, - 0x69, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x11, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x15, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x51, 0x75, 0x65, 0x72, 0x69, - 0x65, 0x72, 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x6f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x5f, 0x73, 0x75, 0x66, 0x66, 0x69, - 0x78, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x46, - 0x69, 0x6c, 0x65, 0x73, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x33, 0x0a, 0x16, 0x65, 0x6d, - 0x69, 0x74, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6d, 0x69, 0x74, - 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, - 0x2f, 0x0a, 0x14, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x65, 0x6e, 0x75, 0x6d, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x65, - 0x6d, 0x69, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x02, 0x67, 0x6f, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x47, 0x6f, 0x43, 0x6f, 0x64, + 0x65, 0x52, 0x02, 0x67, 0x6f, 0x12, 0x24, 0x0a, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x4a, 0x53, 0x4f, + 0x4e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6a, 0x73, 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, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x22, 0x4d, 0x0a, 0x07, + 0x43, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x75, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x91, 0x03, 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, 0x12, 0x30, 0x0a, 0x14, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x70, 0x79, + 0x64, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x12, 0x65, 0x6d, 0x69, 0x74, 0x50, 0x79, 0x64, 0x61, 0x6e, 0x74, 0x69, + 0x63, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x12, 0x37, 0x0a, 0x15, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x13, 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x43, 0x0a, 0x1e, 0x69, 0x6e, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x18, 0x15, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1b, 0x69, 0x6e, 0x66, 0x6c, 0x65, 0x63, + 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1b, 0x69, 0x6e, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x50, 0x0a, 0x08, 0x4a, 0x53, 0x4f, 0x4e, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x66, - 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, - 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 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, 0xc1, 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, 0x12, 0x3e, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3d, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 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, 0xd5, 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, 0x22, 0x94, - 0x02, 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, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x42, 0x18, 0x0a, 0x16, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, + 0xf8, 0x07, 0x0a, 0x06, 0x47, 0x6f, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6d, + 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, + 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x74, + 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x65, 0x6d, 0x69, 0x74, 0x4a, + 0x73, 0x6f, 0x6e, 0x54, 0x61, 0x67, 0x73, 0x12, 0x20, 0x0a, 0x0c, 0x65, 0x6d, 0x69, 0x74, 0x5f, + 0x64, 0x62, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x65, + 0x6d, 0x69, 0x74, 0x44, 0x62, 0x54, 0x61, 0x67, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x6d, 0x69, + 0x74, 0x5f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, + 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6d, 0x69, 0x74, 0x50, 0x72, + 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 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, 0x05, 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, 0x65, 0x6d, 0x70, 0x74, 0x79, + 0x5f, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x65, + 0x6d, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x73, 0x12, 0x32, + 0x0a, 0x15, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, + 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, + 0x6d, 0x69, 0x74, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x51, 0x75, 0x65, 0x72, 0x69, + 0x65, 0x73, 0x12, 0x3d, 0x0a, 0x1b, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x5f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x65, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x73, 0x12, 0x3d, 0x0a, 0x1b, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x5f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x65, 0x6d, 0x69, 0x74, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, + 0x12, 0x40, 0x0a, 0x1d, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, + 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x64, 0x62, 0x5f, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x19, 0x65, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x73, 0x57, 0x69, 0x74, 0x68, 0x44, 0x62, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x14, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x5f, + 0x63, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x11, 0x6a, 0x73, 0x6f, 0x6e, 0x54, 0x61, 0x67, 0x73, 0x43, 0x61, 0x73, 0x65, 0x53, 0x74, + 0x79, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x6f, 0x75, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x12, + 0x1f, 0x0a, 0x0b, 0x73, 0x71, 0x6c, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x71, 0x6c, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x12, 0x2d, 0x0a, 0x13, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x64, 0x62, 0x5f, 0x66, 0x69, + 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x44, 0x62, 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x35, 0x0a, 0x17, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, + 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x14, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x46, 0x69, + 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x18, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x72, 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x2e, 0x0a, 0x13, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x5f, + 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, + 0x33, 0x0a, 0x16, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x13, 0x65, 0x6d, 0x69, 0x74, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x61, 0x6c, 0x6c, + 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x14, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x11, 0x65, 0x6d, 0x69, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x75, 0x6d, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x1e, 0x69, 0x6e, 0x66, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x15, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1b, 0x69, + 0x6e, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x50, 0x0a, 0x08, 0x4a, 0x53, + 0x4f, 0x4e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6e, 0x64, 0x65, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6e, 0x64, 0x65, 0x6e, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 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, 0xc1, 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, 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, 0x12, 0x40, 0x0a, 0x11, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x5f, 0x69, 0x6e, - 0x74, 0x6f, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x08, 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, 0x11, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x6f, 0x5f, - 0x74, 0x61, 0x62, 0x6c, 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, 0xde, 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, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x71, 0x6c, 0x63, 0x5f, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, - 0x71, 0x6c, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 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, + 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, 0x12, 0x3e, 0x0a, 0x0f, 0x63, + 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, + 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0e, 0x63, 0x6f, 0x6d, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3d, 0x0a, 0x0d, 0x43, + 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 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, 0xd5, 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, 0x22, 0x94, 0x02, 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, 0x12, 0x40, 0x0a, 0x11, 0x69, 0x6e, 0x73, 0x65, + 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x6f, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x08, 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, 0x11, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x5f, + 0x69, 0x6e, 0x74, 0x6f, 0x5f, 0x74, 0x61, 0x62, 0x6c, 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, 0xde, 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, 0x12, 0x22, 0x0a, 0x0c, + 0x73, 0x71, 0x6c, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x73, 0x71, 0x6c, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x26, 0x0a, 0x0e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 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 ( @@ -2065,7 +1973,7 @@ func file_plugin_codegen_proto_rawDescGZIP() []byte { return file_plugin_codegen_proto_rawDescData } -var file_plugin_codegen_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_plugin_codegen_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_plugin_codegen_proto_goTypes = []interface{}{ (*File)(nil), // 0: plugin.File (*Override)(nil), // 1: plugin.Override @@ -2074,56 +1982,54 @@ var file_plugin_codegen_proto_goTypes = []interface{}{ (*Settings)(nil), // 4: plugin.Settings (*Codegen)(nil), // 5: plugin.Codegen (*PythonCode)(nil), // 6: plugin.PythonCode - (*KotlinCode)(nil), // 7: plugin.KotlinCode - (*GoCode)(nil), // 8: plugin.GoCode - (*JSONCode)(nil), // 9: plugin.JSONCode - (*Catalog)(nil), // 10: plugin.Catalog - (*Schema)(nil), // 11: plugin.Schema - (*CompositeType)(nil), // 12: plugin.CompositeType - (*Enum)(nil), // 13: plugin.Enum - (*Table)(nil), // 14: plugin.Table - (*Identifier)(nil), // 15: plugin.Identifier - (*Column)(nil), // 16: plugin.Column - (*Query)(nil), // 17: plugin.Query - (*Parameter)(nil), // 18: plugin.Parameter - (*CodeGenRequest)(nil), // 19: plugin.CodeGenRequest - (*CodeGenResponse)(nil), // 20: plugin.CodeGenResponse - nil, // 21: plugin.ParsedGoType.StructTagsEntry - nil, // 22: plugin.Settings.RenameEntry + (*GoCode)(nil), // 7: plugin.GoCode + (*JSONCode)(nil), // 8: plugin.JSONCode + (*Catalog)(nil), // 9: plugin.Catalog + (*Schema)(nil), // 10: plugin.Schema + (*CompositeType)(nil), // 11: plugin.CompositeType + (*Enum)(nil), // 12: plugin.Enum + (*Table)(nil), // 13: plugin.Table + (*Identifier)(nil), // 14: plugin.Identifier + (*Column)(nil), // 15: plugin.Column + (*Query)(nil), // 16: plugin.Query + (*Parameter)(nil), // 17: plugin.Parameter + (*CodeGenRequest)(nil), // 18: plugin.CodeGenRequest + (*CodeGenResponse)(nil), // 19: plugin.CodeGenResponse + nil, // 20: plugin.ParsedGoType.StructTagsEntry + nil, // 21: plugin.Settings.RenameEntry } var file_plugin_codegen_proto_depIdxs = []int32{ - 15, // 0: plugin.Override.table:type_name -> plugin.Identifier + 14, // 0: plugin.Override.table:type_name -> plugin.Identifier 2, // 1: plugin.Override.python_type:type_name -> plugin.PythonType 3, // 2: plugin.Override.go_type:type_name -> plugin.ParsedGoType - 21, // 3: plugin.ParsedGoType.struct_tags:type_name -> plugin.ParsedGoType.StructTagsEntry - 22, // 4: plugin.Settings.rename:type_name -> plugin.Settings.RenameEntry + 20, // 3: plugin.ParsedGoType.struct_tags:type_name -> plugin.ParsedGoType.StructTagsEntry + 21, // 4: plugin.Settings.rename:type_name -> plugin.Settings.RenameEntry 1, // 5: plugin.Settings.overrides:type_name -> plugin.Override 5, // 6: plugin.Settings.codegen:type_name -> plugin.Codegen 6, // 7: plugin.Settings.python:type_name -> plugin.PythonCode - 7, // 8: plugin.Settings.kotlin:type_name -> plugin.KotlinCode - 8, // 9: plugin.Settings.go:type_name -> plugin.GoCode - 9, // 10: plugin.Settings.json:type_name -> plugin.JSONCode - 11, // 11: plugin.Catalog.schemas:type_name -> plugin.Schema - 14, // 12: plugin.Schema.tables:type_name -> plugin.Table - 13, // 13: plugin.Schema.enums:type_name -> plugin.Enum - 12, // 14: plugin.Schema.composite_types:type_name -> plugin.CompositeType - 15, // 15: plugin.Table.rel:type_name -> plugin.Identifier - 16, // 16: plugin.Table.columns:type_name -> plugin.Column - 15, // 17: plugin.Column.table:type_name -> plugin.Identifier - 15, // 18: plugin.Column.type:type_name -> plugin.Identifier - 16, // 19: plugin.Query.columns:type_name -> plugin.Column - 18, // 20: plugin.Query.params:type_name -> plugin.Parameter - 15, // 21: plugin.Query.insert_into_table:type_name -> plugin.Identifier - 16, // 22: plugin.Parameter.column:type_name -> plugin.Column - 4, // 23: plugin.CodeGenRequest.settings:type_name -> plugin.Settings - 10, // 24: plugin.CodeGenRequest.catalog:type_name -> plugin.Catalog - 17, // 25: plugin.CodeGenRequest.queries:type_name -> plugin.Query - 0, // 26: plugin.CodeGenResponse.files:type_name -> plugin.File - 27, // [27:27] is the sub-list for method output_type - 27, // [27:27] is the sub-list for method input_type - 27, // [27:27] is the sub-list for extension type_name - 27, // [27:27] is the sub-list for extension extendee - 0, // [0:27] is the sub-list for field type_name + 7, // 8: plugin.Settings.go:type_name -> plugin.GoCode + 8, // 9: plugin.Settings.json:type_name -> plugin.JSONCode + 10, // 10: plugin.Catalog.schemas:type_name -> plugin.Schema + 13, // 11: plugin.Schema.tables:type_name -> plugin.Table + 12, // 12: plugin.Schema.enums:type_name -> plugin.Enum + 11, // 13: plugin.Schema.composite_types:type_name -> plugin.CompositeType + 14, // 14: plugin.Table.rel:type_name -> plugin.Identifier + 15, // 15: plugin.Table.columns:type_name -> plugin.Column + 14, // 16: plugin.Column.table:type_name -> plugin.Identifier + 14, // 17: plugin.Column.type:type_name -> plugin.Identifier + 15, // 18: plugin.Query.columns:type_name -> plugin.Column + 17, // 19: plugin.Query.params:type_name -> plugin.Parameter + 14, // 20: plugin.Query.insert_into_table:type_name -> plugin.Identifier + 15, // 21: plugin.Parameter.column:type_name -> plugin.Column + 4, // 22: plugin.CodeGenRequest.settings:type_name -> plugin.Settings + 9, // 23: plugin.CodeGenRequest.catalog:type_name -> plugin.Catalog + 16, // 24: plugin.CodeGenRequest.queries:type_name -> plugin.Query + 0, // 25: plugin.CodeGenResponse.files:type_name -> plugin.File + 26, // [26:26] is the sub-list for method output_type + 26, // [26:26] is the sub-list for method input_type + 26, // [26:26] is the sub-list for extension type_name + 26, // [26:26] is the sub-list for extension extendee + 0, // [0:26] is the sub-list for field type_name } func init() { file_plugin_codegen_proto_init() } @@ -2217,18 +2123,6 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KotlinCode); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_plugin_codegen_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GoCode); i { case 0: return &v.state @@ -2240,7 +2134,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JSONCode); i { case 0: return &v.state @@ -2252,7 +2146,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Catalog); i { case 0: return &v.state @@ -2264,7 +2158,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Schema); i { case 0: return &v.state @@ -2276,7 +2170,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CompositeType); i { case 0: return &v.state @@ -2288,7 +2182,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Enum); i { case 0: return &v.state @@ -2300,7 +2194,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Table); i { case 0: return &v.state @@ -2312,7 +2206,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Identifier); i { case 0: return &v.state @@ -2324,7 +2218,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Column); i { case 0: return &v.state @@ -2336,7 +2230,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Query); i { case 0: return &v.state @@ -2348,7 +2242,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Parameter); i { case 0: return &v.state @@ -2360,7 +2254,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CodeGenRequest); i { case 0: return &v.state @@ -2372,7 +2266,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CodeGenResponse); i { case 0: return &v.state @@ -2392,7 +2286,7 @@ func file_plugin_codegen_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_plugin_codegen_proto_rawDesc, NumEnums: 0, - NumMessages: 23, + NumMessages: 22, NumExtensions: 0, NumServices: 0, }, diff --git a/internal/plugin/codegen_vtproto.pb.go b/internal/plugin/codegen_vtproto.pb.go index 775e2ea04c..d9ab46cb8a 100644 --- a/internal/plugin/codegen_vtproto.pb.go +++ b/internal/plugin/codegen_vtproto.pb.go @@ -356,16 +356,6 @@ func (m *Settings) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x52 } - if m.Kotlin != nil { - size, err := m.Kotlin.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x4a - } if m.Python != nil { size, err := m.Python.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -597,72 +587,6 @@ func (m *PythonCode) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *KotlinCode) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *KotlinCode) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *KotlinCode) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil - } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) - } - if len(m.InflectionExcludeTableNames) > 0 { - for iNdEx := len(m.InflectionExcludeTableNames) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.InflectionExcludeTableNames[iNdEx]) - copy(dAtA[i:], m.InflectionExcludeTableNames[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.InflectionExcludeTableNames[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Out) > 0 { - i -= len(m.Out) - copy(dAtA[i:], m.Out) - i = encodeVarint(dAtA, i, uint64(len(m.Out))) - i-- - dAtA[i] = 0x1a - } - if len(m.Package) > 0 { - i -= len(m.Package) - copy(dAtA[i:], m.Package) - i = encodeVarint(dAtA, i, uint64(len(m.Package))) - i-- - dAtA[i] = 0x12 - } - if m.EmitExactTableNames { - i-- - if m.EmitExactTableNames { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func (m *GoCode) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -1890,10 +1814,6 @@ func (m *Settings) SizeVT() (n int) { l = m.Python.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.Kotlin != nil { - l = m.Kotlin.SizeVT() - n += 1 + l + sov(uint64(l)) - } if m.Go != nil { l = m.Go.SizeVT() n += 1 + l + sov(uint64(l)) @@ -1977,35 +1897,6 @@ func (m *PythonCode) SizeVT() (n int) { return n } -func (m *KotlinCode) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EmitExactTableNames { - n += 2 - } - l = len(m.Package) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - l = len(m.Out) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - if len(m.InflectionExcludeTableNames) > 0 { - for _, s := range m.InflectionExcludeTableNames { - l = len(s) - n += 1 + l + sov(uint64(l)) - } - } - if m.unknownFields != nil { - n += len(m.unknownFields) - } - return n -} - func (m *GoCode) SizeVT() (n int) { if m == nil { return 0 @@ -3645,42 +3536,6 @@ func (m *Settings) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kotlin", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Kotlin == nil { - m.Kotlin = &KotlinCode{} - } - if err := m.Kotlin.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Go", wireType) @@ -4207,173 +4062,6 @@ func (m *PythonCode) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *KotlinCode) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: KotlinCode: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: KotlinCode: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EmitExactTableNames", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EmitExactTableNames = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Package", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Package = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Out", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Out = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InflectionExcludeTableNames", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InflectionExcludeTableNames = append(m.InflectionExcludeTableNames, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *GoCode) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/protos/plugin/codegen.proto b/protos/plugin/codegen.proto index 65244126ae..4dc784b4b8 100644 --- a/protos/plugin/codegen.proto +++ b/protos/plugin/codegen.proto @@ -49,6 +49,9 @@ message ParsedGoType message Settings { + // Kotlin settings used to be field 9 + reserved 9; + string version = 1 [json_name="version"]; string engine = 2 [json_name="engine"]; repeated string schema = 3 [json_name="schema"]; @@ -59,7 +62,6 @@ message Settings // TODO: Refactor codegen settings PythonCode python = 8; - KotlinCode kotlin = 9; GoCode go = 10; JSONCode json = 11; } @@ -83,14 +85,6 @@ message PythonCode repeated string inflection_exclude_table_names = 8; } -message KotlinCode -{ - bool emit_exact_table_names = 1; - string package = 2; - string out = 3; - repeated string inflection_exclude_table_names = 4; -} - message GoCode { bool emit_interface = 1;