From 109b0b09e2bfce495cb862386eb4a5473a1fef27 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Tue, 8 Nov 2022 21:22:26 -0800 Subject: [PATCH] codegen: Remove built-in Python support --- Makefile | 8 +- internal/cmd/generate.go | 15 - internal/cmd/shim.go | 22 - internal/codegen/python/gen.go | 1147 ------- internal/codegen/python/imports.go | 304 -- internal/codegen/python/postgresql_type.go | 62 - internal/config/config.go | 22 +- internal/config/override.go | 3 - internal/config/v_two.go | 32 +- .../testdata/codegen_json/gen/codegen.json | 9 - .../testdata/deprecated_python/query.sql | 19 - .../testdata/deprecated_python/schema.sql | 5 - .../testdata/deprecated_python/sqlc.json | 18 - .../deprecated_python/src/authors/models.py | 12 - .../deprecated_python/src/authors/query.py | 112 - .../gen/codegen.json | 9 - internal/plugin/codegen.pb.go | 915 ++--- internal/plugin/codegen_vtproto.pb.go | 691 +--- internal/python/ast/ast.pb.go | 3041 ----------------- internal/python/poet/builders.go | 90 - internal/python/poet/poet.go | 213 -- internal/python/printer/printer.go | 494 --- internal/python/printer/printer_test.go | 200 -- protos/plugin/codegen.proto | 29 +- protos/python/ast.proto | 242 -- 25 files changed, 360 insertions(+), 7354 deletions(-) delete mode 100644 internal/codegen/python/gen.go delete mode 100644 internal/codegen/python/imports.go delete mode 100644 internal/codegen/python/postgresql_type.go delete mode 100644 internal/endtoend/testdata/deprecated_python/query.sql delete mode 100644 internal/endtoend/testdata/deprecated_python/schema.sql delete mode 100644 internal/endtoend/testdata/deprecated_python/sqlc.json delete mode 100644 internal/endtoend/testdata/deprecated_python/src/authors/models.py delete mode 100644 internal/endtoend/testdata/deprecated_python/src/authors/query.py delete mode 100644 internal/python/ast/ast.pb.go delete mode 100644 internal/python/poet/builders.go delete mode 100644 internal/python/poet/poet.go delete mode 100644 internal/python/printer/printer.go delete mode 100644 internal/python/printer/printer_test.go delete mode 100644 protos/python/ast.proto diff --git a/Makefile b/Makefile index 0a6db1fafa..9cf78ec699 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ mysqlsh: # libprotoc 3.19.1 # $ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest # $ go install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@latest -proto: internal/plugin/codegen.pb.go internal/python/ast/ast.pb.go +proto: internal/plugin/codegen.pb.go internal/plugin/codegen.pb.go: protos/plugin/codegen.proto protoc -I ./protos \ @@ -54,9 +54,3 @@ internal/plugin/codegen.pb.go: protos/plugin/codegen.proto --go-vtproto_out=. \ --go-vtproto_opt=module=github.com/kyleconroy/sqlc,features=marshal+unmarshal+size \ ./protos/plugin/codegen.proto - -internal/python/ast/ast.pb.go: protos/python/ast.proto - protoc -I ./protos \ - --go_out=. \ - --go_opt=module=github.com/kyleconroy/sqlc \ - ./protos/python/ast.proto diff --git a/internal/cmd/generate.go b/internal/cmd/generate.go index 37c513b6e1..e5a1a07e9a 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/python" "github.com/kyleconroy/sqlc/internal/compiler" "github.com/kyleconroy/sqlc/internal/config" "github.com/kyleconroy/sqlc/internal/config/convert" @@ -141,12 +140,6 @@ func Generate(ctx context.Context, e Env, dir, filename string, stderr io.Writer Gen: config.SQLGen{Go: sql.Gen.Go}, }) } - if sql.Gen.Python != nil { - pairs = append(pairs, outPair{ - SQL: sql, - Gen: config.SQLGen{Python: sql.Gen.Python}, - }) - } if sql.Gen.JSON != nil { pairs = append(pairs, outPair{ SQL: sql, @@ -190,10 +183,6 @@ func Generate(ctx context.Context, e Env, dir, filename string, stderr io.Writer name = combo.Go.Package lang = "golang" - case sql.Gen.Python != nil: - lang = "python" - name = combo.Python.Package - case sql.Plugin != nil: lang = fmt.Sprintf("process:%s", sql.Plugin.Plugin) name = sql.Plugin.Plugin @@ -290,10 +279,6 @@ func codegen(ctx context.Context, combo config.CombinedSettings, sql outPair, re out = combo.Go.Out handler = ext.HandleFunc(golang.Generate) - case sql.Gen.Python != nil: - out = combo.Python.Out - handler = ext.HandleFunc(python.Generate) - case sql.Gen.JSON != nil: out = combo.JSON.Out handler = ext.HandleFunc(json.Generate) diff --git a/internal/cmd/shim.go b/internal/cmd/shim.go index b83a400903..a22accfbd9 100644 --- a/internal/cmd/shim.go +++ b/internal/cmd/shim.go @@ -40,7 +40,6 @@ func pluginOverride(o config.Override) *plugin.Override { Column: o.Column, ColumnName: column, Table: &table, - PythonType: pluginPythonType(o.PythonType), GoType: pluginGoType(o), } } @@ -58,7 +57,6 @@ func pluginSettings(cs config.CombinedSettings) *plugin.Settings { Overrides: over, Rename: cs.Rename, Codegen: pluginCodegen(cs.Codegen), - Python: pluginPythonCode(cs.Python), Go: pluginGoCode(cs.Go), Json: pluginJSONCode(cs.JSON), } @@ -76,19 +74,6 @@ func pluginCodegen(s config.Codegen) *plugin.Codegen { } } -func pluginPythonCode(s config.SQLPython) *plugin.PythonCode { - return &plugin.PythonCode{ - Out: s.Out, - Package: s.Package, - EmitExactTableNames: s.EmitExactTableNames, - EmitSyncQuerier: s.EmitSyncQuerier, - EmitAsyncQuerier: s.EmitAsyncQuerier, - EmitPydanticModels: s.EmitPydanticModels, - QueryParameterLimit: s.QueryParameterLimit, - InflectionExcludeTableNames: s.InflectionExcludeTableNames, - } -} - func pluginGoCode(s config.SQLGo) *plugin.GoCode { return &plugin.GoCode{ EmitInterface: s.EmitInterface, @@ -129,13 +114,6 @@ func pluginGoType(o config.Override) *plugin.ParsedGoType { } } -func pluginPythonType(pt config.PythonType) *plugin.PythonType { - return &plugin.PythonType{ - Module: pt.Module, - Name: pt.Name, - } -} - func pluginJSONCode(s config.SQLJSON) *plugin.JSONCode { return &plugin.JSONCode{ Out: s.Out, diff --git a/internal/codegen/python/gen.go b/internal/codegen/python/gen.go deleted file mode 100644 index 3802279777..0000000000 --- a/internal/codegen/python/gen.go +++ /dev/null @@ -1,1147 +0,0 @@ -package python - -import ( - "context" - "errors" - "fmt" - "log" - "regexp" - "sort" - "strings" - - "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" - pyast "github.com/kyleconroy/sqlc/internal/python/ast" - "github.com/kyleconroy/sqlc/internal/python/poet" - pyprint "github.com/kyleconroy/sqlc/internal/python/printer" -) - -type Constant struct { - Name string - Type string - Value string -} - -type Enum struct { - Name string - Comment string - Constants []Constant -} - -type pyType struct { - InnerType string - IsArray bool - IsNull bool -} - -func (t pyType) Annotation() *pyast.Node { - ann := poet.Name(t.InnerType) - if t.IsArray { - ann = subscriptNode("List", ann) - } - if t.IsNull { - ann = subscriptNode("Optional", ann) - } - return ann -} - -type Field struct { - Name string - Type pyType - Comment string -} - -type Struct struct { - Table plugin.Identifier - Name string - Fields []Field - Comment string -} - -type QueryValue struct { - Emit bool - Name string - Struct *Struct - Typ pyType -} - -func (v QueryValue) Annotation() *pyast.Node { - if v.Typ != (pyType{}) { - return v.Typ.Annotation() - } - if v.Struct != nil { - if v.Emit { - return poet.Name(v.Struct.Name) - } else { - return typeRefNode("models", v.Struct.Name) - } - } - panic("no type for QueryValue: " + v.Name) -} - -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 == (pyType{}) && v.Name == "" && v.Struct == nil -} - -func (v QueryValue) RowNode(rowVar string) *pyast.Node { - if !v.IsStruct() { - return subscriptNode( - rowVar, - constantInt(0), - ) - } - call := &pyast.Call{ - Func: v.Annotation(), - } - for i, f := range v.Struct.Fields { - call.Keywords = append(call.Keywords, &pyast.Keyword{ - Arg: f.Name, - Value: subscriptNode( - rowVar, - constantInt(i), - ), - }) - } - return &pyast.Node{ - Node: &pyast.Node_Call{ - Call: call, - }, - } -} - -// A struct used to generate methods and fields on the Queries struct -type Query struct { - Cmd string - Comments []string - MethodName string - FieldName string - ConstantName string - SQL string - SourceName string - Ret QueryValue - Args []QueryValue -} - -func (q Query) AddArgs(args *pyast.Arguments) { - // A single struct arg does not need to be passed as a keyword argument - if len(q.Args) == 1 && q.Args[0].IsStruct() { - args.Args = append(args.Args, &pyast.Arg{ - Arg: q.Args[0].Name, - Annotation: q.Args[0].Annotation(), - }) - return - } - for _, a := range q.Args { - args.KwOnlyArgs = append(args.KwOnlyArgs, &pyast.Arg{ - Arg: a.Name, - Annotation: a.Annotation(), - }) - } -} - -func (q Query) ArgDictNode() *pyast.Node { - dict := &pyast.Dict{} - i := 1 - for _, a := range q.Args { - if a.isEmpty() { - continue - } - if a.IsStruct() { - for _, f := range a.Struct.Fields { - dict.Keys = append(dict.Keys, poet.Constant(fmt.Sprintf("p%v", i))) - dict.Values = append(dict.Values, typeRefNode(a.Name, f.Name)) - i++ - } - } else { - dict.Keys = append(dict.Keys, poet.Constant(fmt.Sprintf("p%v", i))) - dict.Values = append(dict.Values, poet.Name(a.Name)) - i++ - } - } - if len(dict.Keys) == 0 { - return nil - } - return &pyast.Node{ - Node: &pyast.Node_Dict{ - Dict: dict, - }, - } -} - -func makePyType(req *plugin.CodeGenRequest, col *plugin.Column) pyType { - typ := pyInnerType(req, col) - return pyType{ - InnerType: typ, - IsArray: col.IsArray, - IsNull: !col.NotNull, - } -} - -func pyInnerType(req *plugin.CodeGenRequest, col *plugin.Column) string { - columnType := sdk.DataType(col.Type) - for _, oride := range req.Settings.Overrides { - if !pyTypeIsSet(oride.PythonType) { - continue - } - sameTable := sdk.Matches(oride, col.Table, req.Catalog.DefaultSchema) - if oride.Column != "" && sdk.MatchString(oride.ColumnName, col.Name) && sameTable { - return pyTypeString(oride.PythonType) - } - if oride.DbType != "" && oride.DbType == columnType && oride.Nullable != (col.NotNull || col.IsArray) { - return pyTypeString(oride.PythonType) - } - } - - switch req.Settings.Engine { - case "postgresql": - return postgresType(req, col) - default: - log.Println("unsupported engine type") - return "Any" - } -} - -func modelName(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 -} - -var matchFirstCap = regexp.MustCompile("(.)([A-Z][a-z]+)") -var matchAllCap = regexp.MustCompile("([a-z0-9])([A-Z])") - -func methodName(name string) string { - snake := matchFirstCap.ReplaceAllString(name, "${1}_${2}") - snake = matchAllCap.ReplaceAllString(snake, "${1}_${2}") - return strings.ToLower(snake) -} - -var pyIdentPattern = regexp.MustCompile("[^a-zA-Z0-9_]+") - -func pyEnumValueName(value string) string { - id := strings.Replace(value, "-", "_", -1) - id = strings.Replace(id, ":", "_", -1) - id = strings.Replace(id, "/", "_", -1) - id = pyIdentPattern.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: modelName(enumName, req.Settings), - Comment: enum.Comment, - } - for _, v := range enum.Vals { - e.Constants = append(e.Constants, Constant{ - Name: pyEnumValueName(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 buildModels(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 := tableName - if !req.Settings.Python.EmitExactTableNames { - structName = inflection.Singular(inflection.SingularParams{ - Name: structName, - Exclusions: req.Settings.Python.InflectionExcludeTableNames, - }) - } - s := Struct{ - Table: plugin.Identifier{Schema: schema.Name, Name: table.Rel.Name}, - Name: modelName(structName, req.Settings), - Comment: table.Comment, - } - for _, column := range table.Columns { - typ := makePyType(req, column) // TODO: This used to call compiler.ConvertColumn? - typ.InnerType = strings.TrimPrefix(typ.InnerType, "models.") - s.Fields = append(s.Fields, Field{ - Name: column.Name, - Type: typ, - 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 -} - -func columnName(c *plugin.Column, pos int) string { - if c.Name != "" { - return c.Name - } - return fmt.Sprintf("column_%d", pos+1) -} - -func paramName(p *plugin.Parameter) string { - if p.Column.Name != "" { - return p.Column.Name - } - return fmt.Sprintf("dollar_%d", p.Number) -} - -type pyColumn struct { - id int32 - *plugin.Column -} - -func columnsToStruct(req *plugin.CodeGenRequest, name string, columns []pyColumn) *Struct { - gs := Struct{ - Name: name, - } - seen := map[string]int32{} - suffixes := map[int32]int32{} - for i, c := range columns { - colName := columnName(c.Column, i) - fieldName := colName - // Track suffixes by the ID of the column, so that columns referring to - // the same numbered parameter can be reused. - var suffix int32 - if o, ok := suffixes[c.id]; ok { - suffix = o - } else if v := seen[colName]; v > 0 { - suffix = v + 1 - } - suffixes[c.id] = suffix - if suffix > 0 { - fieldName = fmt.Sprintf("%s_%d", fieldName, suffix) - } - gs.Fields = append(gs.Fields, Field{ - Name: fieldName, - Type: makePyType(req, c.Column), - }) - seen[colName]++ - } - return &gs -} - -var postgresPlaceholderRegexp = regexp.MustCompile(`\B\$(\d+)\b`) - -// Sqlalchemy uses ":name" for placeholders, so "$N" is converted to ":pN" -// This also means ":" has special meaning to sqlalchemy, so it must be escaped. -func sqlalchemySQL(s, engine string) string { - s = strings.ReplaceAll(s, ":", `\\:`) - if engine == "postgresql" { - return postgresPlaceholderRegexp.ReplaceAllString(s, ":p$1") - } - return s -} - -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 Python is not implemented") - } - - methodName := methodName(query.Name) - - gq := Query{ - Cmd: query.Cmd, - Comments: query.Comments, - MethodName: methodName, - FieldName: sdk.LowerTitle(query.Name) + "Stmt", - ConstantName: strings.ToUpper(methodName), - SQL: sqlalchemySQL(query.Text, req.Settings.Engine), - SourceName: query.Filename, - } - - qpl := 4 - if req.Settings.Python.QueryParameterLimit != nil { - qpl = int(*req.Settings.Python.QueryParameterLimit) - } - if len(query.Params) > qpl || qpl == 0 { - var cols []pyColumn - for _, p := range query.Params { - cols = append(cols, pyColumn{ - id: p.Number, - Column: p.Column, - }) - } - gq.Args = []QueryValue{{ - Emit: true, - Name: "arg", - Struct: columnsToStruct(req, query.Name+"Params", cols), - }} - } else { - args := make([]QueryValue, 0, len(query.Params)) - for _, p := range query.Params { - args = append(args, QueryValue{ - Name: paramName(p), - Typ: makePyType(req, p.Column), - }) - } - gq.Args = args - } - - if len(query.Columns) == 1 { - c := query.Columns[0] - gq.Ret = QueryValue{ - Name: columnName(c, 0), - Typ: makePyType(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] - // HACK: models do not have "models." on their types, so trim that so we can find matches - trimmedPyType := makePyType(req, c) - trimmedPyType.InnerType = strings.TrimPrefix(trimmedPyType.InnerType, "models.") - sameName := f.Name == columnName(c, i) - sameType := f.Type == trimmedPyType - 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 []pyColumn - for i, c := range query.Columns { - columns = append(columns, pyColumn{ - id: int32(i), - Column: c, - }) - } - gs = columnsToStruct(req, query.Name+"Row", columns) - emit = true - } - gq.Ret = QueryValue{ - Emit: emit, - Name: "i", - Struct: gs, - } - } - - qs = append(qs, gq) - } - sort.Slice(qs, func(i, j int) bool { return qs[i].MethodName < qs[j].MethodName }) - return qs, nil -} - -func moduleNode(version, source string) *pyast.Module { - mod := &pyast.Module{ - Body: []*pyast.Node{ - poet.Comment( - "Code generated by sqlc. DO NOT EDIT.", - ), - poet.Comment( - "versions:", - ), - poet.Comment( - " sqlc " + version, - ), - }, - } - if source != "" { - mod.Body = append(mod.Body, - poet.Comment( - "source: "+source, - ), - ) - } - return mod -} - -func importNode(name string) *pyast.Node { - return &pyast.Node{ - Node: &pyast.Node_Import{ - Import: &pyast.Import{ - Names: []*pyast.Node{ - { - Node: &pyast.Node_Alias{ - Alias: &pyast.Alias{ - Name: name, - }, - }, - }, - }, - }, - }, - } -} - -func classDefNode(name string, bases ...*pyast.Node) *pyast.Node { - return &pyast.Node{ - Node: &pyast.Node_ClassDef{ - ClassDef: &pyast.ClassDef{ - Name: name, - Bases: bases, - }, - }, - } -} - -func assignNode(target string, value *pyast.Node) *pyast.Node { - return &pyast.Node{ - Node: &pyast.Node_Assign{ - Assign: &pyast.Assign{ - Targets: []*pyast.Node{ - poet.Name(target), - }, - Value: value, - }, - }, - } -} - -func constantInt(value int) *pyast.Node { - return &pyast.Node{ - Node: &pyast.Node_Constant{ - Constant: &pyast.Constant{ - Value: &pyast.Constant_Int{ - Int: int32(value), - }, - }, - }, - } -} - -func subscriptNode(value string, slice *pyast.Node) *pyast.Node { - return &pyast.Node{ - Node: &pyast.Node_Subscript{ - Subscript: &pyast.Subscript{ - Value: &pyast.Name{Id: value}, - Slice: slice, - }, - }, - } -} - -func dataclassNode(name string) *pyast.ClassDef { - return &pyast.ClassDef{ - Name: name, - DecoratorList: []*pyast.Node{ - { - Node: &pyast.Node_Call{ - Call: &pyast.Call{ - Func: poet.Attribute(poet.Name("dataclasses"), "dataclass"), - }, - }, - }, - }, - } -} - -func pydanticNode(name string) *pyast.ClassDef { - return &pyast.ClassDef{ - Name: name, - Bases: []*pyast.Node{ - { - Node: &pyast.Node_Attribute{ - Attribute: &pyast.Attribute{ - Value: &pyast.Node{ - Node: &pyast.Node_Name{ - Name: &pyast.Name{Id: "pydantic"}, - }, - }, - Attr: "BaseModel", - }, - }, - }, - }, - } -} - -func fieldNode(f Field) *pyast.Node { - return &pyast.Node{ - Node: &pyast.Node_AnnAssign{ - AnnAssign: &pyast.AnnAssign{ - Target: &pyast.Name{Id: f.Name}, - Annotation: f.Type.Annotation(), - Comment: f.Comment, - }, - }, - } -} - -func typeRefNode(base string, parts ...string) *pyast.Node { - n := poet.Name(base) - for _, p := range parts { - n = poet.Attribute(n, p) - } - return n -} - -func connMethodNode(method, name string, arg *pyast.Node) *pyast.Node { - args := []*pyast.Node{ - { - Node: &pyast.Node_Call{ - Call: &pyast.Call{ - Func: typeRefNode("sqlalchemy", "text"), - Args: []*pyast.Node{ - poet.Name(name), - }, - }, - }, - }, - } - if arg != nil { - args = append(args, arg) - } - return &pyast.Node{ - Node: &pyast.Node_Call{ - Call: &pyast.Call{ - Func: typeRefNode("self", "_conn", method), - Args: args, - }, - }, - } -} - -func buildImportGroup(specs map[string]importSpec) *pyast.Node { - var body []*pyast.Node - for _, spec := range buildImportBlock2(specs) { - if len(spec.Names) > 0 && spec.Names[0] != "" { - imp := &pyast.ImportFrom{ - Module: spec.Module, - } - for _, name := range spec.Names { - imp.Names = append(imp.Names, poet.Alias(name)) - } - body = append(body, &pyast.Node{ - Node: &pyast.Node_ImportFrom{ - ImportFrom: imp, - }, - }) - } else { - body = append(body, importNode(spec.Module)) - } - } - return &pyast.Node{ - Node: &pyast.Node_ImportGroup{ - ImportGroup: &pyast.ImportGroup{ - Imports: body, - }, - }, - } -} - -func buildModelsTree(ctx *pyTmplCtx, i *importer) *pyast.Node { - mod := moduleNode(ctx.SqlcVersion, "") - std, pkg := i.modelImportSpecs() - mod.Body = append(mod.Body, buildImportGroup(std), buildImportGroup(pkg)) - - for _, e := range ctx.Enums { - def := &pyast.ClassDef{ - Name: e.Name, - Bases: []*pyast.Node{ - poet.Name("str"), - poet.Attribute(poet.Name("enum"), "Enum"), - }, - } - if e.Comment != "" { - def.Body = append(def.Body, &pyast.Node{ - Node: &pyast.Node_Expr{ - Expr: &pyast.Expr{ - Value: poet.Constant(e.Comment), - }, - }, - }) - } - for _, c := range e.Constants { - def.Body = append(def.Body, assignNode(c.Name, poet.Constant(c.Value))) - } - mod.Body = append(mod.Body, &pyast.Node{ - Node: &pyast.Node_ClassDef{ - ClassDef: def, - }, - }) - } - - for _, m := range ctx.Models { - var def *pyast.ClassDef - if ctx.EmitPydanticModels { - def = pydanticNode(m.Name) - } else { - def = dataclassNode(m.Name) - } - if m.Comment != "" { - def.Body = append(def.Body, &pyast.Node{ - Node: &pyast.Node_Expr{ - Expr: &pyast.Expr{ - Value: poet.Constant(m.Comment), - }, - }, - }) - } - for _, f := range m.Fields { - def.Body = append(def.Body, fieldNode(f)) - } - mod.Body = append(mod.Body, &pyast.Node{ - Node: &pyast.Node_ClassDef{ - ClassDef: def, - }, - }) - } - - return &pyast.Node{Node: &pyast.Node_Module{Module: mod}} -} - -func querierClassDef() *pyast.ClassDef { - return &pyast.ClassDef{ - Name: "Querier", - Body: []*pyast.Node{ - { - Node: &pyast.Node_FunctionDef{ - FunctionDef: &pyast.FunctionDef{ - Name: "__init__", - Args: &pyast.Arguments{ - Args: []*pyast.Arg{ - { - Arg: "self", - }, - { - Arg: "conn", - Annotation: typeRefNode("sqlalchemy", "engine", "Connection"), - }, - }, - }, - Body: []*pyast.Node{ - { - Node: &pyast.Node_Assign{ - Assign: &pyast.Assign{ - Targets: []*pyast.Node{ - poet.Attribute(poet.Name("self"), "_conn"), - }, - Value: poet.Name("conn"), - }, - }, - }, - }, - }, - }, - }, - }, - } -} - -func asyncQuerierClassDef() *pyast.ClassDef { - return &pyast.ClassDef{ - Name: "AsyncQuerier", - Body: []*pyast.Node{ - { - Node: &pyast.Node_FunctionDef{ - FunctionDef: &pyast.FunctionDef{ - Name: "__init__", - Args: &pyast.Arguments{ - Args: []*pyast.Arg{ - { - Arg: "self", - }, - { - Arg: "conn", - Annotation: typeRefNode("sqlalchemy", "ext", "asyncio", "AsyncConnection"), - }, - }, - }, - Body: []*pyast.Node{ - { - Node: &pyast.Node_Assign{ - Assign: &pyast.Assign{ - Targets: []*pyast.Node{ - poet.Attribute(poet.Name("self"), "_conn"), - }, - Value: poet.Name("conn"), - }, - }, - }, - }, - }, - }, - }, - }, - } -} - -func buildQueryTree(ctx *pyTmplCtx, i *importer, source string) *pyast.Node { - mod := moduleNode(ctx.SqlcVersion, source) - std, pkg := i.queryImportSpecs(source) - mod.Body = append(mod.Body, buildImportGroup(std), buildImportGroup(pkg)) - mod.Body = append(mod.Body, &pyast.Node{ - Node: &pyast.Node_ImportGroup{ - ImportGroup: &pyast.ImportGroup{ - Imports: []*pyast.Node{ - { - Node: &pyast.Node_ImportFrom{ - ImportFrom: &pyast.ImportFrom{ - Module: i.Settings.Python.Package, - Names: []*pyast.Node{ - poet.Alias("models"), - }, - }, - }, - }, - }, - }, - }, - }) - - for _, q := range ctx.Queries { - if !ctx.OutputQuery(q.SourceName) { - continue - } - queryText := fmt.Sprintf("-- name: %s \\\\%s\n%s\n", q.MethodName, q.Cmd, q.SQL) - mod.Body = append(mod.Body, assignNode(q.ConstantName, poet.Constant(queryText))) - for _, arg := range q.Args { - if arg.EmitStruct() { - var def *pyast.ClassDef - if ctx.EmitPydanticModels { - def = pydanticNode(arg.Struct.Name) - } else { - def = dataclassNode(arg.Struct.Name) - } - for _, f := range arg.Struct.Fields { - def.Body = append(def.Body, fieldNode(f)) - } - mod.Body = append(mod.Body, poet.Node(def)) - } - } - if q.Ret.EmitStruct() { - var def *pyast.ClassDef - if ctx.EmitPydanticModels { - def = pydanticNode(q.Ret.Struct.Name) - } else { - def = dataclassNode(q.Ret.Struct.Name) - } - for _, f := range q.Ret.Struct.Fields { - def.Body = append(def.Body, fieldNode(f)) - } - mod.Body = append(mod.Body, poet.Node(def)) - } - } - - if ctx.EmitSync { - cls := querierClassDef() - for _, q := range ctx.Queries { - if !ctx.OutputQuery(q.SourceName) { - continue - } - f := &pyast.FunctionDef{ - Name: q.MethodName, - Args: &pyast.Arguments{ - Args: []*pyast.Arg{ - { - Arg: "self", - }, - }, - }, - } - - q.AddArgs(f.Args) - exec := connMethodNode("execute", q.ConstantName, q.ArgDictNode()) - - switch q.Cmd { - case ":one": - f.Body = append(f.Body, - assignNode("row", poet.Node( - &pyast.Call{ - Func: poet.Attribute(exec, "first"), - }, - )), - poet.Node( - &pyast.If{ - Test: poet.Node( - &pyast.Compare{ - Left: poet.Name("row"), - Ops: []*pyast.Node{ - poet.Is(), - }, - Comparators: []*pyast.Node{ - poet.Constant(nil), - }, - }, - ), - Body: []*pyast.Node{ - poet.Return( - poet.Constant(nil), - ), - }, - }, - ), - poet.Return(q.Ret.RowNode("row")), - ) - f.Returns = subscriptNode("Optional", q.Ret.Annotation()) - case ":many": - f.Body = append(f.Body, - assignNode("result", exec), - poet.Node( - &pyast.For{ - Target: poet.Name("row"), - Iter: poet.Name("result"), - Body: []*pyast.Node{ - poet.Expr( - poet.Yield( - q.Ret.RowNode("row"), - ), - ), - }, - }, - ), - ) - f.Returns = subscriptNode("Iterator", q.Ret.Annotation()) - case ":exec": - f.Body = append(f.Body, exec) - f.Returns = poet.Constant(nil) - case ":execrows": - f.Body = append(f.Body, - assignNode("result", exec), - poet.Return(poet.Attribute(poet.Name("result"), "rowcount")), - ) - f.Returns = poet.Name("int") - case ":execresult": - f.Body = append(f.Body, - poet.Return(exec), - ) - f.Returns = typeRefNode("sqlalchemy", "engine", "Result") - default: - panic("unknown cmd " + q.Cmd) - } - - cls.Body = append(cls.Body, poet.Node(f)) - } - mod.Body = append(mod.Body, poet.Node(cls)) - } - - if ctx.EmitAsync { - cls := asyncQuerierClassDef() - for _, q := range ctx.Queries { - if !ctx.OutputQuery(q.SourceName) { - continue - } - f := &pyast.AsyncFunctionDef{ - Name: q.MethodName, - Args: &pyast.Arguments{ - Args: []*pyast.Arg{ - { - Arg: "self", - }, - }, - }, - } - - q.AddArgs(f.Args) - exec := connMethodNode("execute", q.ConstantName, q.ArgDictNode()) - - switch q.Cmd { - case ":one": - f.Body = append(f.Body, - assignNode("row", poet.Node( - &pyast.Call{ - Func: poet.Attribute(poet.Await(exec), "first"), - }, - )), - poet.Node( - &pyast.If{ - Test: poet.Node( - &pyast.Compare{ - Left: poet.Name("row"), - Ops: []*pyast.Node{ - poet.Is(), - }, - Comparators: []*pyast.Node{ - poet.Constant(nil), - }, - }, - ), - Body: []*pyast.Node{ - poet.Return( - poet.Constant(nil), - ), - }, - }, - ), - poet.Return(q.Ret.RowNode("row")), - ) - f.Returns = subscriptNode("Optional", q.Ret.Annotation()) - case ":many": - stream := connMethodNode("stream", q.ConstantName, q.ArgDictNode()) - f.Body = append(f.Body, - assignNode("result", poet.Await(stream)), - poet.Node( - &pyast.AsyncFor{ - Target: poet.Name("row"), - Iter: poet.Name("result"), - Body: []*pyast.Node{ - poet.Expr( - poet.Yield( - q.Ret.RowNode("row"), - ), - ), - }, - }, - ), - ) - f.Returns = subscriptNode("AsyncIterator", q.Ret.Annotation()) - case ":exec": - f.Body = append(f.Body, poet.Await(exec)) - f.Returns = poet.Constant(nil) - case ":execrows": - f.Body = append(f.Body, - assignNode("result", poet.Await(exec)), - poet.Return(poet.Attribute(poet.Name("result"), "rowcount")), - ) - f.Returns = poet.Name("int") - case ":execresult": - f.Body = append(f.Body, - poet.Return(poet.Await(exec)), - ) - f.Returns = typeRefNode("sqlalchemy", "engine", "Result") - default: - panic("unknown cmd " + q.Cmd) - } - - cls.Body = append(cls.Body, poet.Node(f)) - } - mod.Body = append(mod.Body, poet.Node(cls)) - } - - return poet.Node(mod) -} - -type pyTmplCtx struct { - Models []Struct - Queries []Query - Enums []Enum - EmitSync bool - EmitAsync bool - SourceName string - SqlcVersion string - EmitPydanticModels bool -} - -func (t *pyTmplCtx) OutputQuery(sourceName string) bool { - return t.SourceName == sourceName -} - -func HashComment(s string) string { - return "# " + strings.ReplaceAll(s, "\n", "\n# ") -} - -func Generate(_ context.Context, req *plugin.CodeGenRequest) (*plugin.CodeGenResponse, error) { - enums := buildEnums(req) - models := buildModels(req) - queries, err := buildQueries(req, models) - if err != nil { - return nil, err - } - - i := &importer{ - Settings: req.Settings, - Models: models, - Queries: queries, - Enums: enums, - } - - tctx := pyTmplCtx{ - Models: models, - Queries: queries, - Enums: enums, - EmitSync: req.Settings.Python.EmitSyncQuerier, - EmitAsync: req.Settings.Python.EmitAsyncQuerier, - SqlcVersion: req.SqlcVersion, - EmitPydanticModels: req.Settings.Python.EmitPydanticModels, - } - - output := map[string]string{} - result := pyprint.Print(buildModelsTree(&tctx, i), pyprint.Options{}) - tctx.SourceName = "models.py" - output["models.py"] = string(result.Python) - - files := map[string]struct{}{} - for _, q := range queries { - files[q.SourceName] = struct{}{} - } - - for source := range files { - tctx.SourceName = source - result := pyprint.Print(buildQueryTree(&tctx, i, source), pyprint.Options{}) - name := source - if !strings.HasSuffix(name, ".py") { - name = strings.TrimSuffix(name, ".sql") - name += ".py" - } - output[name] = string(result.Python) - } - - 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/python/imports.go b/internal/codegen/python/imports.go deleted file mode 100644 index a5bddc155f..0000000000 --- a/internal/codegen/python/imports.go +++ /dev/null @@ -1,304 +0,0 @@ -package python - -import ( - "fmt" - "sort" - "strings" - - "github.com/kyleconroy/sqlc/internal/plugin" -) - -type importSpec struct { - Module string - Name string - Alias string -} - -func pyTypeIsSet(t *plugin.PythonType) bool { - return t.Module != "" || t.Name != "" -} - -func pyTypeString(t *plugin.PythonType) string { - if t.Name != "" && t.Module == "" { - return t.Name - } - return t.Module + "." + t.Name -} - -func (i importSpec) String() string { - if i.Alias != "" { - if i.Name == "" { - return fmt.Sprintf("import %s as %s", i.Module, i.Alias) - } - return fmt.Sprintf("from %s import %s as %s", i.Module, i.Name, i.Alias) - } - if i.Name == "" { - return "import " + i.Module - } - return fmt.Sprintf("from %s import %s", i.Module, i.Name) -} - -type importer struct { - Settings *plugin.Settings - Models []Struct - Queries []Query - Enums []Enum -} - -func structUses(name string, s Struct) bool { - for _, f := range s.Fields { - if name == "typing.List" && f.Type.IsArray { - return true - } - if name == "typing.Optional" && f.Type.IsNull { - return true - } - if f.Type.InnerType == name { - return true - } - } - return false -} - -func queryValueUses(name string, qv QueryValue) bool { - if !qv.isEmpty() { - if name == "typing.List" && qv.Typ.IsArray { - return true - } - if name == "typing.Optional" && qv.Typ.IsNull { - return true - } - if qv.IsStruct() && qv.EmitStruct() { - if structUses(name, *qv.Struct) { - return true - } - } else { - if qv.Typ.InnerType == name { - return true - } - } - } - return false -} - -func (i *importer) Imports(fileName string) []string { - if fileName == "models.py" { - return i.modelImports() - } - return i.queryImports(fileName) -} - -func (i *importer) modelImportSpecs() (map[string]importSpec, map[string]importSpec) { - modelUses := func(name string) bool { - for _, model := range i.Models { - if structUses(name, model) { - return true - } - } - return false - } - - std := stdImports(modelUses) - if i.Settings.Python.EmitPydanticModels { - std["pydantic"] = importSpec{Module: "pydantic"} - } else { - std["dataclasses"] = importSpec{Module: "dataclasses"} - } - if len(i.Enums) > 0 { - std["enum"] = importSpec{Module: "enum"} - } - - pkg := make(map[string]importSpec) - - for _, o := range i.Settings.Overrides { - if pyTypeIsSet(o.PythonType) && o.PythonType.Module != "" { - if modelUses(pyTypeString(o.PythonType)) { - pkg[o.PythonType.Module] = importSpec{Module: o.PythonType.Module} - } - } - } - return std, pkg -} - -func (i *importer) modelImports() []string { - std, pkg := i.modelImportSpecs() - importLines := []string{ - buildImportBlock(std), - "", - buildImportBlock(pkg), - } - return importLines -} - -func (i *importer) queryImportSpecs(fileName string) (map[string]importSpec, map[string]importSpec) { - queryUses := func(name string) bool { - for _, q := range i.Queries { - if q.SourceName != fileName { - continue - } - if queryValueUses(name, q.Ret) { - return true - } - for _, arg := range q.Args { - if queryValueUses(name, arg) { - return true - } - } - } - return false - } - - std := stdImports(queryUses) - - pkg := make(map[string]importSpec) - pkg["sqlalchemy"] = importSpec{Module: "sqlalchemy"} - if i.Settings.Python.EmitAsyncQuerier { - pkg["sqlalchemy.ext.asyncio"] = importSpec{Module: "sqlalchemy.ext.asyncio"} - } - - for _, o := range i.Settings.Overrides { - if pyTypeIsSet(o.PythonType) && o.PythonType.Module != "" { - if queryUses(pyTypeString(o.PythonType)) { - pkg[o.PythonType.Module] = importSpec{Module: o.PythonType.Module} - } - } - } - - queryValueModelImports := func(qv QueryValue) { - if qv.IsStruct() && qv.EmitStruct() { - if i.Settings.Python.EmitPydanticModels { - std["pydantic"] = importSpec{Module: "pydantic"} - } else { - std["dataclasses"] = importSpec{Module: "dataclasses"} - } - } - } - - for _, q := range i.Queries { - if q.SourceName != fileName { - continue - } - if q.Cmd == ":one" { - std["typing.Optional"] = importSpec{Module: "typing", Name: "Optional"} - } - if q.Cmd == ":many" { - if i.Settings.Python.EmitSyncQuerier { - std["typing.Iterator"] = importSpec{Module: "typing", Name: "Iterator"} - } - if i.Settings.Python.EmitAsyncQuerier { - std["typing.AsyncIterator"] = importSpec{Module: "typing", Name: "AsyncIterator"} - } - } - queryValueModelImports(q.Ret) - for _, qv := range q.Args { - queryValueModelImports(qv) - } - } - - return std, pkg -} - -func (i *importer) queryImports(fileName string) []string { - std, pkg := i.queryImportSpecs(fileName) - - modelImportStr := fmt.Sprintf("from %s import models", i.Settings.Python.Package) - - importLines := []string{ - buildImportBlock(std), - "", - buildImportBlock(pkg), - "", - modelImportStr, - } - return importLines -} - -type importFromSpec struct { - Module string - Names []string - Alias string -} - -func buildImportBlock2(pkgs map[string]importSpec) []importFromSpec { - pkgImports := make([]importFromSpec, 0) - fromImports := make(map[string][]string) - for _, is := range pkgs { - if is.Name == "" || is.Alias != "" { - pkgImports = append(pkgImports, importFromSpec{ - Module: is.Module, - Names: []string{is.Name}, - Alias: is.Alias, - }) - } else { - names, ok := fromImports[is.Module] - if !ok { - names = make([]string, 0, 1) - } - names = append(names, is.Name) - fromImports[is.Module] = names - } - } - for modName, names := range fromImports { - sort.Strings(names) - pkgImports = append(pkgImports, importFromSpec{ - Module: modName, - Names: names, - }) - } - sort.Slice(pkgImports, func(i, j int) bool { - return pkgImports[i].Module < pkgImports[j].Module || pkgImports[i].Names[0] < pkgImports[j].Names[0] - }) - return pkgImports -} - -func buildImportBlock(pkgs map[string]importSpec) string { - pkgImports := make([]importSpec, 0) - fromImports := make(map[string][]string) - for _, is := range pkgs { - if is.Name == "" || is.Alias != "" { - pkgImports = append(pkgImports, is) - } else { - names, ok := fromImports[is.Module] - if !ok { - names = make([]string, 0, 1) - } - names = append(names, is.Name) - fromImports[is.Module] = names - } - } - - importStrings := make([]string, 0, len(pkgImports)+len(fromImports)) - for _, is := range pkgImports { - importStrings = append(importStrings, is.String()) - } - for modName, names := range fromImports { - sort.Strings(names) - nameString := strings.Join(names, ", ") - importStrings = append(importStrings, fmt.Sprintf("from %s import %s", modName, nameString)) - } - sort.Strings(importStrings) - return strings.Join(importStrings, "\n") -} - -func stdImports(uses func(name string) bool) map[string]importSpec { - std := make(map[string]importSpec) - if uses("decimal.Decimal") { - std["decimal"] = importSpec{Module: "decimal"} - } - if uses("datetime.date") || uses("datetime.time") || uses("datetime.datetime") || uses("datetime.timedelta") { - std["datetime"] = importSpec{Module: "datetime"} - } - if uses("uuid.UUID") { - std["uuid"] = importSpec{Module: "uuid"} - } - if uses("typing.List") { - std["typing.List"] = importSpec{Module: "typing", Name: "List"} - } - if uses("typing.Optional") { - std["typing.Optional"] = importSpec{Module: "typing", Name: "Optional"} - } - if uses("Any") { - std["typing.Any"] = importSpec{Module: "typing", Name: "Any"} - } - return std -} diff --git a/internal/codegen/python/postgresql_type.go b/internal/codegen/python/postgresql_type.go deleted file mode 100644 index 5036180c3b..0000000000 --- a/internal/codegen/python/postgresql_type.go +++ /dev/null @@ -1,62 +0,0 @@ -package python - -import ( - "log" - - "github.com/kyleconroy/sqlc/internal/codegen/sdk" - "github.com/kyleconroy/sqlc/internal/plugin" -) - -func postgresType(req *plugin.CodeGenRequest, col *plugin.Column) string { - columnType := sdk.DataType(col.Type) - - switch columnType { - case "serial", "serial4", "pg_catalog.serial4", "bigserial", "serial8", "pg_catalog.serial8", "smallserial", "serial2", "pg_catalog.serial2", "integer", "int", "int4", "pg_catalog.int4", "bigint", "int8", "pg_catalog.int8", "smallint", "int2", "pg_catalog.int2": - return "int" - case "float", "double precision", "float8", "pg_catalog.float8", "real", "float4", "pg_catalog.float4": - return "float" - case "numeric", "pg_catalog.numeric", "money": - return "decimal.Decimal" - case "boolean", "bool", "pg_catalog.bool": - return "bool" - case "json", "jsonb": - return "Any" - case "bytea", "blob", "pg_catalog.bytea": - return "memoryview" - case "date": - return "datetime.date" - case "pg_catalog.time", "pg_catalog.timetz": - return "datetime.time" - case "pg_catalog.timestamp", "pg_catalog.timestamptz", "timestamptz": - return "datetime.datetime" - case "interval", "pg_catalog.interval": - return "datetime.timedelta" - case "text", "pg_catalog.varchar", "pg_catalog.bpchar", "string", "citext": - return "str" - case "uuid": - return "uuid.UUID" - case "inet", "cidr", "macaddr", "macaddr8": - // psycopg2 does have support for ipaddress objects, but it is not enabled by default - // - // https://www.psycopg.org/docs/extras.html#adapt-network - return "str" - case "ltree", "lquery", "ltxtquery": - return "str" - 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 "models." + modelName(enum.Name, req.Settings) - } - return "models." + modelName(schema.Name+"_"+enum.Name, req.Settings) - } - } - } - log.Printf("unknown PostgreSQL type: %s\n", columnType) - return "Any" - } -} diff --git a/internal/config/config.go b/internal/config/config.go index dde2823f3a..3ac7b93f6a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -104,9 +104,8 @@ type Codegen struct { } type SQLGen struct { - Go *SQLGo `json:"go,omitempty" yaml:"go"` - Python *SQLPython `json:"python,omitempty" yaml:"python"` - JSON *SQLJSON `json:"json,omitempty" yaml:"json"` + Go *SQLGo `json:"go,omitempty" yaml:"go"` + JSON *SQLJSON `json:"json,omitempty" yaml:"json"` } type SQLGo struct { @@ -135,18 +134,6 @@ type SQLGo struct { 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"` - EmitAsyncQuerier bool `json:"emit_async_querier" yaml:"emit_async_querier"` - Package string `json:"package" yaml:"package"` - Out string `json:"out" yaml:"out"` - Overrides []Override `json:"overrides,omitempty" yaml:"overrides"` - EmitPydanticModels bool `json:"emit_pydantic_models,omitempty" yaml:"emit_pydantic_models"` - QueryParameterLimit *int32 `json:"query_parameter_limit,omitempty" yaml:"query_parameter_limit"` - InflectionExcludeTableNames []string `json:"inflection_exclude_table_names,omitempty" yaml:"inflection_exclude_table_names"` -} - type SQLJSON struct { Out string `json:"out" yaml:"out"` Indent string `json:"indent,omitempty" yaml:"indent"` @@ -213,7 +200,6 @@ type CombinedSettings struct { Global Config Package SQL Go SQLGo - Python SQLPython JSON SQLJSON Rename map[string]string Overrides []Override @@ -235,10 +221,6 @@ func Combine(conf Config, pkg SQL) CombinedSettings { cs.Go = *pkg.Gen.Go cs.Overrides = append(cs.Overrides, pkg.Gen.Go.Overrides...) } - if pkg.Gen.Python != nil { - cs.Python = *pkg.Gen.Python - cs.Overrides = append(cs.Overrides, pkg.Gen.Python.Overrides...) - } if pkg.Gen.JSON != nil { cs.JSON = *pkg.Gen.JSON } diff --git a/internal/config/override.go b/internal/config/override.go index ccd03c37c9..8101a76ea7 100644 --- a/internal/config/override.go +++ b/internal/config/override.go @@ -17,9 +17,6 @@ type Override struct { // see https://github.com/kyleconroy/sqlc/issues/534 GoStructTag GoStructTag `json:"go_struct_tag" yaml:"go_struct_tag"` - // name of the python type to use, e.g. `mymodule.TypeName` - PythonType PythonType `json:"python_type" yaml:"python_type"` - // fully qualified name of the Go type, e.g. `github.com/segmentio/ksuid.KSUID` DBType string `json:"db_type" yaml:"db_type"` Deprecated_PostgresType string `json:"postgres_type" yaml:"postgres_type"` diff --git a/internal/config/v_two.go b/internal/config/v_two.go index 29546992d3..f0bad47e78 100644 --- a/internal/config/v_two.go +++ b/internal/config/v_two.go @@ -3,7 +3,6 @@ package config import ( "fmt" "io" - "os" "path/filepath" yaml "gopkg.in/yaml.v3" @@ -37,9 +36,8 @@ func v2ParseConfig(rd io.Reader) (Config, error) { } // TODO: Store built-in plugins somewhere else builtins := map[string]struct{}{ - "go": {}, - "json": {}, - "python": {}, + "go": {}, + "json": {}, } plugins := map[string]struct{}{} for i := range conf.Plugins { @@ -82,32 +80,6 @@ func v2ParseConfig(rd io.Reader) (Config, error) { } } } - 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") - fmt.Fprintf(os.Stderr, " You will need to migrate to the sqlc-gen-python plugin. See the step-by-step guide here:\n") - fmt.Fprintf(os.Stderr, " https://docs.sqlc.dev/en/latest/guides/migrating-to-sqlc-gen-python.html\n") - - if conf.SQL[j].Gen.Python.QueryParameterLimit != nil { - if *conf.SQL[j].Gen.Python.QueryParameterLimit < 0 { - return conf, ErrInvalidQueryParameterLimit - } - } - if conf.SQL[j].Gen.Python.Out == "" { - return conf, ErrNoOutPath - } - if conf.SQL[j].Gen.Python.Package == "" { - return conf, ErrNoPackageName - } - if !conf.SQL[j].Gen.Python.EmitSyncQuerier && !conf.SQL[j].Gen.Python.EmitAsyncQuerier { - return conf, ErrNoQuerierType - } - for i := range conf.SQL[j].Gen.Python.Overrides { - if err := conf.SQL[j].Gen.Python.Overrides[i].Parse(); err != nil { - return conf, err - } - } - } if conf.SQL[j].Gen.JSON != nil { if conf.SQL[j].Gen.JSON.Out == "" { return conf, ErrNoOutPath diff --git a/internal/endtoend/testdata/codegen_json/gen/codegen.json b/internal/endtoend/testdata/codegen_json/gen/codegen.json index 91c79e0924..74b4dc8f7c 100644 --- a/internal/endtoend/testdata/codegen_json/gen/codegen.json +++ b/internal/endtoend/testdata/codegen_json/gen/codegen.json @@ -15,15 +15,6 @@ "plugin": "", "options": "" }, - "python": { - "emit_exact_table_names": false, - "emit_sync_querier": false, - "emit_async_querier": false, - "package": "", - "out": "", - "emit_pydantic_models": false, - "inflection_exclude_table_names": [] - }, "go": { "emit_interface": false, "emit_json_tags": false, diff --git a/internal/endtoend/testdata/deprecated_python/query.sql b/internal/endtoend/testdata/deprecated_python/query.sql deleted file mode 100644 index 75e38b2caf..0000000000 --- a/internal/endtoend/testdata/deprecated_python/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_python/schema.sql b/internal/endtoend/testdata/deprecated_python/schema.sql deleted file mode 100644 index b4fad78497..0000000000 --- a/internal/endtoend/testdata/deprecated_python/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/deprecated_python/sqlc.json b/internal/endtoend/testdata/deprecated_python/sqlc.json deleted file mode 100644 index 63f1ea2480..0000000000 --- a/internal/endtoend/testdata/deprecated_python/sqlc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": "2", - "sql": [ - { - "schema": "schema.sql", - "queries": "query.sql", - "engine": "postgresql", - "gen": { - "python": { - "out": "src/authors", - "package": "authors", - "emit_sync_querier": true, - "emit_async_querier": true - } - } - } - ] -} diff --git a/internal/endtoend/testdata/deprecated_python/src/authors/models.py b/internal/endtoend/testdata/deprecated_python/src/authors/models.py deleted file mode 100644 index 7ac96646bc..0000000000 --- a/internal/endtoend/testdata/deprecated_python/src/authors/models.py +++ /dev/null @@ -1,12 +0,0 @@ -# Code generated by sqlc. DO NOT EDIT. -# versions: -# sqlc v1.16.0 -import dataclasses -from typing import Optional - - -@dataclasses.dataclass() -class Author: - id: int - name: str - bio: Optional[str] diff --git a/internal/endtoend/testdata/deprecated_python/src/authors/query.py b/internal/endtoend/testdata/deprecated_python/src/authors/query.py deleted file mode 100644 index 9cab3acbca..0000000000 --- a/internal/endtoend/testdata/deprecated_python/src/authors/query.py +++ /dev/null @@ -1,112 +0,0 @@ -# Code generated by sqlc. DO NOT EDIT. -# versions: -# sqlc v1.16.0 -# source: query.sql -from typing import AsyncIterator, Iterator, Optional - -import sqlalchemy -import sqlalchemy.ext.asyncio - -from authors import models - - -CREATE_AUTHOR = """-- name: create_author \\:one -INSERT INTO authors ( - name, bio -) VALUES ( - :p1, :p2 -) -RETURNING id, name, bio -""" - - -DELETE_AUTHOR = """-- name: delete_author \\:exec -DELETE FROM authors -WHERE id = :p1 -""" - - -GET_AUTHOR = """-- name: get_author \\:one -SELECT id, name, bio FROM authors -WHERE id = :p1 LIMIT 1 -""" - - -LIST_AUTHORS = """-- name: list_authors \\:many -SELECT id, name, bio FROM authors -ORDER BY name -""" - - -class Querier: - def __init__(self, conn: sqlalchemy.engine.Connection): - self._conn = conn - - def create_author(self, *, name: str, bio: Optional[str]) -> Optional[models.Author]: - row = self._conn.execute(sqlalchemy.text(CREATE_AUTHOR), {"p1": name, "p2": bio}).first() - if row is None: - return None - return models.Author( - id=row[0], - name=row[1], - bio=row[2], - ) - - def delete_author(self, *, id: int) -> None: - self._conn.execute(sqlalchemy.text(DELETE_AUTHOR), {"p1": id}) - - def get_author(self, *, id: int) -> Optional[models.Author]: - row = self._conn.execute(sqlalchemy.text(GET_AUTHOR), {"p1": id}).first() - if row is None: - return None - return models.Author( - id=row[0], - name=row[1], - bio=row[2], - ) - - def list_authors(self) -> Iterator[models.Author]: - result = self._conn.execute(sqlalchemy.text(LIST_AUTHORS)) - for row in result: - yield models.Author( - id=row[0], - name=row[1], - bio=row[2], - ) - - -class AsyncQuerier: - def __init__(self, conn: sqlalchemy.ext.asyncio.AsyncConnection): - self._conn = conn - - async def create_author(self, *, name: str, bio: Optional[str]) -> Optional[models.Author]: - row = (await self._conn.execute(sqlalchemy.text(CREATE_AUTHOR), {"p1": name, "p2": bio})).first() - if row is None: - return None - return models.Author( - id=row[0], - name=row[1], - bio=row[2], - ) - - async def delete_author(self, *, id: int) -> None: - await self._conn.execute(sqlalchemy.text(DELETE_AUTHOR), {"p1": id}) - - async def get_author(self, *, id: int) -> Optional[models.Author]: - row = (await self._conn.execute(sqlalchemy.text(GET_AUTHOR), {"p1": id})).first() - if row is None: - return None - return models.Author( - id=row[0], - name=row[1], - bio=row[2], - ) - - async def list_authors(self) -> AsyncIterator[models.Author]: - result = await self._conn.stream(sqlalchemy.text(LIST_AUTHORS)) - async for row in result: - yield models.Author( - id=row[0], - name=row[1], - bio=row[2], - ) 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 d22bdff03d..eac1de40fe 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 @@ -15,15 +15,6 @@ "plugin": "jsonb", "options": "eyJmaWxlbmFtZSI6ImNvZGVnZW4uanNvbiIsImluZGVudCI6IiAgIn0=" }, - "python": { - "emit_exact_table_names": false, - "emit_sync_querier": false, - "emit_async_querier": false, - "package": "", - "out": "", - "emit_pydantic_models": false, - "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 74d215922c..bb2c287ca0 100644 --- a/internal/plugin/codegen.pb.go +++ b/internal/plugin/codegen.pb.go @@ -90,7 +90,6 @@ type Override struct { Column string `protobuf:"bytes,6,opt,name=column,proto3" json:"column,omitempty"` Table *Identifier `protobuf:"bytes,7,opt,name=table,proto3" json:"table,omitempty"` ColumnName string `protobuf:"bytes,8,opt,name=column_name,proto3" json:"column_name,omitempty"` - PythonType *PythonType `protobuf:"bytes,9,opt,name=python_type,json=pythonType,proto3" json:"python_type,omitempty"` GoType *ParsedGoType `protobuf:"bytes,10,opt,name=go_type,json=goType,proto3" json:"go_type,omitempty"` } @@ -168,13 +167,6 @@ func (x *Override) GetColumnName() string { return "" } -func (x *Override) GetPythonType() *PythonType { - if x != nil { - return x.PythonType - } - return nil -} - func (x *Override) GetGoType() *ParsedGoType { if x != nil { return x.GoType @@ -182,61 +174,6 @@ func (x *Override) GetGoType() *ParsedGoType { return nil } -type PythonType struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *PythonType) Reset() { - *x = PythonType{} - if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PythonType) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PythonType) ProtoMessage() {} - -func (x *PythonType) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[2] - 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 PythonType.ProtoReflect.Descriptor instead. -func (*PythonType) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{2} -} - -func (x *PythonType) GetModule() string { - if x != nil { - return x.Module - } - return "" -} - -func (x *PythonType) GetName() string { - if x != nil { - return x.Name - } - return "" -} - type ParsedGoType struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -252,7 +189,7 @@ type ParsedGoType struct { func (x *ParsedGoType) Reset() { *x = ParsedGoType{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[3] + mi := &file_plugin_codegen_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -265,7 +202,7 @@ func (x *ParsedGoType) String() string { func (*ParsedGoType) ProtoMessage() {} func (x *ParsedGoType) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[3] + mi := &file_plugin_codegen_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -278,7 +215,7 @@ func (x *ParsedGoType) ProtoReflect() protoreflect.Message { // Deprecated: Use ParsedGoType.ProtoReflect.Descriptor instead. func (*ParsedGoType) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{3} + return file_plugin_codegen_proto_rawDescGZIP(), []int{2} } func (x *ParsedGoType) GetImportPath() string { @@ -329,15 +266,14 @@ type Settings struct { Overrides []*Override `protobuf:"bytes,6,rep,name=overrides,proto3" json:"overrides,omitempty"` 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"` - Go *GoCode `protobuf:"bytes,10,opt,name=go,proto3" json:"go,omitempty"` - Json *JSONCode `protobuf:"bytes,11,opt,name=json,proto3" json:"json,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"` } func (x *Settings) Reset() { *x = Settings{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[4] + mi := &file_plugin_codegen_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -350,7 +286,7 @@ func (x *Settings) String() string { func (*Settings) ProtoMessage() {} func (x *Settings) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[4] + mi := &file_plugin_codegen_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -363,7 +299,7 @@ func (x *Settings) ProtoReflect() protoreflect.Message { // Deprecated: Use Settings.ProtoReflect.Descriptor instead. func (*Settings) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{4} + return file_plugin_codegen_proto_rawDescGZIP(), []int{3} } func (x *Settings) GetVersion() string { @@ -415,13 +351,6 @@ func (x *Settings) GetCodegen() *Codegen { return nil } -func (x *Settings) GetPython() *PythonCode { - if x != nil { - return x.Python - } - return nil -} - func (x *Settings) GetGo() *GoCode { if x != nil { return x.Go @@ -449,7 +378,7 @@ type Codegen struct { func (x *Codegen) Reset() { *x = Codegen{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[5] + mi := &file_plugin_codegen_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -462,7 +391,7 @@ func (x *Codegen) String() string { func (*Codegen) ProtoMessage() {} func (x *Codegen) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[5] + mi := &file_plugin_codegen_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -475,7 +404,7 @@ func (x *Codegen) ProtoReflect() protoreflect.Message { // Deprecated: Use Codegen.ProtoReflect.Descriptor instead. func (*Codegen) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{5} + return file_plugin_codegen_proto_rawDescGZIP(), []int{4} } func (x *Codegen) GetOut() string { @@ -499,109 +428,6 @@ func (x *Codegen) GetOptions() []byte { return nil } -type PythonCode 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"` - EmitSyncQuerier bool `protobuf:"varint,2,opt,name=emit_sync_querier,json=emitSyncQuerier,proto3" json:"emit_sync_querier,omitempty"` - EmitAsyncQuerier bool `protobuf:"varint,3,opt,name=emit_async_querier,json=emitAsyncQuerier,proto3" json:"emit_async_querier,omitempty"` - Package string `protobuf:"bytes,4,opt,name=package,proto3" json:"package,omitempty"` - Out string `protobuf:"bytes,5,opt,name=out,proto3" json:"out,omitempty"` - EmitPydanticModels bool `protobuf:"varint,6,opt,name=emit_pydantic_models,json=emitPydanticModels,proto3" json:"emit_pydantic_models,omitempty"` - QueryParameterLimit *int32 `protobuf:"varint,7,opt,name=query_parameter_limit,json=queryParameterLimit,proto3,oneof" json:"query_parameter_limit,omitempty"` - InflectionExcludeTableNames []string `protobuf:"bytes,8,rep,name=inflection_exclude_table_names,json=inflectionExcludeTableNames,proto3" json:"inflection_exclude_table_names,omitempty"` -} - -func (x *PythonCode) Reset() { - *x = PythonCode{} - if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PythonCode) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PythonCode) ProtoMessage() {} - -func (x *PythonCode) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[6] - 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 PythonCode.ProtoReflect.Descriptor instead. -func (*PythonCode) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{6} -} - -func (x *PythonCode) GetEmitExactTableNames() bool { - if x != nil { - return x.EmitExactTableNames - } - return false -} - -func (x *PythonCode) GetEmitSyncQuerier() bool { - if x != nil { - return x.EmitSyncQuerier - } - return false -} - -func (x *PythonCode) GetEmitAsyncQuerier() bool { - if x != nil { - return x.EmitAsyncQuerier - } - return false -} - -func (x *PythonCode) GetPackage() string { - if x != nil { - return x.Package - } - return "" -} - -func (x *PythonCode) GetOut() string { - if x != nil { - return x.Out - } - return "" -} - -func (x *PythonCode) GetEmitPydanticModels() bool { - if x != nil { - return x.EmitPydanticModels - } - return false -} - -func (x *PythonCode) GetQueryParameterLimit() int32 { - if x != nil && x.QueryParameterLimit != nil { - return *x.QueryParameterLimit - } - return 0 -} - -func (x *PythonCode) GetInflectionExcludeTableNames() []string { - if x != nil { - return x.InflectionExcludeTableNames - } - return nil -} - type GoCode struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -633,7 +459,7 @@ type GoCode struct { func (x *GoCode) Reset() { *x = GoCode{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[7] + mi := &file_plugin_codegen_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -646,7 +472,7 @@ func (x *GoCode) String() string { func (*GoCode) ProtoMessage() {} func (x *GoCode) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[7] + mi := &file_plugin_codegen_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -659,7 +485,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{7} + return file_plugin_codegen_proto_rawDescGZIP(), []int{5} } func (x *GoCode) GetEmitInterface() bool { @@ -822,7 +648,7 @@ type JSONCode struct { func (x *JSONCode) Reset() { *x = JSONCode{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[8] + mi := &file_plugin_codegen_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -835,7 +661,7 @@ func (x *JSONCode) String() string { func (*JSONCode) ProtoMessage() {} func (x *JSONCode) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[8] + mi := &file_plugin_codegen_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -848,7 +674,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{8} + return file_plugin_codegen_proto_rawDescGZIP(), []int{6} } func (x *JSONCode) GetOut() string { @@ -886,7 +712,7 @@ type Catalog struct { func (x *Catalog) Reset() { *x = Catalog{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[9] + mi := &file_plugin_codegen_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -899,7 +725,7 @@ func (x *Catalog) String() string { func (*Catalog) ProtoMessage() {} func (x *Catalog) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[9] + mi := &file_plugin_codegen_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -912,7 +738,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{9} + return file_plugin_codegen_proto_rawDescGZIP(), []int{7} } func (x *Catalog) GetComment() string { @@ -958,7 +784,7 @@ type Schema struct { func (x *Schema) Reset() { *x = Schema{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[10] + mi := &file_plugin_codegen_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -971,7 +797,7 @@ func (x *Schema) String() string { func (*Schema) ProtoMessage() {} func (x *Schema) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[10] + mi := &file_plugin_codegen_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -984,7 +810,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{10} + return file_plugin_codegen_proto_rawDescGZIP(), []int{8} } func (x *Schema) GetComment() string { @@ -1034,7 +860,7 @@ type CompositeType struct { func (x *CompositeType) Reset() { *x = CompositeType{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[11] + mi := &file_plugin_codegen_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1047,7 +873,7 @@ func (x *CompositeType) String() string { func (*CompositeType) ProtoMessage() {} func (x *CompositeType) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[11] + mi := &file_plugin_codegen_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1060,7 +886,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{11} + return file_plugin_codegen_proto_rawDescGZIP(), []int{9} } func (x *CompositeType) GetName() string { @@ -1090,7 +916,7 @@ type Enum struct { func (x *Enum) Reset() { *x = Enum{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[12] + mi := &file_plugin_codegen_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1103,7 +929,7 @@ func (x *Enum) String() string { func (*Enum) ProtoMessage() {} func (x *Enum) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[12] + mi := &file_plugin_codegen_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1116,7 +942,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{12} + return file_plugin_codegen_proto_rawDescGZIP(), []int{10} } func (x *Enum) GetName() string { @@ -1153,7 +979,7 @@ type Table struct { func (x *Table) Reset() { *x = Table{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[13] + mi := &file_plugin_codegen_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1166,7 +992,7 @@ func (x *Table) String() string { func (*Table) ProtoMessage() {} func (x *Table) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[13] + mi := &file_plugin_codegen_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1179,7 +1005,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{13} + return file_plugin_codegen_proto_rawDescGZIP(), []int{11} } func (x *Table) GetRel() *Identifier { @@ -1216,7 +1042,7 @@ type Identifier struct { func (x *Identifier) Reset() { *x = Identifier{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[14] + mi := &file_plugin_codegen_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1229,7 +1055,7 @@ func (x *Identifier) String() string { func (*Identifier) ProtoMessage() {} func (x *Identifier) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[14] + mi := &file_plugin_codegen_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1242,7 +1068,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{14} + return file_plugin_codegen_proto_rawDescGZIP(), []int{12} } func (x *Identifier) GetCatalog() string { @@ -1288,7 +1114,7 @@ type Column struct { func (x *Column) Reset() { *x = Column{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[15] + mi := &file_plugin_codegen_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1301,7 +1127,7 @@ func (x *Column) String() string { func (*Column) ProtoMessage() {} func (x *Column) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[15] + mi := &file_plugin_codegen_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1314,7 +1140,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{15} + return file_plugin_codegen_proto_rawDescGZIP(), []int{13} } func (x *Column) GetName() string { @@ -1412,7 +1238,7 @@ type Query struct { func (x *Query) Reset() { *x = Query{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[16] + mi := &file_plugin_codegen_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1425,7 +1251,7 @@ func (x *Query) String() string { func (*Query) ProtoMessage() {} func (x *Query) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[16] + mi := &file_plugin_codegen_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1438,7 +1264,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{16} + return file_plugin_codegen_proto_rawDescGZIP(), []int{14} } func (x *Query) GetText() string { @@ -1509,7 +1335,7 @@ type Parameter struct { func (x *Parameter) Reset() { *x = Parameter{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[17] + mi := &file_plugin_codegen_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1522,7 +1348,7 @@ func (x *Parameter) String() string { func (*Parameter) ProtoMessage() {} func (x *Parameter) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[17] + mi := &file_plugin_codegen_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1535,7 +1361,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{17} + return file_plugin_codegen_proto_rawDescGZIP(), []int{15} } func (x *Parameter) GetNumber() int32 { @@ -1567,7 +1393,7 @@ type CodeGenRequest struct { func (x *CodeGenRequest) Reset() { *x = CodeGenRequest{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[18] + mi := &file_plugin_codegen_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1580,7 +1406,7 @@ func (x *CodeGenRequest) String() string { func (*CodeGenRequest) ProtoMessage() {} func (x *CodeGenRequest) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[18] + mi := &file_plugin_codegen_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1593,7 +1419,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{18} + return file_plugin_codegen_proto_rawDescGZIP(), []int{16} } func (x *CodeGenRequest) GetSettings() *Settings { @@ -1642,7 +1468,7 @@ type CodeGenResponse struct { func (x *CodeGenResponse) Reset() { *x = CodeGenResponse{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[19] + mi := &file_plugin_codegen_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1655,7 +1481,7 @@ func (x *CodeGenResponse) String() string { func (*CodeGenResponse) ProtoMessage() {} func (x *CodeGenResponse) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[19] + mi := &file_plugin_codegen_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1668,7 +1494,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{19} + return file_plugin_codegen_proto_rawDescGZIP(), []int{17} } func (x *CodeGenResponse) GetFiles() []*File { @@ -1686,7 +1512,7 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xa6, 0x02, 0x0a, 0x08, 0x4f, 0x76, 0x65, 0x72, 0x72, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xf7, 0x01, 0x0a, 0x08, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, @@ -1698,267 +1524,233 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 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, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x0b, 0x70, - 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x2d, 0x0a, 0x07, 0x67, 0x6f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, - 0x64, 0x47, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x67, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x22, - 0x38, 0x0a, 0x0a, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8b, 0x02, 0x0a, 0x0c, 0x50, 0x61, - 0x72, 0x73, 0x65, 0x64, 0x47, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6d, - 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x61, 0x74, 0x68, 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, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x62, 0x61, 0x73, 0x69, 0x63, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x74, 0x61, 0x67, 0x73, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, - 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x47, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x53, 0x74, 0x72, - 0x75, 0x63, 0x74, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x73, 0x74, - 0x72, 0x75, 0x63, 0x74, 0x54, 0x61, 0x67, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x53, 0x74, 0x72, 0x75, - 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, 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, - 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x18, - 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x06, 0x72, 0x65, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, - 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, - 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x4f, 0x76, 0x65, 0x72, 0x72, - 0x69, 0x64, 0x65, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x12, 0x29, - 0x0a, 0x07, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0f, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, - 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, 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, + 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x67, + 0x6f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x47, 0x6f, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x06, 0x67, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, + 0x22, 0x8b, 0x02, 0x0a, 0x0c, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x47, 0x6f, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x61, + 0x74, 0x68, 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, 0x1b, 0x0a, 0x09, + 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x74, 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x73, + 0x69, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x62, + 0x61, 0x73, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x75, + 0x63, 0x74, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x47, 0x6f, 0x54, + 0x79, 0x70, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x54, 0x61, 0x67, 0x73, 0x1a, + 0x3d, 0x0a, 0x0f, 0x53, 0x74, 0x72, 0x75, 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, 0x8c, + 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, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, + 0x34, 0x0a, 0x06, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x73, 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x72, + 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, + 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x2e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, + 0x72, 0x69, 0x64, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x07, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, + 0x43, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 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, 0x08, 0x10, 0x09, 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, 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, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6d, 0x69, 0x74, + 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, 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, - 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, 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, + 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, 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, 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, + 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 ( @@ -1973,63 +1765,59 @@ func file_plugin_codegen_proto_rawDescGZIP() []byte { return file_plugin_codegen_proto_rawDescData } -var file_plugin_codegen_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_plugin_codegen_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_plugin_codegen_proto_goTypes = []interface{}{ (*File)(nil), // 0: plugin.File (*Override)(nil), // 1: plugin.Override - (*PythonType)(nil), // 2: plugin.PythonType - (*ParsedGoType)(nil), // 3: plugin.ParsedGoType - (*Settings)(nil), // 4: plugin.Settings - (*Codegen)(nil), // 5: plugin.Codegen - (*PythonCode)(nil), // 6: plugin.PythonCode - (*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 + (*ParsedGoType)(nil), // 2: plugin.ParsedGoType + (*Settings)(nil), // 3: plugin.Settings + (*Codegen)(nil), // 4: plugin.Codegen + (*GoCode)(nil), // 5: plugin.GoCode + (*JSONCode)(nil), // 6: plugin.JSONCode + (*Catalog)(nil), // 7: plugin.Catalog + (*Schema)(nil), // 8: plugin.Schema + (*CompositeType)(nil), // 9: plugin.CompositeType + (*Enum)(nil), // 10: plugin.Enum + (*Table)(nil), // 11: plugin.Table + (*Identifier)(nil), // 12: plugin.Identifier + (*Column)(nil), // 13: plugin.Column + (*Query)(nil), // 14: plugin.Query + (*Parameter)(nil), // 15: plugin.Parameter + (*CodeGenRequest)(nil), // 16: plugin.CodeGenRequest + (*CodeGenResponse)(nil), // 17: plugin.CodeGenResponse + nil, // 18: plugin.ParsedGoType.StructTagsEntry + nil, // 19: plugin.Settings.RenameEntry } var file_plugin_codegen_proto_depIdxs = []int32{ - 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 - 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.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 + 12, // 0: plugin.Override.table:type_name -> plugin.Identifier + 2, // 1: plugin.Override.go_type:type_name -> plugin.ParsedGoType + 18, // 2: plugin.ParsedGoType.struct_tags:type_name -> plugin.ParsedGoType.StructTagsEntry + 19, // 3: plugin.Settings.rename:type_name -> plugin.Settings.RenameEntry + 1, // 4: plugin.Settings.overrides:type_name -> plugin.Override + 4, // 5: plugin.Settings.codegen:type_name -> plugin.Codegen + 5, // 6: plugin.Settings.go:type_name -> plugin.GoCode + 6, // 7: plugin.Settings.json:type_name -> plugin.JSONCode + 8, // 8: plugin.Catalog.schemas:type_name -> plugin.Schema + 11, // 9: plugin.Schema.tables:type_name -> plugin.Table + 10, // 10: plugin.Schema.enums:type_name -> plugin.Enum + 9, // 11: plugin.Schema.composite_types:type_name -> plugin.CompositeType + 12, // 12: plugin.Table.rel:type_name -> plugin.Identifier + 13, // 13: plugin.Table.columns:type_name -> plugin.Column + 12, // 14: plugin.Column.table:type_name -> plugin.Identifier + 12, // 15: plugin.Column.type:type_name -> plugin.Identifier + 13, // 16: plugin.Query.columns:type_name -> plugin.Column + 15, // 17: plugin.Query.params:type_name -> plugin.Parameter + 12, // 18: plugin.Query.insert_into_table:type_name -> plugin.Identifier + 13, // 19: plugin.Parameter.column:type_name -> plugin.Column + 3, // 20: plugin.CodeGenRequest.settings:type_name -> plugin.Settings + 7, // 21: plugin.CodeGenRequest.catalog:type_name -> plugin.Catalog + 14, // 22: plugin.CodeGenRequest.queries:type_name -> plugin.Query + 0, // 23: plugin.CodeGenResponse.files:type_name -> plugin.File + 24, // [24:24] is the sub-list for method output_type + 24, // [24:24] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_plugin_codegen_proto_init() } @@ -2063,18 +1851,6 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PythonType); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_plugin_codegen_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ParsedGoType); i { case 0: return &v.state @@ -2086,7 +1862,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Settings); i { case 0: return &v.state @@ -2098,7 +1874,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Codegen); i { case 0: return &v.state @@ -2110,19 +1886,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PythonCode); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_plugin_codegen_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GoCode); i { case 0: return &v.state @@ -2134,7 +1898,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JSONCode); i { case 0: return &v.state @@ -2146,7 +1910,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[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Catalog); i { case 0: return &v.state @@ -2158,7 +1922,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[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Schema); i { case 0: return &v.state @@ -2170,7 +1934,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[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CompositeType); i { case 0: return &v.state @@ -2182,7 +1946,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[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Enum); i { case 0: return &v.state @@ -2194,7 +1958,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[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Table); i { case 0: return &v.state @@ -2206,7 +1970,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[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Identifier); i { case 0: return &v.state @@ -2218,7 +1982,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[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Column); i { case 0: return &v.state @@ -2230,7 +1994,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[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Query); i { case 0: return &v.state @@ -2242,7 +2006,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[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Parameter); i { case 0: return &v.state @@ -2254,7 +2018,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[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CodeGenRequest); i { case 0: return &v.state @@ -2266,7 +2030,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[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CodeGenResponse); i { case 0: return &v.state @@ -2279,14 +2043,13 @@ func file_plugin_codegen_proto_init() { } } } - file_plugin_codegen_proto_msgTypes[6].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_plugin_codegen_proto_rawDesc, NumEnums: 0, - NumMessages: 22, + NumMessages: 20, NumExtensions: 0, NumServices: 0, }, diff --git a/internal/plugin/codegen_vtproto.pb.go b/internal/plugin/codegen_vtproto.pb.go index d9ab46cb8a..5b29a9c1d2 100644 --- a/internal/plugin/codegen_vtproto.pb.go +++ b/internal/plugin/codegen_vtproto.pb.go @@ -105,16 +105,6 @@ func (m *Override) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x52 } - if m.PythonType != nil { - size, err := m.PythonType.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x4a - } if len(m.ColumnName) > 0 { i -= len(m.ColumnName) copy(dAtA[i:], m.ColumnName) @@ -166,53 +156,6 @@ func (m *Override) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *PythonType) 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 *PythonType) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *PythonType) 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.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Module) > 0 { - i -= len(m.Module) - copy(dAtA[i:], m.Module) - i = encodeVarint(dAtA, i, uint64(len(m.Module))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *ParsedGoType) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -356,16 +299,6 @@ func (m *Settings) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x52 } - if m.Python != nil { - size, err := m.Python.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x42 - } if len(m.Overrides) > 0 { for iNdEx := len(m.Overrides) - 1; iNdEx >= 0; iNdEx-- { size, err := m.Overrides[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) @@ -486,107 +419,6 @@ func (m *Codegen) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *PythonCode) 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 *PythonCode) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *PythonCode) 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] = 0x42 - } - } - if m.QueryParameterLimit != nil { - i = encodeVarint(dAtA, i, uint64(*m.QueryParameterLimit)) - i-- - dAtA[i] = 0x38 - } - if m.EmitPydanticModels { - i-- - if m.EmitPydanticModels { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - 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] = 0x2a - } - 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] = 0x22 - } - if m.EmitAsyncQuerier { - i-- - if m.EmitAsyncQuerier { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.EmitSyncQuerier { - i-- - if m.EmitSyncQuerier { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - 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 @@ -1701,10 +1533,6 @@ func (m *Override) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } - if m.PythonType != nil { - l = m.PythonType.SizeVT() - n += 1 + l + sov(uint64(l)) - } if m.GoType != nil { l = m.GoType.SizeVT() n += 1 + l + sov(uint64(l)) @@ -1715,26 +1543,6 @@ func (m *Override) SizeVT() (n int) { return n } -func (m *PythonType) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Module) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - if m.unknownFields != nil { - n += len(m.unknownFields) - } - return n -} - func (m *ParsedGoType) SizeVT() (n int) { if m == nil { return 0 @@ -1810,10 +1618,6 @@ func (m *Settings) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if m.Python != nil { - l = m.Python.SizeVT() - n += 1 + l + sov(uint64(l)) - } if m.Go != nil { l = m.Go.SizeVT() n += 1 + l + sov(uint64(l)) @@ -1856,47 +1660,6 @@ func (m *Codegen) SizeVT() (n int) { return n } -func (m *PythonCode) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EmitExactTableNames { - n += 2 - } - if m.EmitSyncQuerier { - n += 2 - } - if m.EmitAsyncQuerier { - 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 m.EmitPydanticModels { - n += 2 - } - if m.QueryParameterLimit != nil { - n += 1 + sov(uint64(*m.QueryParameterLimit)) - } - 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 @@ -2679,42 +2442,6 @@ func (m *Override) UnmarshalVT(dAtA []byte) error { } m.ColumnName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PythonType", 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.PythonType == nil { - m.PythonType = &PythonType{} - } - if err := m.PythonType.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field GoType", wireType) @@ -2773,7 +2500,7 @@ func (m *Override) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *PythonType) UnmarshalVT(dAtA []byte) error { +func (m *ParsedGoType) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2796,15 +2523,15 @@ func (m *PythonType) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PythonType: wiretype end group for non-group") + return fmt.Errorf("proto: ParsedGoType: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PythonType: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ParsedGoType: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ImportPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2832,11 +2559,11 @@ func (m *PythonType) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Module = string(dAtA[iNdEx:postIndex]) + m.ImportPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Package", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2864,126 +2591,11 @@ func (m *PythonType) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Package = 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 *ParsedGoType) 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: ParsedGoType: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ParsedGoType: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImportPath", 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.ImportPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - 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 TypeName", wireType) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TypeName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3500,42 +3112,6 @@ func (m *Settings) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Python", 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.Python == nil { - m.Python = &PythonCode{} - } - if err := m.Python.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) @@ -3815,253 +3391,6 @@ func (m *Codegen) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *PythonCode) 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: PythonCode: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PythonCode: 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 != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EmitSyncQuerier", 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.EmitSyncQuerier = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EmitAsyncQuerier", 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.EmitAsyncQuerier = bool(v != 0) - case 4: - 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 5: - 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 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EmitPydanticModels", 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.EmitPydanticModels = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryParameterLimit", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.QueryParameterLimit = &v - case 8: - 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/internal/python/ast/ast.pb.go b/internal/python/ast/ast.pb.go deleted file mode 100644 index 3c95decfe7..0000000000 --- a/internal/python/ast/ast.pb.go +++ /dev/null @@ -1,3041 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.6.1 -// source: python/ast.proto - -package ast - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Node struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Node: - // *Node_ClassDef - // *Node_Import - // *Node_ImportFrom - // *Node_Module - // *Node_Alias - // *Node_AnnAssign - // *Node_Name - // *Node_Subscript - // *Node_Attribute - // *Node_Constant - // *Node_Assign - // *Node_Comment - // *Node_Expr - // *Node_Call - // *Node_FunctionDef - // *Node_Arg - // *Node_Arguments - // *Node_AsyncFunctionDef - // *Node_Pass - // *Node_Dict - // *Node_If - // *Node_Compare - // *Node_Return - // *Node_Is - // *Node_Keyword - // *Node_Yield - // *Node_For - // *Node_Await - // *Node_AsyncFor - // *Node_ImportGroup - Node isNode_Node `protobuf_oneof:"node"` -} - -func (x *Node) Reset() { - *x = Node{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Node) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Node) ProtoMessage() {} - -func (x *Node) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[0] - 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 Node.ProtoReflect.Descriptor instead. -func (*Node) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{0} -} - -func (m *Node) GetNode() isNode_Node { - if m != nil { - return m.Node - } - return nil -} - -func (x *Node) GetClassDef() *ClassDef { - if x, ok := x.GetNode().(*Node_ClassDef); ok { - return x.ClassDef - } - return nil -} - -func (x *Node) GetImport() *Import { - if x, ok := x.GetNode().(*Node_Import); ok { - return x.Import - } - return nil -} - -func (x *Node) GetImportFrom() *ImportFrom { - if x, ok := x.GetNode().(*Node_ImportFrom); ok { - return x.ImportFrom - } - return nil -} - -func (x *Node) GetModule() *Module { - if x, ok := x.GetNode().(*Node_Module); ok { - return x.Module - } - return nil -} - -func (x *Node) GetAlias() *Alias { - if x, ok := x.GetNode().(*Node_Alias); ok { - return x.Alias - } - return nil -} - -func (x *Node) GetAnnAssign() *AnnAssign { - if x, ok := x.GetNode().(*Node_AnnAssign); ok { - return x.AnnAssign - } - return nil -} - -func (x *Node) GetName() *Name { - if x, ok := x.GetNode().(*Node_Name); ok { - return x.Name - } - return nil -} - -func (x *Node) GetSubscript() *Subscript { - if x, ok := x.GetNode().(*Node_Subscript); ok { - return x.Subscript - } - return nil -} - -func (x *Node) GetAttribute() *Attribute { - if x, ok := x.GetNode().(*Node_Attribute); ok { - return x.Attribute - } - return nil -} - -func (x *Node) GetConstant() *Constant { - if x, ok := x.GetNode().(*Node_Constant); ok { - return x.Constant - } - return nil -} - -func (x *Node) GetAssign() *Assign { - if x, ok := x.GetNode().(*Node_Assign); ok { - return x.Assign - } - return nil -} - -func (x *Node) GetComment() *Comment { - if x, ok := x.GetNode().(*Node_Comment); ok { - return x.Comment - } - return nil -} - -func (x *Node) GetExpr() *Expr { - if x, ok := x.GetNode().(*Node_Expr); ok { - return x.Expr - } - return nil -} - -func (x *Node) GetCall() *Call { - if x, ok := x.GetNode().(*Node_Call); ok { - return x.Call - } - return nil -} - -func (x *Node) GetFunctionDef() *FunctionDef { - if x, ok := x.GetNode().(*Node_FunctionDef); ok { - return x.FunctionDef - } - return nil -} - -func (x *Node) GetArg() *Arg { - if x, ok := x.GetNode().(*Node_Arg); ok { - return x.Arg - } - return nil -} - -func (x *Node) GetArguments() *Arguments { - if x, ok := x.GetNode().(*Node_Arguments); ok { - return x.Arguments - } - return nil -} - -func (x *Node) GetAsyncFunctionDef() *AsyncFunctionDef { - if x, ok := x.GetNode().(*Node_AsyncFunctionDef); ok { - return x.AsyncFunctionDef - } - return nil -} - -func (x *Node) GetPass() *Pass { - if x, ok := x.GetNode().(*Node_Pass); ok { - return x.Pass - } - return nil -} - -func (x *Node) GetDict() *Dict { - if x, ok := x.GetNode().(*Node_Dict); ok { - return x.Dict - } - return nil -} - -func (x *Node) GetIf() *If { - if x, ok := x.GetNode().(*Node_If); ok { - return x.If - } - return nil -} - -func (x *Node) GetCompare() *Compare { - if x, ok := x.GetNode().(*Node_Compare); ok { - return x.Compare - } - return nil -} - -func (x *Node) GetReturn() *Return { - if x, ok := x.GetNode().(*Node_Return); ok { - return x.Return - } - return nil -} - -func (x *Node) GetIs() *Is { - if x, ok := x.GetNode().(*Node_Is); ok { - return x.Is - } - return nil -} - -func (x *Node) GetKeyword() *Keyword { - if x, ok := x.GetNode().(*Node_Keyword); ok { - return x.Keyword - } - return nil -} - -func (x *Node) GetYield() *Yield { - if x, ok := x.GetNode().(*Node_Yield); ok { - return x.Yield - } - return nil -} - -func (x *Node) GetFor() *For { - if x, ok := x.GetNode().(*Node_For); ok { - return x.For - } - return nil -} - -func (x *Node) GetAwait() *Await { - if x, ok := x.GetNode().(*Node_Await); ok { - return x.Await - } - return nil -} - -func (x *Node) GetAsyncFor() *AsyncFor { - if x, ok := x.GetNode().(*Node_AsyncFor); ok { - return x.AsyncFor - } - return nil -} - -func (x *Node) GetImportGroup() *ImportGroup { - if x, ok := x.GetNode().(*Node_ImportGroup); ok { - return x.ImportGroup - } - return nil -} - -type isNode_Node interface { - isNode_Node() -} - -type Node_ClassDef struct { - ClassDef *ClassDef `protobuf:"bytes,1,opt,name=class_def,json=ClassDef,proto3,oneof"` -} - -type Node_Import struct { - Import *Import `protobuf:"bytes,2,opt,name=import,json=Import,proto3,oneof"` -} - -type Node_ImportFrom struct { - ImportFrom *ImportFrom `protobuf:"bytes,3,opt,name=import_from,json=ImportFrom,proto3,oneof"` -} - -type Node_Module struct { - Module *Module `protobuf:"bytes,4,opt,name=module,json=Module,proto3,oneof"` -} - -type Node_Alias struct { - Alias *Alias `protobuf:"bytes,5,opt,name=alias,json=Alias,proto3,oneof"` -} - -type Node_AnnAssign struct { - AnnAssign *AnnAssign `protobuf:"bytes,6,opt,name=ann_assign,json=AnnAssign,proto3,oneof"` -} - -type Node_Name struct { - Name *Name `protobuf:"bytes,7,opt,name=name,json=Name,proto3,oneof"` -} - -type Node_Subscript struct { - Subscript *Subscript `protobuf:"bytes,8,opt,name=subscript,json=Subscript,proto3,oneof"` -} - -type Node_Attribute struct { - Attribute *Attribute `protobuf:"bytes,9,opt,name=attribute,json=Attribute,proto3,oneof"` -} - -type Node_Constant struct { - Constant *Constant `protobuf:"bytes,10,opt,name=constant,json=Constant,proto3,oneof"` -} - -type Node_Assign struct { - Assign *Assign `protobuf:"bytes,11,opt,name=assign,json=Assign,proto3,oneof"` -} - -type Node_Comment struct { - Comment *Comment `protobuf:"bytes,12,opt,name=comment,json=Comment,proto3,oneof"` -} - -type Node_Expr struct { - Expr *Expr `protobuf:"bytes,13,opt,name=expr,json=Expr,proto3,oneof"` -} - -type Node_Call struct { - Call *Call `protobuf:"bytes,14,opt,name=call,json=Call,proto3,oneof"` -} - -type Node_FunctionDef struct { - FunctionDef *FunctionDef `protobuf:"bytes,15,opt,name=function_def,json=FunctionDef,proto3,oneof"` -} - -type Node_Arg struct { - Arg *Arg `protobuf:"bytes,16,opt,name=arg,json=Arg,proto3,oneof"` -} - -type Node_Arguments struct { - Arguments *Arguments `protobuf:"bytes,17,opt,name=arguments,json=Arguments,proto3,oneof"` -} - -type Node_AsyncFunctionDef struct { - AsyncFunctionDef *AsyncFunctionDef `protobuf:"bytes,18,opt,name=async_function_def,json=AsyncFunctionDef,proto3,oneof"` -} - -type Node_Pass struct { - Pass *Pass `protobuf:"bytes,19,opt,name=pass,json=Pass,proto3,oneof"` -} - -type Node_Dict struct { - Dict *Dict `protobuf:"bytes,20,opt,name=dict,json=Dict,proto3,oneof"` -} - -type Node_If struct { - If *If `protobuf:"bytes,21,opt,name=if,json=If,proto3,oneof"` -} - -type Node_Compare struct { - Compare *Compare `protobuf:"bytes,22,opt,name=compare,json=Compare,proto3,oneof"` -} - -type Node_Return struct { - Return *Return `protobuf:"bytes,23,opt,name=return,json=Return,proto3,oneof"` -} - -type Node_Is struct { - Is *Is `protobuf:"bytes,24,opt,name=is,json=Is,proto3,oneof"` -} - -type Node_Keyword struct { - Keyword *Keyword `protobuf:"bytes,25,opt,name=keyword,json=Keyword,proto3,oneof"` -} - -type Node_Yield struct { - Yield *Yield `protobuf:"bytes,26,opt,name=yield,json=Yield,proto3,oneof"` -} - -type Node_For struct { - For *For `protobuf:"bytes,27,opt,name=for,json=For,proto3,oneof"` -} - -type Node_Await struct { - Await *Await `protobuf:"bytes,28,opt,name=await,json=Await,proto3,oneof"` -} - -type Node_AsyncFor struct { - AsyncFor *AsyncFor `protobuf:"bytes,29,opt,name=async_for,json=AsyncFor,proto3,oneof"` -} - -type Node_ImportGroup struct { - ImportGroup *ImportGroup `protobuf:"bytes,30,opt,name=import_group,json=ImportGroup,proto3,oneof"` -} - -func (*Node_ClassDef) isNode_Node() {} - -func (*Node_Import) isNode_Node() {} - -func (*Node_ImportFrom) isNode_Node() {} - -func (*Node_Module) isNode_Node() {} - -func (*Node_Alias) isNode_Node() {} - -func (*Node_AnnAssign) isNode_Node() {} - -func (*Node_Name) isNode_Node() {} - -func (*Node_Subscript) isNode_Node() {} - -func (*Node_Attribute) isNode_Node() {} - -func (*Node_Constant) isNode_Node() {} - -func (*Node_Assign) isNode_Node() {} - -func (*Node_Comment) isNode_Node() {} - -func (*Node_Expr) isNode_Node() {} - -func (*Node_Call) isNode_Node() {} - -func (*Node_FunctionDef) isNode_Node() {} - -func (*Node_Arg) isNode_Node() {} - -func (*Node_Arguments) isNode_Node() {} - -func (*Node_AsyncFunctionDef) isNode_Node() {} - -func (*Node_Pass) isNode_Node() {} - -func (*Node_Dict) isNode_Node() {} - -func (*Node_If) isNode_Node() {} - -func (*Node_Compare) isNode_Node() {} - -func (*Node_Return) isNode_Node() {} - -func (*Node_Is) isNode_Node() {} - -func (*Node_Keyword) isNode_Node() {} - -func (*Node_Yield) isNode_Node() {} - -func (*Node_For) isNode_Node() {} - -func (*Node_Await) isNode_Node() {} - -func (*Node_AsyncFor) isNode_Node() {} - -func (*Node_ImportGroup) isNode_Node() {} - -type Alias struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *Alias) Reset() { - *x = Alias{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Alias) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Alias) ProtoMessage() {} - -func (x *Alias) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[1] - 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 Alias.ProtoReflect.Descriptor instead. -func (*Alias) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{1} -} - -func (x *Alias) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type Await struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *Node `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Await) Reset() { - *x = Await{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Await) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Await) ProtoMessage() {} - -func (x *Await) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[2] - 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 Await.ProtoReflect.Descriptor instead. -func (*Await) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{2} -} - -func (x *Await) GetValue() *Node { - if x != nil { - return x.Value - } - return nil -} - -type Attribute struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *Node `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Attr string `protobuf:"bytes,2,opt,name=attr,proto3" json:"attr,omitempty"` -} - -func (x *Attribute) Reset() { - *x = Attribute{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Attribute) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Attribute) ProtoMessage() {} - -func (x *Attribute) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[3] - 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 Attribute.ProtoReflect.Descriptor instead. -func (*Attribute) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{3} -} - -func (x *Attribute) GetValue() *Node { - if x != nil { - return x.Value - } - return nil -} - -func (x *Attribute) GetAttr() string { - if x != nil { - return x.Attr - } - return "" -} - -type AnnAssign struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Target *Name `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` - Annotation *Node `protobuf:"bytes,2,opt,name=annotation,proto3" json:"annotation,omitempty"` - Simple int32 `protobuf:"varint,3,opt,name=simple,proto3" json:"simple,omitempty"` - Comment string `protobuf:"bytes,4,opt,name=Comment,json=comment,proto3" json:"Comment,omitempty"` -} - -func (x *AnnAssign) Reset() { - *x = AnnAssign{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnnAssign) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnnAssign) ProtoMessage() {} - -func (x *AnnAssign) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[4] - 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 AnnAssign.ProtoReflect.Descriptor instead. -func (*AnnAssign) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{4} -} - -func (x *AnnAssign) GetTarget() *Name { - if x != nil { - return x.Target - } - return nil -} - -func (x *AnnAssign) GetAnnotation() *Node { - if x != nil { - return x.Annotation - } - return nil -} - -func (x *AnnAssign) GetSimple() int32 { - if x != nil { - return x.Simple - } - return 0 -} - -func (x *AnnAssign) GetComment() string { - if x != nil { - return x.Comment - } - return "" -} - -type Arg struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Arg string `protobuf:"bytes,1,opt,name=arg,proto3" json:"arg,omitempty"` - Annotation *Node `protobuf:"bytes,2,opt,name=annotation,proto3" json:"annotation,omitempty"` -} - -func (x *Arg) Reset() { - *x = Arg{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Arg) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Arg) ProtoMessage() {} - -func (x *Arg) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Arg.ProtoReflect.Descriptor instead. -func (*Arg) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{5} -} - -func (x *Arg) GetArg() string { - if x != nil { - return x.Arg - } - return "" -} - -func (x *Arg) GetAnnotation() *Node { - if x != nil { - return x.Annotation - } - return nil -} - -type Arguments struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Args []*Arg `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"` - KwOnlyArgs []*Arg `protobuf:"bytes,2,rep,name=kw_only_args,json=kwonlyargs,proto3" json:"kw_only_args,omitempty"` -} - -func (x *Arguments) Reset() { - *x = Arguments{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Arguments) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Arguments) ProtoMessage() {} - -func (x *Arguments) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[6] - 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 Arguments.ProtoReflect.Descriptor instead. -func (*Arguments) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{6} -} - -func (x *Arguments) GetArgs() []*Arg { - if x != nil { - return x.Args - } - return nil -} - -func (x *Arguments) GetKwOnlyArgs() []*Arg { - if x != nil { - return x.KwOnlyArgs - } - return nil -} - -type AsyncFor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Target *Node `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` - Iter *Node `protobuf:"bytes,2,opt,name=iter,proto3" json:"iter,omitempty"` - Body []*Node `protobuf:"bytes,3,rep,name=body,proto3" json:"body,omitempty"` -} - -func (x *AsyncFor) Reset() { - *x = AsyncFor{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AsyncFor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AsyncFor) ProtoMessage() {} - -func (x *AsyncFor) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_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 AsyncFor.ProtoReflect.Descriptor instead. -func (*AsyncFor) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{7} -} - -func (x *AsyncFor) GetTarget() *Node { - if x != nil { - return x.Target - } - return nil -} - -func (x *AsyncFor) GetIter() *Node { - if x != nil { - return x.Iter - } - return nil -} - -func (x *AsyncFor) GetBody() []*Node { - if x != nil { - return x.Body - } - return nil -} - -type AsyncFunctionDef struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Args *Arguments `protobuf:"bytes,2,opt,name=Args,json=args,proto3" json:"Args,omitempty"` - Body []*Node `protobuf:"bytes,3,rep,name=body,proto3" json:"body,omitempty"` - Returns *Node `protobuf:"bytes,4,opt,name=returns,proto3" json:"returns,omitempty"` -} - -func (x *AsyncFunctionDef) Reset() { - *x = AsyncFunctionDef{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AsyncFunctionDef) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AsyncFunctionDef) ProtoMessage() {} - -func (x *AsyncFunctionDef) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[8] - 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 AsyncFunctionDef.ProtoReflect.Descriptor instead. -func (*AsyncFunctionDef) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{8} -} - -func (x *AsyncFunctionDef) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *AsyncFunctionDef) GetArgs() *Arguments { - if x != nil { - return x.Args - } - return nil -} - -func (x *AsyncFunctionDef) GetBody() []*Node { - if x != nil { - return x.Body - } - return nil -} - -func (x *AsyncFunctionDef) GetReturns() *Node { - if x != nil { - return x.Returns - } - return nil -} - -type Assign struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Targets []*Node `protobuf:"bytes,1,rep,name=targets,proto3" json:"targets,omitempty"` - Value *Node `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - Comment string `protobuf:"bytes,3,opt,name=Comment,json=comment,proto3" json:"Comment,omitempty"` -} - -func (x *Assign) Reset() { - *x = Assign{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Assign) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Assign) ProtoMessage() {} - -func (x *Assign) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[9] - 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 Assign.ProtoReflect.Descriptor instead. -func (*Assign) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{9} -} - -func (x *Assign) GetTargets() []*Node { - if x != nil { - return x.Targets - } - return nil -} - -func (x *Assign) GetValue() *Node { - if x != nil { - return x.Value - } - return nil -} - -func (x *Assign) GetComment() string { - if x != nil { - return x.Comment - } - return "" -} - -type Call struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Func *Node `protobuf:"bytes,1,opt,name=func,proto3" json:"func,omitempty"` - Args []*Node `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"` - Keywords []*Keyword `protobuf:"bytes,3,rep,name=keywords,proto3" json:"keywords,omitempty"` -} - -func (x *Call) Reset() { - *x = Call{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Call) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Call) ProtoMessage() {} - -func (x *Call) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[10] - 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 Call.ProtoReflect.Descriptor instead. -func (*Call) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{10} -} - -func (x *Call) GetFunc() *Node { - if x != nil { - return x.Func - } - return nil -} - -func (x *Call) GetArgs() []*Node { - if x != nil { - return x.Args - } - return nil -} - -func (x *Call) GetKeywords() []*Keyword { - if x != nil { - return x.Keywords - } - return nil -} - -type ClassDef struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Bases []*Node `protobuf:"bytes,2,rep,name=bases,proto3" json:"bases,omitempty"` - Keywords []*Node `protobuf:"bytes,3,rep,name=keywords,proto3" json:"keywords,omitempty"` - Body []*Node `protobuf:"bytes,4,rep,name=body,proto3" json:"body,omitempty"` - DecoratorList []*Node `protobuf:"bytes,5,rep,name=decorator_list,proto3" json:"decorator_list,omitempty"` -} - -func (x *ClassDef) Reset() { - *x = ClassDef{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClassDef) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClassDef) ProtoMessage() {} - -func (x *ClassDef) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[11] - 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 ClassDef.ProtoReflect.Descriptor instead. -func (*ClassDef) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{11} -} - -func (x *ClassDef) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ClassDef) GetBases() []*Node { - if x != nil { - return x.Bases - } - return nil -} - -func (x *ClassDef) GetKeywords() []*Node { - if x != nil { - return x.Keywords - } - return nil -} - -func (x *ClassDef) GetBody() []*Node { - if x != nil { - return x.Body - } - return nil -} - -func (x *ClassDef) GetDecoratorList() []*Node { - if x != nil { - return x.DecoratorList - } - return nil -} - -// The Python ast module does not parse comments. It's not clear if this is the -// best way to support them in the AST -type Comment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` -} - -func (x *Comment) Reset() { - *x = Comment{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Comment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Comment) ProtoMessage() {} - -func (x *Comment) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[12] - 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 Comment.ProtoReflect.Descriptor instead. -func (*Comment) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{12} -} - -func (x *Comment) GetText() string { - if x != nil { - return x.Text - } - return "" -} - -type Compare struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Left *Node `protobuf:"bytes,1,opt,name=left,proto3" json:"left,omitempty"` - Ops []*Node `protobuf:"bytes,2,rep,name=ops,proto3" json:"ops,omitempty"` - Comparators []*Node `protobuf:"bytes,3,rep,name=comparators,proto3" json:"comparators,omitempty"` -} - -func (x *Compare) Reset() { - *x = Compare{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Compare) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Compare) ProtoMessage() {} - -func (x *Compare) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[13] - 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 Compare.ProtoReflect.Descriptor instead. -func (*Compare) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{13} -} - -func (x *Compare) GetLeft() *Node { - if x != nil { - return x.Left - } - return nil -} - -func (x *Compare) GetOps() []*Node { - if x != nil { - return x.Ops - } - return nil -} - -func (x *Compare) GetComparators() []*Node { - if x != nil { - return x.Comparators - } - return nil -} - -type Constant struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Value: - // *Constant_Str - // *Constant_Int - // *Constant_None - Value isConstant_Value `protobuf_oneof:"value"` -} - -func (x *Constant) Reset() { - *x = Constant{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Constant) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Constant) ProtoMessage() {} - -func (x *Constant) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[14] - 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 Constant.ProtoReflect.Descriptor instead. -func (*Constant) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{14} -} - -func (m *Constant) GetValue() isConstant_Value { - if m != nil { - return m.Value - } - return nil -} - -func (x *Constant) GetStr() string { - if x, ok := x.GetValue().(*Constant_Str); ok { - return x.Str - } - return "" -} - -func (x *Constant) GetInt() int32 { - if x, ok := x.GetValue().(*Constant_Int); ok { - return x.Int - } - return 0 -} - -func (x *Constant) GetNone() bool { - if x, ok := x.GetValue().(*Constant_None); ok { - return x.None - } - return false -} - -type isConstant_Value interface { - isConstant_Value() -} - -type Constant_Str struct { - Str string `protobuf:"bytes,1,opt,name=str,json=string,proto3,oneof"` -} - -type Constant_Int struct { - Int int32 `protobuf:"varint,2,opt,name=int,proto3,oneof"` -} - -type Constant_None struct { - None bool `protobuf:"varint,3,opt,name=none,proto3,oneof"` -} - -func (*Constant_Str) isConstant_Value() {} - -func (*Constant_Int) isConstant_Value() {} - -func (*Constant_None) isConstant_Value() {} - -type Dict struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Keys []*Node `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` - Values []*Node `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"` -} - -func (x *Dict) Reset() { - *x = Dict{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Dict) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Dict) ProtoMessage() {} - -func (x *Dict) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[15] - 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 Dict.ProtoReflect.Descriptor instead. -func (*Dict) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{15} -} - -func (x *Dict) GetKeys() []*Node { - if x != nil { - return x.Keys - } - return nil -} - -func (x *Dict) GetValues() []*Node { - if x != nil { - return x.Values - } - return nil -} - -type Expr struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *Node `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Expr) Reset() { - *x = Expr{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Expr) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Expr) ProtoMessage() {} - -func (x *Expr) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[16] - 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 Expr.ProtoReflect.Descriptor instead. -func (*Expr) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{16} -} - -func (x *Expr) GetValue() *Node { - if x != nil { - return x.Value - } - return nil -} - -type For struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Target *Node `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` - Iter *Node `protobuf:"bytes,2,opt,name=iter,proto3" json:"iter,omitempty"` - Body []*Node `protobuf:"bytes,3,rep,name=body,proto3" json:"body,omitempty"` -} - -func (x *For) Reset() { - *x = For{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *For) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*For) ProtoMessage() {} - -func (x *For) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[17] - 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 For.ProtoReflect.Descriptor instead. -func (*For) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{17} -} - -func (x *For) GetTarget() *Node { - if x != nil { - return x.Target - } - return nil -} - -func (x *For) GetIter() *Node { - if x != nil { - return x.Iter - } - return nil -} - -func (x *For) GetBody() []*Node { - if x != nil { - return x.Body - } - return nil -} - -type FunctionDef struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Args *Arguments `protobuf:"bytes,2,opt,name=Args,json=args,proto3" json:"Args,omitempty"` - Body []*Node `protobuf:"bytes,3,rep,name=body,proto3" json:"body,omitempty"` - Returns *Node `protobuf:"bytes,4,opt,name=returns,proto3" json:"returns,omitempty"` -} - -func (x *FunctionDef) Reset() { - *x = FunctionDef{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FunctionDef) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FunctionDef) ProtoMessage() {} - -func (x *FunctionDef) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[18] - 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 FunctionDef.ProtoReflect.Descriptor instead. -func (*FunctionDef) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{18} -} - -func (x *FunctionDef) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *FunctionDef) GetArgs() *Arguments { - if x != nil { - return x.Args - } - return nil -} - -func (x *FunctionDef) GetBody() []*Node { - if x != nil { - return x.Body - } - return nil -} - -func (x *FunctionDef) GetReturns() *Node { - if x != nil { - return x.Returns - } - return nil -} - -type If struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Test *Node `protobuf:"bytes,1,opt,name=test,proto3" json:"test,omitempty"` - Body []*Node `protobuf:"bytes,2,rep,name=body,proto3" json:"body,omitempty"` - OrElse []*Node `protobuf:"bytes,3,rep,name=or_else,json=orelse,proto3" json:"or_else,omitempty"` -} - -func (x *If) Reset() { - *x = If{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *If) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*If) ProtoMessage() {} - -func (x *If) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[19] - 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 If.ProtoReflect.Descriptor instead. -func (*If) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{19} -} - -func (x *If) GetTest() *Node { - if x != nil { - return x.Test - } - return nil -} - -func (x *If) GetBody() []*Node { - if x != nil { - return x.Body - } - return nil -} - -func (x *If) GetOrElse() []*Node { - if x != nil { - return x.OrElse - } - return nil -} - -type Import struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Names []*Node `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` -} - -func (x *Import) Reset() { - *x = Import{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Import) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Import) ProtoMessage() {} - -func (x *Import) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[20] - 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 Import.ProtoReflect.Descriptor instead. -func (*Import) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{20} -} - -func (x *Import) GetNames() []*Node { - if x != nil { - return x.Names - } - return nil -} - -type ImportFrom struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` - Names []*Node `protobuf:"bytes,2,rep,name=names,proto3" json:"names,omitempty"` - Level int32 `protobuf:"varint,3,opt,name=level,proto3" json:"level,omitempty"` -} - -func (x *ImportFrom) Reset() { - *x = ImportFrom{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ImportFrom) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ImportFrom) ProtoMessage() {} - -func (x *ImportFrom) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[21] - 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 ImportFrom.ProtoReflect.Descriptor instead. -func (*ImportFrom) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{21} -} - -func (x *ImportFrom) GetModule() string { - if x != nil { - return x.Module - } - return "" -} - -func (x *ImportFrom) GetNames() []*Node { - if x != nil { - return x.Names - } - return nil -} - -func (x *ImportFrom) GetLevel() int32 { - if x != nil { - return x.Level - } - return 0 -} - -// Imports are always put at the top of the file, just after any module -// comments and docstrings, and before module globals and constants. -// -// Imports should be grouped in the following order: -// -// Standard library imports. -// Related third party imports. -// Local application/library specific imports. -// -// You should put a blank line between each group of imports. -// -// https://www.python.org/dev/peps/pep-0008/#imports -type ImportGroup struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Imports []*Node `protobuf:"bytes,1,rep,name=imports,proto3" json:"imports,omitempty"` -} - -func (x *ImportGroup) Reset() { - *x = ImportGroup{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ImportGroup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ImportGroup) ProtoMessage() {} - -func (x *ImportGroup) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[22] - 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 ImportGroup.ProtoReflect.Descriptor instead. -func (*ImportGroup) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{22} -} - -func (x *ImportGroup) GetImports() []*Node { - if x != nil { - return x.Imports - } - return nil -} - -type Is struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Is) Reset() { - *x = Is{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Is) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Is) ProtoMessage() {} - -func (x *Is) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[23] - 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 Is.ProtoReflect.Descriptor instead. -func (*Is) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{23} -} - -type Keyword struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Arg string `protobuf:"bytes,1,opt,name=arg,proto3" json:"arg,omitempty"` - Value *Node `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Keyword) Reset() { - *x = Keyword{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Keyword) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Keyword) ProtoMessage() {} - -func (x *Keyword) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[24] - 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 Keyword.ProtoReflect.Descriptor instead. -func (*Keyword) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{24} -} - -func (x *Keyword) GetArg() string { - if x != nil { - return x.Arg - } - return "" -} - -func (x *Keyword) GetValue() *Node { - if x != nil { - return x.Value - } - return nil -} - -type Module struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Body []*Node `protobuf:"bytes,1,rep,name=body,proto3" json:"body,omitempty"` -} - -func (x *Module) Reset() { - *x = Module{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Module) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Module) ProtoMessage() {} - -func (x *Module) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[25] - 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 Module.ProtoReflect.Descriptor instead. -func (*Module) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{25} -} - -func (x *Module) GetBody() []*Node { - if x != nil { - return x.Body - } - return nil -} - -type Name struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *Name) Reset() { - *x = Name{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Name) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Name) ProtoMessage() {} - -func (x *Name) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[26] - 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 Name.ProtoReflect.Descriptor instead. -func (*Name) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{26} -} - -func (x *Name) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type Pass struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Pass) Reset() { - *x = Pass{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Pass) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Pass) ProtoMessage() {} - -func (x *Pass) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[27] - 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 Pass.ProtoReflect.Descriptor instead. -func (*Pass) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{27} -} - -type Return struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *Node `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Return) Reset() { - *x = Return{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Return) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Return) ProtoMessage() {} - -func (x *Return) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[28] - 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 Return.ProtoReflect.Descriptor instead. -func (*Return) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{28} -} - -func (x *Return) GetValue() *Node { - if x != nil { - return x.Value - } - return nil -} - -type Subscript struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *Name `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Slice *Node `protobuf:"bytes,2,opt,name=slice,proto3" json:"slice,omitempty"` -} - -func (x *Subscript) Reset() { - *x = Subscript{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Subscript) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Subscript) ProtoMessage() {} - -func (x *Subscript) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[29] - 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 Subscript.ProtoReflect.Descriptor instead. -func (*Subscript) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{29} -} - -func (x *Subscript) GetValue() *Name { - if x != nil { - return x.Value - } - return nil -} - -func (x *Subscript) GetSlice() *Node { - if x != nil { - return x.Slice - } - return nil -} - -type Yield struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *Node `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Yield) Reset() { - *x = Yield{} - if protoimpl.UnsafeEnabled { - mi := &file_python_ast_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Yield) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Yield) ProtoMessage() {} - -func (x *Yield) ProtoReflect() protoreflect.Message { - mi := &file_python_ast_proto_msgTypes[30] - 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 Yield.ProtoReflect.Descriptor instead. -func (*Yield) Descriptor() ([]byte, []int) { - return file_python_ast_proto_rawDescGZIP(), []int{30} -} - -func (x *Yield) GetValue() *Node { - if x != nil { - return x.Value - } - return nil -} - -var File_python_ast_proto protoreflect.FileDescriptor - -var file_python_ast_proto_rawDesc = []byte{ - 0x0a, 0x10, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2f, 0x61, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x0a, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x22, 0xb0, - 0x0b, 0x0a, 0x04, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, - 0x5f, 0x64, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x79, 0x74, - 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x44, 0x65, 0x66, - 0x48, 0x00, 0x52, 0x08, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x44, 0x65, 0x66, 0x12, 0x2c, 0x0a, 0x06, - 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, - 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, - 0x48, 0x00, 0x52, 0x06, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x39, 0x0a, 0x0b, 0x69, 0x6d, - 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x49, 0x6d, 0x70, - 0x6f, 0x72, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x48, 0x00, 0x52, 0x0a, 0x49, 0x6d, 0x70, 0x6f, 0x72, - 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x2c, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, - 0x73, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, - 0x41, 0x6c, 0x69, 0x61, 0x73, 0x48, 0x00, 0x52, 0x05, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x36, - 0x0a, 0x0a, 0x61, 0x6e, 0x6e, 0x5f, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, - 0x41, 0x6e, 0x6e, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x48, 0x00, 0x52, 0x09, 0x41, 0x6e, 0x6e, - 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x26, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, - 0x74, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x48, 0x00, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x35, - 0x0a, 0x09, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x53, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x48, 0x00, 0x52, 0x09, 0x53, 0x75, 0x62, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x35, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, - 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x48, - 0x00, 0x52, 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x32, 0x0a, 0x08, - 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x08, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, - 0x12, 0x2c, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x41, 0x73, - 0x73, 0x69, 0x67, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x2f, - 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x13, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, - 0x26, 0x0a, 0x04, 0x65, 0x78, 0x70, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x48, - 0x00, 0x52, 0x04, 0x45, 0x78, 0x70, 0x72, 0x12, 0x26, 0x0a, 0x04, 0x63, 0x61, 0x6c, 0x6c, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, - 0x73, 0x74, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x48, 0x00, 0x52, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, - 0x3c, 0x0a, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, - 0x73, 0x74, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x48, 0x00, - 0x52, 0x0b, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x12, 0x23, 0x0a, - 0x03, 0x61, 0x72, 0x67, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x79, 0x74, - 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x41, 0x72, 0x67, 0x48, 0x00, 0x52, 0x03, 0x41, - 0x72, 0x67, 0x12, 0x35, 0x0a, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, - 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, - 0x73, 0x74, 0x2e, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x48, 0x00, 0x52, 0x09, - 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x4c, 0x0a, 0x12, 0x61, 0x73, 0x79, - 0x6e, 0x63, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x18, - 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, - 0x73, 0x74, 0x2e, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x44, 0x65, 0x66, 0x48, 0x00, 0x52, 0x10, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x75, 0x6e, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x12, 0x26, 0x0a, 0x04, 0x70, 0x61, 0x73, 0x73, 0x18, - 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, - 0x73, 0x74, 0x2e, 0x50, 0x61, 0x73, 0x73, 0x48, 0x00, 0x52, 0x04, 0x50, 0x61, 0x73, 0x73, 0x12, - 0x26, 0x0a, 0x04, 0x64, 0x69, 0x63, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x44, 0x69, 0x63, 0x74, 0x48, - 0x00, 0x52, 0x04, 0x44, 0x69, 0x63, 0x74, 0x12, 0x20, 0x0a, 0x02, 0x69, 0x66, 0x18, 0x15, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, - 0x2e, 0x49, 0x66, 0x48, 0x00, 0x52, 0x02, 0x49, 0x66, 0x12, 0x2f, 0x0a, 0x07, 0x63, 0x6f, 0x6d, - 0x70, 0x61, 0x72, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x79, 0x74, - 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x48, - 0x00, 0x52, 0x07, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x72, 0x65, - 0x74, 0x75, 0x72, 0x6e, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x79, 0x74, - 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x48, 0x00, - 0x52, 0x06, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x12, 0x20, 0x0a, 0x02, 0x69, 0x73, 0x18, 0x18, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, - 0x74, 0x2e, 0x49, 0x73, 0x48, 0x00, 0x52, 0x02, 0x49, 0x73, 0x12, 0x2f, 0x0a, 0x07, 0x6b, 0x65, - 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x79, - 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, - 0x48, 0x00, 0x52, 0x07, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x29, 0x0a, 0x05, 0x79, - 0x69, 0x65, 0x6c, 0x64, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x79, 0x74, - 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x59, 0x69, 0x65, 0x6c, 0x64, 0x48, 0x00, 0x52, - 0x05, 0x59, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x23, 0x0a, 0x03, 0x66, 0x6f, 0x72, 0x18, 0x1b, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, - 0x2e, 0x46, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x03, 0x46, 0x6f, 0x72, 0x12, 0x29, 0x0a, 0x05, 0x61, - 0x77, 0x61, 0x69, 0x74, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x79, 0x74, - 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x41, 0x77, 0x61, 0x69, 0x74, 0x48, 0x00, 0x52, - 0x05, 0x41, 0x77, 0x61, 0x69, 0x74, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, - 0x66, 0x6f, 0x72, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x79, 0x74, 0x68, - 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x6f, 0x72, 0x48, - 0x00, 0x52, 0x08, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x6f, 0x72, 0x12, 0x3c, 0x0a, 0x0c, 0x69, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x1e, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x49, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x48, 0x00, 0x52, 0x0b, 0x49, 0x6d, - 0x70, 0x6f, 0x72, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x06, 0x0a, 0x04, 0x6e, 0x6f, 0x64, - 0x65, 0x22, 0x1b, 0x0a, 0x05, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2f, - 0x0a, 0x05, 0x41, 0x77, 0x61, 0x69, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, - 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0x47, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, - 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x74, 0x74, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x61, 0x74, 0x74, 0x72, 0x22, 0x99, 0x01, 0x0a, 0x09, 0x41, 0x6e, 0x6e, - 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x28, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, - 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x12, 0x30, 0x0a, 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, - 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x06, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x49, 0x0a, 0x03, 0x41, 0x72, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x61, - 0x72, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x72, 0x67, 0x12, 0x30, 0x0a, - 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, - 0x6f, 0x64, 0x65, 0x52, 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x63, 0x0a, 0x09, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x23, 0x0a, 0x04, - 0x61, 0x72, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x79, 0x74, - 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x41, 0x72, 0x67, 0x52, 0x04, 0x61, 0x72, 0x67, - 0x73, 0x12, 0x31, 0x0a, 0x0c, 0x6b, 0x77, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x5f, 0x61, 0x72, 0x67, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, - 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x41, 0x72, 0x67, 0x52, 0x0a, 0x6b, 0x77, 0x6f, 0x6e, 0x6c, 0x79, - 0x61, 0x72, 0x67, 0x73, 0x22, 0x80, 0x01, 0x0a, 0x08, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x6f, - 0x72, 0x12, 0x28, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, - 0x6f, 0x64, 0x65, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x69, - 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, - 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x69, 0x74, 0x65, - 0x72, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xa3, 0x01, 0x0a, 0x10, 0x41, 0x73, 0x79, 0x6e, - 0x63, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x29, 0x0a, 0x04, 0x41, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x41, 0x72, 0x67, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x24, 0x0a, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, - 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x62, 0x6f, 0x64, - 0x79, 0x12, 0x2a, 0x0a, 0x07, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, - 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x22, 0x76, 0x0a, - 0x06, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x2a, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, - 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, - 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x43, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x83, 0x01, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x24, - 0x0a, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, - 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, - 0x66, 0x75, 0x6e, 0x63, 0x12, 0x24, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, - 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x2f, 0x0a, 0x08, 0x6b, 0x65, - 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, - 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, - 0x64, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x22, 0xd4, 0x01, 0x0a, 0x08, - 0x43, 0x6c, 0x61, 0x73, 0x73, 0x44, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x05, - 0x62, 0x61, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, - 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x62, - 0x61, 0x73, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, - 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, - 0x64, 0x73, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x38, 0x0a, 0x0e, 0x64, 0x65, 0x63, 0x6f, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x0e, 0x64, 0x65, 0x63, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x69, - 0x73, 0x74, 0x22, 0x1d, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, - 0x74, 0x22, 0x87, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x12, 0x24, 0x0a, - 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, - 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6c, - 0x65, 0x66, 0x74, 0x12, 0x22, 0x0a, 0x03, 0x6f, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x03, 0x6f, 0x70, 0x73, 0x12, 0x32, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, - 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x0b, - 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x54, 0x0a, 0x08, 0x43, - 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x12, - 0x0a, 0x03, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x03, 0x69, - 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x04, 0x6e, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x48, 0x00, 0x52, 0x04, 0x6e, 0x6f, 0x6e, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x56, 0x0a, 0x04, 0x44, 0x69, 0x63, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x6b, 0x65, 0x79, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, - 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x12, - 0x28, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x2e, 0x0a, 0x04, 0x45, 0x78, 0x70, - 0x72, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x7b, 0x0a, 0x03, 0x46, 0x6f, 0x72, - 0x12, 0x28, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x69, 0x74, - 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, - 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x69, 0x74, 0x65, 0x72, - 0x12, 0x24, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, - 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x46, 0x75, 0x6e, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x04, 0x41, 0x72, - 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, - 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, - 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, - 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2a, 0x0a, 0x07, 0x72, - 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, - 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x07, - 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x22, 0x7b, 0x0a, 0x02, 0x49, 0x66, 0x12, 0x24, 0x0a, - 0x04, 0x74, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, - 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x74, - 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, - 0x6f, 0x64, 0x65, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x29, 0x0a, 0x07, 0x6f, 0x72, 0x5f, - 0x65, 0x6c, 0x73, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, - 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x6f, 0x72, - 0x65, 0x6c, 0x73, 0x65, 0x22, 0x30, 0x0a, 0x06, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x26, - 0x0a, 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, - 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x62, 0x0a, 0x0a, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, - 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x26, 0x0a, 0x05, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, - 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x39, 0x0a, 0x0b, 0x49, 0x6d, - 0x70, 0x6f, 0x72, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x2a, 0x0a, 0x07, 0x69, 0x6d, 0x70, - 0x6f, 0x72, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, - 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x69, 0x6d, - 0x70, 0x6f, 0x72, 0x74, 0x73, 0x22, 0x04, 0x0a, 0x02, 0x49, 0x73, 0x22, 0x43, 0x0a, 0x07, 0x4b, - 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x72, 0x67, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x72, 0x67, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, - 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x22, 0x2e, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, - 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x22, 0x16, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x06, 0x0a, 0x04, 0x50, 0x61, 0x73, 0x73, - 0x22, 0x30, 0x0a, 0x06, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, - 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x5b, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, - 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x61, 0x6d, 0x65, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x26, 0x0a, 0x05, 0x73, 0x6c, 0x69, 0x63, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, - 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x22, - 0x2f, 0x0a, 0x05, 0x59, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, - 0x2e, 0x61, 0x73, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x42, 0x30, 0x5a, 0x2e, 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, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2f, 0x61, - 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_python_ast_proto_rawDescOnce sync.Once - file_python_ast_proto_rawDescData = file_python_ast_proto_rawDesc -) - -func file_python_ast_proto_rawDescGZIP() []byte { - file_python_ast_proto_rawDescOnce.Do(func() { - file_python_ast_proto_rawDescData = protoimpl.X.CompressGZIP(file_python_ast_proto_rawDescData) - }) - return file_python_ast_proto_rawDescData -} - -var file_python_ast_proto_msgTypes = make([]protoimpl.MessageInfo, 31) -var file_python_ast_proto_goTypes = []interface{}{ - (*Node)(nil), // 0: python.ast.Node - (*Alias)(nil), // 1: python.ast.Alias - (*Await)(nil), // 2: python.ast.Await - (*Attribute)(nil), // 3: python.ast.Attribute - (*AnnAssign)(nil), // 4: python.ast.AnnAssign - (*Arg)(nil), // 5: python.ast.Arg - (*Arguments)(nil), // 6: python.ast.Arguments - (*AsyncFor)(nil), // 7: python.ast.AsyncFor - (*AsyncFunctionDef)(nil), // 8: python.ast.AsyncFunctionDef - (*Assign)(nil), // 9: python.ast.Assign - (*Call)(nil), // 10: python.ast.Call - (*ClassDef)(nil), // 11: python.ast.ClassDef - (*Comment)(nil), // 12: python.ast.Comment - (*Compare)(nil), // 13: python.ast.Compare - (*Constant)(nil), // 14: python.ast.Constant - (*Dict)(nil), // 15: python.ast.Dict - (*Expr)(nil), // 16: python.ast.Expr - (*For)(nil), // 17: python.ast.For - (*FunctionDef)(nil), // 18: python.ast.FunctionDef - (*If)(nil), // 19: python.ast.If - (*Import)(nil), // 20: python.ast.Import - (*ImportFrom)(nil), // 21: python.ast.ImportFrom - (*ImportGroup)(nil), // 22: python.ast.ImportGroup - (*Is)(nil), // 23: python.ast.Is - (*Keyword)(nil), // 24: python.ast.Keyword - (*Module)(nil), // 25: python.ast.Module - (*Name)(nil), // 26: python.ast.Name - (*Pass)(nil), // 27: python.ast.Pass - (*Return)(nil), // 28: python.ast.Return - (*Subscript)(nil), // 29: python.ast.Subscript - (*Yield)(nil), // 30: python.ast.Yield -} -var file_python_ast_proto_depIdxs = []int32{ - 11, // 0: python.ast.Node.class_def:type_name -> python.ast.ClassDef - 20, // 1: python.ast.Node.import:type_name -> python.ast.Import - 21, // 2: python.ast.Node.import_from:type_name -> python.ast.ImportFrom - 25, // 3: python.ast.Node.module:type_name -> python.ast.Module - 1, // 4: python.ast.Node.alias:type_name -> python.ast.Alias - 4, // 5: python.ast.Node.ann_assign:type_name -> python.ast.AnnAssign - 26, // 6: python.ast.Node.name:type_name -> python.ast.Name - 29, // 7: python.ast.Node.subscript:type_name -> python.ast.Subscript - 3, // 8: python.ast.Node.attribute:type_name -> python.ast.Attribute - 14, // 9: python.ast.Node.constant:type_name -> python.ast.Constant - 9, // 10: python.ast.Node.assign:type_name -> python.ast.Assign - 12, // 11: python.ast.Node.comment:type_name -> python.ast.Comment - 16, // 12: python.ast.Node.expr:type_name -> python.ast.Expr - 10, // 13: python.ast.Node.call:type_name -> python.ast.Call - 18, // 14: python.ast.Node.function_def:type_name -> python.ast.FunctionDef - 5, // 15: python.ast.Node.arg:type_name -> python.ast.Arg - 6, // 16: python.ast.Node.arguments:type_name -> python.ast.Arguments - 8, // 17: python.ast.Node.async_function_def:type_name -> python.ast.AsyncFunctionDef - 27, // 18: python.ast.Node.pass:type_name -> python.ast.Pass - 15, // 19: python.ast.Node.dict:type_name -> python.ast.Dict - 19, // 20: python.ast.Node.if:type_name -> python.ast.If - 13, // 21: python.ast.Node.compare:type_name -> python.ast.Compare - 28, // 22: python.ast.Node.return:type_name -> python.ast.Return - 23, // 23: python.ast.Node.is:type_name -> python.ast.Is - 24, // 24: python.ast.Node.keyword:type_name -> python.ast.Keyword - 30, // 25: python.ast.Node.yield:type_name -> python.ast.Yield - 17, // 26: python.ast.Node.for:type_name -> python.ast.For - 2, // 27: python.ast.Node.await:type_name -> python.ast.Await - 7, // 28: python.ast.Node.async_for:type_name -> python.ast.AsyncFor - 22, // 29: python.ast.Node.import_group:type_name -> python.ast.ImportGroup - 0, // 30: python.ast.Await.value:type_name -> python.ast.Node - 0, // 31: python.ast.Attribute.value:type_name -> python.ast.Node - 26, // 32: python.ast.AnnAssign.target:type_name -> python.ast.Name - 0, // 33: python.ast.AnnAssign.annotation:type_name -> python.ast.Node - 0, // 34: python.ast.Arg.annotation:type_name -> python.ast.Node - 5, // 35: python.ast.Arguments.args:type_name -> python.ast.Arg - 5, // 36: python.ast.Arguments.kw_only_args:type_name -> python.ast.Arg - 0, // 37: python.ast.AsyncFor.target:type_name -> python.ast.Node - 0, // 38: python.ast.AsyncFor.iter:type_name -> python.ast.Node - 0, // 39: python.ast.AsyncFor.body:type_name -> python.ast.Node - 6, // 40: python.ast.AsyncFunctionDef.Args:type_name -> python.ast.Arguments - 0, // 41: python.ast.AsyncFunctionDef.body:type_name -> python.ast.Node - 0, // 42: python.ast.AsyncFunctionDef.returns:type_name -> python.ast.Node - 0, // 43: python.ast.Assign.targets:type_name -> python.ast.Node - 0, // 44: python.ast.Assign.value:type_name -> python.ast.Node - 0, // 45: python.ast.Call.func:type_name -> python.ast.Node - 0, // 46: python.ast.Call.args:type_name -> python.ast.Node - 24, // 47: python.ast.Call.keywords:type_name -> python.ast.Keyword - 0, // 48: python.ast.ClassDef.bases:type_name -> python.ast.Node - 0, // 49: python.ast.ClassDef.keywords:type_name -> python.ast.Node - 0, // 50: python.ast.ClassDef.body:type_name -> python.ast.Node - 0, // 51: python.ast.ClassDef.decorator_list:type_name -> python.ast.Node - 0, // 52: python.ast.Compare.left:type_name -> python.ast.Node - 0, // 53: python.ast.Compare.ops:type_name -> python.ast.Node - 0, // 54: python.ast.Compare.comparators:type_name -> python.ast.Node - 0, // 55: python.ast.Dict.keys:type_name -> python.ast.Node - 0, // 56: python.ast.Dict.values:type_name -> python.ast.Node - 0, // 57: python.ast.Expr.value:type_name -> python.ast.Node - 0, // 58: python.ast.For.target:type_name -> python.ast.Node - 0, // 59: python.ast.For.iter:type_name -> python.ast.Node - 0, // 60: python.ast.For.body:type_name -> python.ast.Node - 6, // 61: python.ast.FunctionDef.Args:type_name -> python.ast.Arguments - 0, // 62: python.ast.FunctionDef.body:type_name -> python.ast.Node - 0, // 63: python.ast.FunctionDef.returns:type_name -> python.ast.Node - 0, // 64: python.ast.If.test:type_name -> python.ast.Node - 0, // 65: python.ast.If.body:type_name -> python.ast.Node - 0, // 66: python.ast.If.or_else:type_name -> python.ast.Node - 0, // 67: python.ast.Import.names:type_name -> python.ast.Node - 0, // 68: python.ast.ImportFrom.names:type_name -> python.ast.Node - 0, // 69: python.ast.ImportGroup.imports:type_name -> python.ast.Node - 0, // 70: python.ast.Keyword.value:type_name -> python.ast.Node - 0, // 71: python.ast.Module.body:type_name -> python.ast.Node - 0, // 72: python.ast.Return.value:type_name -> python.ast.Node - 26, // 73: python.ast.Subscript.value:type_name -> python.ast.Name - 0, // 74: python.ast.Subscript.slice:type_name -> python.ast.Node - 0, // 75: python.ast.Yield.value:type_name -> python.ast.Node - 76, // [76:76] is the sub-list for method output_type - 76, // [76:76] is the sub-list for method input_type - 76, // [76:76] is the sub-list for extension type_name - 76, // [76:76] is the sub-list for extension extendee - 0, // [0:76] is the sub-list for field type_name -} - -func init() { file_python_ast_proto_init() } -func file_python_ast_proto_init() { - if File_python_ast_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_python_ast_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Node); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Alias); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Await); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Attribute); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnnAssign); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Arg); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Arguments); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AsyncFor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AsyncFunctionDef); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Assign); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Call); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClassDef); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Comment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Compare); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Constant); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Dict); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Expr); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*For); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FunctionDef); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*If); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Import); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImportFrom); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImportGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Is); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Keyword); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Module); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Name); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Pass); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Return); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Subscript); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_python_ast_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Yield); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_python_ast_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*Node_ClassDef)(nil), - (*Node_Import)(nil), - (*Node_ImportFrom)(nil), - (*Node_Module)(nil), - (*Node_Alias)(nil), - (*Node_AnnAssign)(nil), - (*Node_Name)(nil), - (*Node_Subscript)(nil), - (*Node_Attribute)(nil), - (*Node_Constant)(nil), - (*Node_Assign)(nil), - (*Node_Comment)(nil), - (*Node_Expr)(nil), - (*Node_Call)(nil), - (*Node_FunctionDef)(nil), - (*Node_Arg)(nil), - (*Node_Arguments)(nil), - (*Node_AsyncFunctionDef)(nil), - (*Node_Pass)(nil), - (*Node_Dict)(nil), - (*Node_If)(nil), - (*Node_Compare)(nil), - (*Node_Return)(nil), - (*Node_Is)(nil), - (*Node_Keyword)(nil), - (*Node_Yield)(nil), - (*Node_For)(nil), - (*Node_Await)(nil), - (*Node_AsyncFor)(nil), - (*Node_ImportGroup)(nil), - } - file_python_ast_proto_msgTypes[14].OneofWrappers = []interface{}{ - (*Constant_Str)(nil), - (*Constant_Int)(nil), - (*Constant_None)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_python_ast_proto_rawDesc, - NumEnums: 0, - NumMessages: 31, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_python_ast_proto_goTypes, - DependencyIndexes: file_python_ast_proto_depIdxs, - MessageInfos: file_python_ast_proto_msgTypes, - }.Build() - File_python_ast_proto = out.File - file_python_ast_proto_rawDesc = nil - file_python_ast_proto_goTypes = nil - file_python_ast_proto_depIdxs = nil -} diff --git a/internal/python/poet/builders.go b/internal/python/poet/builders.go deleted file mode 100644 index 52acf5e0f4..0000000000 --- a/internal/python/poet/builders.go +++ /dev/null @@ -1,90 +0,0 @@ -package poet - -import "github.com/kyleconroy/sqlc/internal/python/ast" - -func Alias(name string) *ast.Node { - return &ast.Node{ - Node: &ast.Node_Alias{ - Alias: &ast.Alias{ - Name: name, - }, - }, - } -} - -func Await(value *ast.Node) *ast.Node { - return &ast.Node{ - Node: &ast.Node_Await{ - Await: &ast.Await{ - Value: value, - }, - }, - } -} - -func Attribute(value *ast.Node, attr string) *ast.Node { - return &ast.Node{ - Node: &ast.Node_Attribute{ - Attribute: &ast.Attribute{ - Value: value, - Attr: attr, - }, - }, - } -} - -func Comment(text string) *ast.Node { - return &ast.Node{ - Node: &ast.Node_Comment{ - Comment: &ast.Comment{ - Text: text, - }, - }, - } -} - -func Expr(value *ast.Node) *ast.Node { - return &ast.Node{ - Node: &ast.Node_Expr{ - Expr: &ast.Expr{ - Value: value, - }, - }, - } -} - -func Is() *ast.Node { - return &ast.Node{ - Node: &ast.Node_Is{ - Is: &ast.Is{}, - }, - } -} - -func Name(id string) *ast.Node { - return &ast.Node{ - Node: &ast.Node_Name{ - Name: &ast.Name{Id: id}, - }, - } -} - -func Return(value *ast.Node) *ast.Node { - return &ast.Node{ - Node: &ast.Node_Return{ - Return: &ast.Return{ - Value: value, - }, - }, - } -} - -func Yield(value *ast.Node) *ast.Node { - return &ast.Node{ - Node: &ast.Node_Yield{ - Yield: &ast.Yield{ - Value: value, - }, - }, - } -} diff --git a/internal/python/poet/poet.go b/internal/python/poet/poet.go deleted file mode 100644 index f976ecb7ee..0000000000 --- a/internal/python/poet/poet.go +++ /dev/null @@ -1,213 +0,0 @@ -package poet - -import ( - "github.com/kyleconroy/sqlc/internal/python/ast" -) - -type proto interface { - ProtoMessage() -} - -func Nodes(nodes ...proto) []*ast.Node { - list := make([]*ast.Node, len(nodes)) - for i, _ := range nodes { - list[i] = Node(nodes[i]) - } - return list -} - -func Node(node proto) *ast.Node { - switch n := node.(type) { - - case *ast.Alias: - return &ast.Node{ - Node: &ast.Node_Alias{ - Alias: n, - }, - } - - case *ast.Await: - return &ast.Node{ - Node: &ast.Node_Await{ - Await: n, - }, - } - - case *ast.AnnAssign: - return &ast.Node{ - Node: &ast.Node_AnnAssign{ - AnnAssign: n, - }, - } - - case *ast.Assign: - return &ast.Node{ - Node: &ast.Node_Assign{ - Assign: n, - }, - } - - case *ast.AsyncFor: - return &ast.Node{ - Node: &ast.Node_AsyncFor{ - AsyncFor: n, - }, - } - - case *ast.AsyncFunctionDef: - return &ast.Node{ - Node: &ast.Node_AsyncFunctionDef{ - AsyncFunctionDef: n, - }, - } - - case *ast.Attribute: - return &ast.Node{ - Node: &ast.Node_Attribute{ - Attribute: n, - }, - } - - case *ast.Call: - return &ast.Node{ - Node: &ast.Node_Call{ - Call: n, - }, - } - - case *ast.ClassDef: - return &ast.Node{ - Node: &ast.Node_ClassDef{ - ClassDef: n, - }, - } - - case *ast.Comment: - return &ast.Node{ - Node: &ast.Node_Comment{ - Comment: n, - }, - } - - case *ast.Compare: - return &ast.Node{ - Node: &ast.Node_Compare{ - Compare: n, - }, - } - - // case *ast.Constant: - - // case *ast.Dict: - - case *ast.Expr: - return &ast.Node{ - Node: &ast.Node_Expr{ - Expr: n, - }, - } - - case *ast.For: - return &ast.Node{ - Node: &ast.Node_For{ - For: n, - }, - } - - case *ast.FunctionDef: - return &ast.Node{ - Node: &ast.Node_FunctionDef{ - FunctionDef: n, - }, - } - - case *ast.If: - return &ast.Node{ - Node: &ast.Node_If{ - If: n, - }, - } - - // case *ast.Node_Import: - // w.printImport(n.Import, indent) - - // case *ast.Node_ImportFrom: - // w.printImportFrom(n.ImportFrom, indent) - - // case *ast.Node_Is: - // w.print("is") - - // case *ast.Node_Keyword: - // w.printKeyword(n.Keyword, indent) - - case *ast.Module: - return &ast.Node{ - Node: &ast.Node_Module{ - Module: n, - }, - } - - // w.printModule(n.Module, indent) - - // case *ast.Node_Name: - // w.print(n.Name.Id) - - // case *ast.Node_Pass: - // w.print("pass") - - // case *ast.Node_Return: - // w.printReturn(n.Return, indent) - - // case *ast.Node_Subscript: - // w.printSubscript(n.Subscript, indent) - - case *ast.Yield: - return &ast.Node{ - Node: &ast.Node_Yield{ - Yield: n, - }, - } - - default: - panic(n) - } - -} - -func Constant(value interface{}) *ast.Node { - switch n := value.(type) { - case string: - return &ast.Node{ - Node: &ast.Node_Constant{ - Constant: &ast.Constant{ - Value: &ast.Constant_Str{ - Str: n, - }, - }, - }, - } - - case int: - return &ast.Node{ - Node: &ast.Node_Constant{ - Constant: &ast.Constant{ - Value: &ast.Constant_Int{ - Int: int32(n), - }, - }, - }, - } - - case nil: - return &ast.Node{ - Node: &ast.Node_Constant{ - Constant: &ast.Constant{ - Value: &ast.Constant_None{}, - }, - }, - } - - default: - panic("unknown type") - } -} diff --git a/internal/python/printer/printer.go b/internal/python/printer/printer.go deleted file mode 100644 index db148caff4..0000000000 --- a/internal/python/printer/printer.go +++ /dev/null @@ -1,494 +0,0 @@ -package printer - -import ( - "strconv" - "strings" - - "github.com/kyleconroy/sqlc/internal/python/ast" -) - -type writer struct { - options Options - src []byte -} - -type Options struct { -} - -type PrintResult struct { - Python []byte -} - -func Print(node *ast.Node, options Options) PrintResult { - w := writer{options: options} - w.printNode(node, 0) - return PrintResult{ - Python: w.src, - } -} - -func (w *writer) print(text string) { - w.src = append(w.src, text...) -} - -func (w *writer) printIndent(indent int32) { - for i, n := 0, int(indent); i < n; i++ { - w.src = append(w.src, " "...) - } -} - -func (w *writer) printNode(node *ast.Node, indent int32) { - switch n := node.Node.(type) { - - case *ast.Node_Alias: - w.print(n.Alias.Name) - - case *ast.Node_AnnAssign: - w.printAnnAssign(n.AnnAssign, indent) - - case *ast.Node_Assign: - w.printAssign(n.Assign, indent) - - case *ast.Node_AsyncFor: - w.printAsyncFor(n.AsyncFor, indent) - - case *ast.Node_AsyncFunctionDef: - w.printAsyncFunctionDef(n.AsyncFunctionDef, indent) - - case *ast.Node_Attribute: - w.printAttribute(n.Attribute, indent) - - case *ast.Node_Await: - w.printAwait(n.Await, indent) - - case *ast.Node_Call: - w.printCall(n.Call, indent) - - case *ast.Node_ClassDef: - w.printClassDef(n.ClassDef, indent) - - case *ast.Node_Comment: - w.printComment(n.Comment, indent) - - case *ast.Node_Compare: - w.printCompare(n.Compare, indent) - - case *ast.Node_Constant: - w.printConstant(n.Constant, indent) - - case *ast.Node_Dict: - w.printDict(n.Dict, indent) - - case *ast.Node_Expr: - w.printNode(n.Expr.Value, indent) - - case *ast.Node_For: - w.printFor(n.For, indent) - - case *ast.Node_FunctionDef: - w.printFunctionDef(n.FunctionDef, indent) - - case *ast.Node_If: - w.printIf(n.If, indent) - - case *ast.Node_Import: - w.printImport(n.Import, indent) - - case *ast.Node_ImportFrom: - w.printImportFrom(n.ImportFrom, indent) - - case *ast.Node_ImportGroup: - w.printImportGroup(n.ImportGroup, indent) - - case *ast.Node_Is: - w.print("is") - - case *ast.Node_Keyword: - w.printKeyword(n.Keyword, indent) - - case *ast.Node_Module: - w.printModule(n.Module, indent) - - case *ast.Node_Name: - w.print(n.Name.Id) - - case *ast.Node_Pass: - w.print("pass") - - case *ast.Node_Return: - w.printReturn(n.Return, indent) - - case *ast.Node_Subscript: - w.printSubscript(n.Subscript, indent) - - case *ast.Node_Yield: - w.printYield(n.Yield, indent) - - default: - panic(n) - - } -} - -func (w *writer) printAnnAssign(aa *ast.AnnAssign, indent int32) { - if aa.Comment != "" { - w.print("# ") - w.print(aa.Comment) - w.print("\n") - w.printIndent(indent) - } - w.printName(aa.Target, indent) - w.print(": ") - w.printNode(aa.Annotation, indent) -} - -func (w *writer) printArg(a *ast.Arg, indent int32) { - w.print(a.Arg) - if a.Annotation != nil { - w.print(": ") - w.printNode(a.Annotation, indent) - } -} - -func (w *writer) printAssign(a *ast.Assign, indent int32) { - for i, name := range a.Targets { - w.printNode(name, indent) - if i != len(a.Targets)-1 { - w.print(", ") - } - } - w.print(" = ") - w.printNode(a.Value, indent) -} - -func (w *writer) printAsyncFor(n *ast.AsyncFor, indent int32) { - w.print("async ") - w.printFor(&ast.For{ - Target: n.Target, - Iter: n.Iter, - Body: n.Body, - }, indent) -} - -func (w *writer) printAsyncFunctionDef(afd *ast.AsyncFunctionDef, indent int32) { - w.print("async ") - w.printFunctionDef(&ast.FunctionDef{ - Name: afd.Name, - Args: afd.Args, - Body: afd.Body, - Returns: afd.Returns, - }, indent) -} - -func (w *writer) printAttribute(a *ast.Attribute, indent int32) { - if _, ok := a.Value.Node.(*ast.Node_Await); ok { - w.print("(") - w.printNode(a.Value, indent) - w.print(")") - } else { - w.printNode(a.Value, indent) - } - w.print(".") - w.print(a.Attr) -} - -func (w *writer) printAwait(n *ast.Await, indent int32) { - w.print("await ") - w.printNode(n.Value, indent) -} - -func (w *writer) printCall(c *ast.Call, indent int32) { - w.printNode(c.Func, indent) - w.print("(") - for i, a := range c.Args { - w.printNode(a, indent) - if i != len(c.Args)-1 { - w.print(", ") - } - } - for _, kw := range c.Keywords { - w.print("\n") - w.printIndent(indent + 1) - w.printKeyword(kw, indent+1) - w.print(",") - } - if len(c.Keywords) > 0 { - w.print("\n") - w.printIndent(indent) - } - w.print(")") -} - -func (w *writer) printClassDef(cd *ast.ClassDef, indent int32) { - for _, node := range cd.DecoratorList { - w.print("@") - w.printNode(node, indent) - w.print("\n") - } - w.print("class ") - w.print(cd.Name) - if len(cd.Bases) > 0 { - w.print("(") - for i, node := range cd.Bases { - w.printNode(node, indent) - if i != len(cd.Bases)-1 { - w.print(", ") - } - } - w.print(")") - } - w.print(":\n") - for i, node := range cd.Body { - if i != 0 { - if _, ok := node.Node.(*ast.Node_FunctionDef); ok { - w.print("\n") - } - if _, ok := node.Node.(*ast.Node_AsyncFunctionDef); ok { - w.print("\n") - } - } - w.printIndent(indent + 1) - // A docstring is a string literal that occurs as the first - // statement in a module, function, class, or method - // definition. Such a docstring becomes the __doc__ special - // attribute of that object. - if i == 0 { - if e, ok := node.Node.(*ast.Node_Expr); ok { - if c, ok := e.Expr.Value.Node.(*ast.Node_Constant); ok { - w.print(`""`) - w.printConstant(c.Constant, indent) - w.print(`""`) - w.print("\n") - continue - } - } - } - w.printNode(node, indent+1) - w.print("\n") - } -} - -func (w *writer) printConstant(c *ast.Constant, indent int32) { - switch n := c.Value.(type) { - case *ast.Constant_Int: - w.print(strconv.Itoa(int(n.Int))) - - case *ast.Constant_None: - w.print("None") - - case *ast.Constant_Str: - str := `"` - if strings.Contains(n.Str, "\n") { - str = `"""` - } - w.print(str) - w.print(n.Str) - w.print(str) - - default: - panic(n) - } -} - -func (w *writer) printComment(c *ast.Comment, indent int32) { - w.print("# ") - w.print(c.Text) - w.print("\n") -} - -func (w *writer) printCompare(c *ast.Compare, indent int32) { - w.printNode(c.Left, indent) - w.print(" ") - for _, node := range c.Ops { - w.printNode(node, indent) - w.print(" ") - } - for _, node := range c.Comparators { - w.printNode(node, indent) - } -} - -func (w *writer) printDict(d *ast.Dict, indent int32) { - if len(d.Keys) != len(d.Values) { - panic(`dict keys and values are not the same length`) - } - w.print("{") - split := len(d.Keys) > 3 - keyIndent := indent - if split { - keyIndent += 1 - } - for i, _ := range d.Keys { - if split { - w.print("\n") - w.printIndent(keyIndent) - } - w.printNode(d.Keys[i], keyIndent) - w.print(": ") - w.printNode(d.Values[i], keyIndent) - if i != len(d.Keys)-1 || split { - if split { - w.print(",") - } else { - w.print(", ") - } - } - } - if split { - w.print("\n") - w.printIndent(indent) - } - w.print("}") -} - -func (w *writer) printFor(n *ast.For, indent int32) { - w.print("for ") - w.printNode(n.Target, indent) - w.print(" in ") - w.printNode(n.Iter, indent) - w.print(":\n") - for i, node := range n.Body { - w.printIndent(indent + 1) - w.printNode(node, indent+1) - if i != len(n.Body)-1 { - w.print("\n") - } - } -} - -func (w *writer) printIf(i *ast.If, indent int32) { - w.print("if ") - w.printNode(i.Test, indent) - w.print(":\n") - for j, node := range i.Body { - w.printIndent(indent + 1) - w.printNode(node, indent+1) - if j != len(i.Body)-1 { - w.print("\n") - } - } -} - -func (w *writer) printFunctionDef(fd *ast.FunctionDef, indent int32) { - w.print("def ") - w.print(fd.Name) - w.print("(") - if fd.Args != nil { - for i, arg := range fd.Args.Args { - w.printArg(arg, indent) - if i != len(fd.Args.Args)-1 { - w.print(", ") - } - } - if len(fd.Args.KwOnlyArgs) > 0 { - w.print(", *, ") - for i, arg := range fd.Args.KwOnlyArgs { - w.printArg(arg, indent) - if i != len(fd.Args.KwOnlyArgs)-1 { - w.print(", ") - } - } - } - } - w.print(")") - if fd.Returns != nil { - w.print(" -> ") - w.printNode(fd.Returns, indent) - } - w.print(":\n") - for i, node := range fd.Body { - w.printIndent(indent + 1) - w.printNode(node, indent+1) - if i != len(fd.Body)-1 { - w.print("\n") - } - } -} - -func (w *writer) printImport(imp *ast.Import, indent int32) { - w.print("import ") - for i, node := range imp.Names { - w.printNode(node, indent) - if i != len(imp.Names)-1 { - w.print(", ") - } - } - w.print("\n") -} - -func (w *writer) printImportFrom(imp *ast.ImportFrom, indent int32) { - w.print("from ") - w.print(imp.Module) - w.print(" import ") - for i, node := range imp.Names { - w.printNode(node, indent) - if i != len(imp.Names)-1 { - w.print(", ") - } - } - w.print("\n") -} - -func (w *writer) printImportGroup(n *ast.ImportGroup, indent int32) { - if len(n.Imports) == 0 { - return - } - for _, node := range n.Imports { - w.printNode(node, indent) - } - w.print("\n") -} - -func (w *writer) printIs(i *ast.Is, indent int32) { - w.print("is") -} -func (w *writer) printKeyword(k *ast.Keyword, indent int32) { - w.print(k.Arg) - w.print("=") - w.printNode(k.Value, indent) -} - -func (w *writer) printModule(mod *ast.Module, indent int32) { - for i, node := range mod.Body { - prevIsImport := false - if i > 0 { - _, isImport := mod.Body[i-1].Node.(*ast.Node_ImportGroup) - prevIsImport = isImport - } - _, isClassDef := node.Node.(*ast.Node_ClassDef) - _, isAssign := node.Node.(*ast.Node_Assign) - if isClassDef || isAssign { - if prevIsImport { - w.print("\n") - } else { - w.print("\n\n") - } - } - w.printNode(node, indent) - if isAssign { - w.print("\n") - } - } -} - -func (w *writer) printName(n *ast.Name, indent int32) { - w.print(n.Id) -} - -func (w *writer) printReturn(r *ast.Return, indent int32) { - w.print("return ") - w.printNode(r.Value, indent) -} - -func (w *writer) printSubscript(ss *ast.Subscript, indent int32) { - w.printName(ss.Value, indent) - w.print("[") - w.printNode(ss.Slice, indent) - w.print("]") - -} - -func (w *writer) printYield(n *ast.Yield, indent int32) { - w.print("yield ") - w.printNode(n.Value, indent) -} diff --git a/internal/python/printer/printer_test.go b/internal/python/printer/printer_test.go deleted file mode 100644 index 41615926ef..0000000000 --- a/internal/python/printer/printer_test.go +++ /dev/null @@ -1,200 +0,0 @@ -package printer - -import ( - "strings" - "testing" - - "github.com/google/go-cmp/cmp" - - "github.com/kyleconroy/sqlc/internal/python/ast" -) - -type testcase struct { - Node *ast.Node - Expected string -} - -func TestPrinter(t *testing.T) { - for name, tc := range map[string]testcase{ - "assign": { - Node: &ast.Node{ - Node: &ast.Node_Assign{ - Assign: &ast.Assign{ - Targets: []*ast.Node{ - { - Node: &ast.Node_Name{ - Name: &ast.Name{Id: "FICTION"}, - }, - }, - }, - Value: &ast.Node{ - Node: &ast.Node_Constant{ - Constant: &ast.Constant{ - Value: &ast.Constant_Str{ - Str: "FICTION", - }, - }, - }, - }, - }, - }, - }, - Expected: `FICTION = "FICTION"`, - }, - "class-base": { - Node: &ast.Node{ - Node: &ast.Node_ClassDef{ - ClassDef: &ast.ClassDef{ - Name: "Foo", - Bases: []*ast.Node{ - { - Node: &ast.Node_Name{ - Name: &ast.Name{Id: "str"}, - }, - }, - { - Node: &ast.Node_Attribute{ - Attribute: &ast.Attribute{ - Value: &ast.Node{ - Node: &ast.Node_Name{ - Name: &ast.Name{Id: "enum"}, - }, - }, - Attr: "Enum", - }, - }, - }, - }, - }, - }, - }, - Expected: `class Foo(str, enum.Enum):`, - }, - "dataclass": { - Node: &ast.Node{ - Node: &ast.Node_ClassDef{ - ClassDef: &ast.ClassDef{ - Name: "Foo", - DecoratorList: []*ast.Node{ - { - Node: &ast.Node_Name{ - Name: &ast.Name{ - Id: "dataclass", - }, - }, - }, - }, - Body: []*ast.Node{ - { - Node: &ast.Node_AnnAssign{ - AnnAssign: &ast.AnnAssign{ - Target: &ast.Name{Id: "bar"}, - Annotation: &ast.Node{ - Node: &ast.Node_Name{ - Name: &ast.Name{Id: "int"}, - }, - }, - }, - }, - }, - { - Node: &ast.Node_AnnAssign{ - AnnAssign: &ast.AnnAssign{ - Target: &ast.Name{Id: "bat"}, - Annotation: &ast.Node{ - Node: &ast.Node_Subscript{ - Subscript: &ast.Subscript{ - Value: &ast.Name{Id: "Optional"}, - Slice: &ast.Node{ - Node: &ast.Node_Name{ - Name: &ast.Name{Id: "int"}, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - Expected: ` -@dataclass -class Foo: - bar: int - bat: Optional[int] -`, - }, - "call": { - Node: &ast.Node{ - Node: &ast.Node_Call{ - Call: &ast.Call{ - Func: &ast.Node{ - Node: &ast.Node_Alias{ - Alias: &ast.Alias{ - Name: "foo", - }, - }, - }, - }, - }, - }, - Expected: `foo()`, - }, - - "import": { - Node: &ast.Node{ - Node: &ast.Node_Import{ - Import: &ast.Import{ - Names: []*ast.Node{ - { - Node: &ast.Node_Alias{ - Alias: &ast.Alias{ - Name: "foo", - }, - }, - }, - }, - }, - }, - }, - Expected: `import foo`, - }, - "import-from": { - Node: &ast.Node{ - Node: &ast.Node_ImportFrom{ - ImportFrom: &ast.ImportFrom{ - Module: "pkg", - Names: []*ast.Node{ - { - Node: &ast.Node_Alias{ - Alias: &ast.Alias{ - Name: "foo", - }, - }, - }, - { - Node: &ast.Node_Alias{ - Alias: &ast.Alias{ - Name: "bar", - }, - }, - }, - }, - }, - }, - }, - Expected: `from pkg import foo, bar`, - }, - } { - tc := tc - t.Run(name, func(t *testing.T) { - result := Print(tc.Node, Options{}) - if diff := cmp.Diff(strings.TrimSpace(tc.Expected), strings.TrimSpace(string(result.Python))); diff != "" { - t.Errorf("print mismatch (-want +got):\n%s", diff) - } - }) - } -} diff --git a/protos/plugin/codegen.proto b/protos/plugin/codegen.proto index 4dc784b4b8..2036f1bc4b 100644 --- a/protos/plugin/codegen.proto +++ b/protos/plugin/codegen.proto @@ -11,6 +11,9 @@ message File } message Override { + // PythonType message was field 9 + reserved 9; + // name of the type to use, e.g. `github.com/segmentio/ksuid.KSUID` or `mymodule.Type` string code_type = 1 [json_name="code_type"]; @@ -27,17 +30,9 @@ message Override { string column_name = 8 [json_name="column_name"]; - PythonType python_type = 9; - ParsedGoType go_type = 10; } -message PythonType -{ - string module = 1; - string name = 2; -} - message ParsedGoType { string import_path = 1; @@ -49,8 +44,9 @@ message ParsedGoType message Settings { - // Kotlin settings used to be field 9 - reserved 9; + // PythonCode message was field 8 + // KotlinCode message was field 9 + reserved 8, 9; string version = 1 [json_name="version"]; string engine = 2 [json_name="engine"]; @@ -61,7 +57,6 @@ message Settings Codegen codegen = 12 [json_name="codegen"]; // TODO: Refactor codegen settings - PythonCode python = 8; GoCode go = 10; JSONCode json = 11; } @@ -73,18 +68,6 @@ message Codegen bytes options = 3 [json_name="options"]; } -message PythonCode -{ - bool emit_exact_table_names = 1; - bool emit_sync_querier = 2; - bool emit_async_querier = 3; - string package = 4; - string out = 5; - bool emit_pydantic_models = 6; - optional int32 query_parameter_limit = 7; - repeated string inflection_exclude_table_names = 8; -} - message GoCode { bool emit_interface = 1; diff --git a/protos/python/ast.proto b/protos/python/ast.proto deleted file mode 100644 index cf2357f8b4..0000000000 --- a/protos/python/ast.proto +++ /dev/null @@ -1,242 +0,0 @@ -syntax = "proto3"; - -package python.ast; - -option go_package = "github.com/kyleconroy/sqlc/internal/python/ast"; - -message Node { - oneof node { - ClassDef class_def = 1 [json_name="ClassDef"]; - Import import = 2 [json_name="Import"]; - ImportFrom import_from = 3 [json_name="ImportFrom"]; - Module module = 4 [json_name="Module"]; - Alias alias = 5 [json_name="Alias"]; - AnnAssign ann_assign = 6 [json_name="AnnAssign"]; - Name name = 7 [json_name="Name"]; - Subscript subscript = 8 [json_name="Subscript"]; - Attribute attribute = 9 [json_name="Attribute"]; - Constant constant = 10 [json_name="Constant"]; - Assign assign = 11 [json_name="Assign"]; - Comment comment = 12 [json_name="Comment"]; - Expr expr = 13 [json_name="Expr"]; - Call call = 14 [json_name="Call"]; - FunctionDef function_def = 15 [json_name="FunctionDef"]; - Arg arg = 16 [json_name="Arg"]; - Arguments arguments = 17 [json_name="Arguments"]; - AsyncFunctionDef async_function_def = 18 [json_name="AsyncFunctionDef"]; - Pass pass = 19 [json_name="Pass"]; - Dict dict = 20 [json_name="Dict"]; - If if = 21 [json_name="If"]; - Compare compare = 22 [json_name="Compare"]; - Return return = 23 [json_name="Return"]; - Is is = 24 [json_name="Is"]; - Keyword keyword = 25 [json_name="Keyword"]; - Yield yield = 26 [json_name="Yield"]; - For for = 27 [json_name="For"]; - Await await = 28 [json_name="Await"]; - AsyncFor async_for = 29 [json_name="AsyncFor"]; - ImportGroup import_group = 30 [json_name="ImportGroup"]; - } -} - -message Alias -{ - string name = 1 [json_name="name"]; -} - -message Await -{ - Node value = 1 [json_name="value"]; -} - -message Attribute -{ - Node value = 1 [json_name="value"]; - string attr = 2 [json_name="attr"]; -} - -message AnnAssign -{ - Name target = 1 [json_name="target"]; - Node annotation = 2 [json_name="annotation"]; - int32 simple = 3 [json_name="simple"]; - string Comment = 4 [json_name="comment"]; -} - -message Arg -{ - string arg = 1 [json_name="arg"]; - Node annotation = 2 [json_name="annotation"]; -} - -message Arguments -{ - repeated Arg args = 1 [json_name="args"]; - repeated Arg kw_only_args = 2 [json_name="kwonlyargs"]; -} - -message AsyncFor -{ - Node target = 1 [json_name="target"]; - Node iter = 2 [json_name="iter"]; - repeated Node body = 3 [json_name="body"]; -} - -message AsyncFunctionDef -{ - string name = 1 [json_name="name"]; - Arguments Args = 2 [json_name="args"]; - repeated Node body = 3 [json_name="body"]; - Node returns = 4 [json_name="returns"]; -} - -message Assign -{ - repeated Node targets = 1 [json_name="targets"]; - Node value = 2 [json_name="value"]; - string Comment = 3 [json_name="comment"]; -} - -message Call -{ - Node func = 1 [json_name="func"]; - repeated Node args = 2 [json_name="args"]; - repeated Keyword keywords = 3 [json_name="keywords"]; -} - -message ClassDef -{ - string name = 1 [json_name="name"]; - repeated Node bases = 2 [json_name="bases"]; - repeated Node keywords = 3 [json_name="keywords"]; - repeated Node body = 4 [json_name="body"]; - repeated Node decorator_list = 5 [json_name="decorator_list"]; -} - -// The Python ast module does not parse comments. It's not clear if this is the -// best way to support them in the AST -message Comment -{ - string text = 1 [json_name="text"]; -} - -message Compare -{ - Node left = 1 [json_name="left"]; - repeated Node ops = 2 [json_name="ops"]; - repeated Node comparators = 3 [json_name="comparators"]; -} - -message Constant -{ - oneof value { - string str = 1 [json_name="string"]; - int32 int = 2 [json_name="int"]; - bool none = 3 [json_name="none"]; - } -} - -message Dict -{ - repeated Node keys = 1 [json_name="keys"]; - repeated Node values = 2 [json_name="values"]; -} - -message Expr -{ - Node value = 1 [json_name="value"]; -} - -message For -{ - Node target = 1 [json_name="target"]; - Node iter = 2 [json_name="iter"]; - repeated Node body = 3 [json_name="body"]; -} - -message FunctionDef -{ - string name = 1 [json_name="name"]; - Arguments Args = 2 [json_name="args"]; - repeated Node body = 3 [json_name="body"]; - Node returns = 4 [json_name="returns"]; -} - -message If -{ - Node test = 1 [json_name="test"]; - repeated Node body = 2 [json_name="body"]; - repeated Node or_else = 3 [json_name="orelse"]; -} - -message Import -{ - repeated Node names = 1 [json_name="names"]; -} - -message ImportFrom -{ - string module = 1 [json_name="module"]; - repeated Node names = 2 [json_name="names"]; - int32 level = 3 [json_name="level"]; -} - -// Imports are always put at the top of the file, just after any module -// comments and docstrings, and before module globals and constants. -// -// Imports should be grouped in the following order: -// -// Standard library imports. -// Related third party imports. -// Local application/library specific imports. -// -// You should put a blank line between each group of imports. -// -// https://www.python.org/dev/peps/pep-0008/#imports -message ImportGroup -{ - repeated Node imports = 1 [json_name="imports"]; -} - -message Is -{ -} - -message Keyword -{ - string arg = 1 [json_name="arg"]; - Node value = 2 [json_name="value"]; -} - -message Module -{ - repeated Node body = 1 [json_name="body"]; -} - -message Name -{ - string id = 1 [json_name="id"]; -} - -message Pass -{ -} - -message Return -{ - Node value = 1 [json_name="value"]; -} - - -message Subscript -{ - Name value = 1 [json_name="value"]; - Node slice = 2 [json_name="slice"]; -} - -message Yield -{ - Node value = 1 [json_name="value"]; -} - -