From 71ae360259a107ea9669c76686b881c434d9616e Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Thu, 28 Apr 2022 20:17:52 -0700 Subject: [PATCH 1/8] feat: Add support for generic process plugins --- internal/config/config.go | 210 +++++++---------------------- internal/config/convert/convert.go | 60 +++++++++ internal/config/override.go | 155 +++++++++++++++++++++ internal/config/v_two.go | 33 ++++- 4 files changed, 293 insertions(+), 165 deletions(-) create mode 100644 internal/config/convert/convert.go create mode 100644 internal/config/override.go diff --git a/internal/config/config.go b/internal/config/config.go index 35350ba562..47f0437e8f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -6,13 +6,10 @@ import ( "errors" "fmt" "io" - "os" - "strings" - - "github.com/kyleconroy/sqlc/internal/pattern" - "github.com/kyleconroy/sqlc/internal/sql/ast" yaml "gopkg.in/yaml.v3" + + "github.com/kyleconroy/sqlc/internal/config/convert" ) const errMessageNoVersion = `The configuration file must have a version number. @@ -78,16 +75,27 @@ const ( ) type Config struct { - Version string `json:"version" yaml:"version"` - Project Project `json:"project" yaml:"project"` - SQL []SQL `json:"sql" yaml:"sql"` - Gen Gen `json:"overrides,omitempty" yaml:"overrides"` + Version string `json:"version" yaml:"version"` + Project Project `json:"project" yaml:"project"` + SQL []SQL `json:"sql" yaml:"sql"` + Gen Gen `json:"overrides,omitempty" yaml:"overrides"` + Plugins []Plugin `json:"plugins" yaml:"plugins"` } type Project struct { ID string `json:"id" yaml:"id"` } +type Plugin struct { + Name string `json:"name" yaml:"name"` + Process *struct { + Cmd string `json:"cmd" yaml:"cmd"` + } `json:"process" yaml:"process"` + WASM *struct { + URL string `json:"url" yaml:"url"` + } `json:"wasm" yaml:"wasm"` +} + type Gen struct { Go *GenGo `json:"go,omitempty" yaml:"go"` Kotlin *GenKotlin `json:"kotlin,omitempty" yaml:"kotlin"` @@ -103,11 +111,18 @@ type GenKotlin struct { } type SQL struct { - Engine Engine `json:"engine,omitempty" yaml:"engine"` - Schema Paths `json:"schema" yaml:"schema"` - Queries Paths `json:"queries" yaml:"queries"` - StrictFunctionChecks bool `json:"strict_function_checks" yaml:"strict_function_checks"` - Gen SQLGen `json:"gen" yaml:"gen"` + Engine Engine `json:"engine,omitempty" yaml:"engine"` + Schema Paths `json:"schema" yaml:"schema"` + Queries Paths `json:"queries" yaml:"queries"` + StrictFunctionChecks bool `json:"strict_function_checks" yaml:"strict_function_checks"` + Gen SQLGen `json:"gen" yaml:"gen"` + Codegen []Codegen `json:"codegen" yaml:"codegen"` +} + +type Codegen struct { + Out string `json:"out" yaml:"out"` + Plugin string `json:"plugin" yaml:"plugin"` + Options yaml.Node `json:"options" yaml:"options"` } type SQLGen struct { @@ -163,160 +178,22 @@ type SQLJSON struct { Indent string `json:"indent,omitempty" yaml:"indent"` } -type Override struct { - // name of the golang type to use, e.g. `github.com/segmentio/ksuid.KSUID` - GoType GoType `json:"go_type" yaml:"go_type"` - - // 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"` - - // for global overrides only when two different engines are in use - Engine Engine `json:"engine,omitempty" yaml:"engine"` - - // True if the GoType should override if the maching postgres type is nullable - Nullable bool `json:"nullable" yaml:"nullable"` - // Deprecated. Use the `nullable` property instead - Deprecated_Null bool `json:"null" yaml:"null"` - - // fully qualified name of the column, e.g. `accounts.id` - Column string `json:"column" yaml:"column"` - - ColumnName *pattern.Match - TableCatalog *pattern.Match - TableSchema *pattern.Match - TableRel *pattern.Match - GoImportPath string - GoPackage string - GoTypeName string - GoBasicType bool -} - -func (o *Override) Matches(n *ast.TableName, defaultSchema string) bool { - if n == nil { - return false - } - - schema := n.Schema - if n.Schema == "" { - schema = defaultSchema - } - - if o.TableCatalog != nil && !o.TableCatalog.MatchString(n.Catalog) { - return false - } - - if o.TableSchema == nil && schema != "" { - return false - } - - if o.TableSchema != nil && !o.TableSchema.MatchString(schema) { - return false - } - - if o.TableRel == nil && n.Name != "" { - return false - } - - if o.TableRel != nil && !o.TableRel.MatchString(n.Name) { - return false - } - - return true -} - -func (o *Override) Parse() (err error) { - - // validate deprecated postgres_type field - if o.Deprecated_PostgresType != "" { - fmt.Fprintf(os.Stderr, "WARNING: \"postgres_type\" is deprecated. Instead, use \"db_type\" to specify a type override.\n") - if o.DBType != "" { - return fmt.Errorf(`Type override configurations cannot have "db_type" and "postres_type" together. Use "db_type" alone`) - } - o.DBType = o.Deprecated_PostgresType - } - - // validate deprecated null field - if o.Deprecated_Null { - fmt.Fprintf(os.Stderr, "WARNING: \"null\" is deprecated. Instead, use the \"nullable\" field.\n") - o.Nullable = true - } - - // validate option combinations - switch { - case o.Column != "" && o.DBType != "": - return fmt.Errorf("Override specifying both `column` (%q) and `db_type` (%q) is not valid.", o.Column, o.DBType) - case o.Column == "" && o.DBType == "": - return fmt.Errorf("Override must specify one of either `column` or `db_type`") - } - - // validate Column - if o.Column != "" { - colParts := strings.Split(o.Column, ".") - switch len(colParts) { - case 2: - if o.ColumnName, err = pattern.MatchCompile(colParts[1]); err != nil { - return err - } - if o.TableRel, err = pattern.MatchCompile(colParts[0]); err != nil { - return err - } - if o.TableSchema, err = pattern.MatchCompile("public"); err != nil { - return err - } - case 3: - if o.ColumnName, err = pattern.MatchCompile(colParts[2]); err != nil { - return err - } - if o.TableRel, err = pattern.MatchCompile(colParts[1]); err != nil { - return err - } - if o.TableSchema, err = pattern.MatchCompile(colParts[0]); err != nil { - return err - } - case 4: - if o.ColumnName, err = pattern.MatchCompile(colParts[3]); err != nil { - return err - } - if o.TableRel, err = pattern.MatchCompile(colParts[2]); err != nil { - return err - } - if o.TableSchema, err = pattern.MatchCompile(colParts[1]); err != nil { - return err - } - if o.TableCatalog, err = pattern.MatchCompile(colParts[0]); err != nil { - return err - } - default: - return fmt.Errorf("Override `column` specifier %q is not the proper format, expected '[catalog.][schema.]tablename.colname'", o.Column) - } - } - - // validate GoType - parsed, err := o.GoType.Parse() - if err != nil { - return err - } - o.GoImportPath = parsed.ImportPath - o.GoPackage = parsed.Package - o.GoTypeName = parsed.TypeName - o.GoBasicType = parsed.BasicType - - return nil -} - -var ErrMissingVersion = errors.New("no version number") -var ErrUnknownVersion = errors.New("invalid version number") var ErrMissingEngine = errors.New("unknown engine") -var ErrUnknownEngine = errors.New("invalid engine") -var ErrNoPackages = errors.New("no packages") +var ErrMissingVersion = errors.New("no version number") +var ErrNoOutPath = errors.New("no output path") var ErrNoPackageName = errors.New("missing package name") var ErrNoPackagePath = errors.New("missing package path") -var ErrNoOutPath = errors.New("no output path") +var ErrNoPackages = errors.New("no packages") var ErrNoQuerierType = errors.New("no querier emit type enabled") +var ErrUnknownEngine = errors.New("invalid engine") +var ErrUnknownVersion = errors.New("invalid version number") + +var ErrPluginBuiltin = errors.New("a built-in plugin with that name already exists") +var ErrPluginNoName = errors.New("missing plugin name") +var ErrPluginExists = errors.New("a plugin with that name already exists") +var ErrPluginNoType = errors.New("plugin: field `process` or `wasm` required") +var ErrPluginBothTypes = errors.New("plugin: both `process` and `wasm` cannot both be defined") +var ErrPluginProcessNoCmd = errors.New("plugin: missing process command") func ParseConfig(rd io.Reader) (Config, error) { var buf bytes.Buffer @@ -370,6 +247,11 @@ func Combine(conf Config, pkg SQL) CombinedSettings { Global: conf, Package: pkg, } + + for i, cg := range pkg.Codegen { + fmt.Printf("%d: %s\n", i, convert.YAMLtoJSON(cg.Options)) + } + if conf.Gen.Go != nil { cs.Rename = conf.Gen.Go.Rename cs.Overrides = append(cs.Overrides, conf.Gen.Go.Overrides...) diff --git a/internal/config/convert/convert.go b/internal/config/convert/convert.go new file mode 100644 index 0000000000..8814d729e1 --- /dev/null +++ b/internal/config/convert/convert.go @@ -0,0 +1,60 @@ +package convert + +import ( + "encoding/json" + "strconv" + + "gopkg.in/yaml.v3" +) + +func gen(n *yaml.Node) interface{} { + switch n.Kind { + + case yaml.MappingNode: + nn := map[string]interface{}{} + for i, _ := range n.Content { + if i%2 == 0 { + k := n.Content[i] + nn[k.Value] = gen(n.Content[i+1]) + } + } + return nn + + case yaml.SequenceNode: + nn := []interface{}{} + for i, _ := range n.Content { + nn = append(nn, gen(n.Content[i])) + } + return nn + + case yaml.ScalarNode: + switch n.Tag { + + case "!!bool": + return n.Value == "true" + + case "!!int": + i, err := strconv.Atoi(n.Value) + if err != nil { + panic(err) + } + return i + + default: + return n.Value + + } + + default: + return "" + + } +} + +func YAMLtoJSON(n yaml.Node) []byte { + blob, err := json.Marshal(gen(&n)) + if err != nil { + panic(err) + } + return blob +} diff --git a/internal/config/override.go b/internal/config/override.go new file mode 100644 index 0000000000..35aa38e7cb --- /dev/null +++ b/internal/config/override.go @@ -0,0 +1,155 @@ +package config + +import ( + "fmt" + "os" + "strings" + + "github.com/kyleconroy/sqlc/internal/pattern" + "github.com/kyleconroy/sqlc/internal/sql/ast" +) + +type Override struct { + // name of the golang type to use, e.g. `github.com/segmentio/ksuid.KSUID` + GoType GoType `json:"go_type" yaml:"go_type"` + + // 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"` + + // for global overrides only when two different engines are in use + Engine Engine `json:"engine,omitempty" yaml:"engine"` + + // True if the GoType should override if the maching postgres type is nullable + Nullable bool `json:"nullable" yaml:"nullable"` + // Deprecated. Use the `nullable` property instead + Deprecated_Null bool `json:"null" yaml:"null"` + + // fully qualified name of the column, e.g. `accounts.id` + Column string `json:"column" yaml:"column"` + + ColumnName *pattern.Match + TableCatalog *pattern.Match + TableSchema *pattern.Match + TableRel *pattern.Match + GoImportPath string + GoPackage string + GoTypeName string + GoBasicType bool +} + +func (o *Override) Matches(n *ast.TableName, defaultSchema string) bool { + if n == nil { + return false + } + + schema := n.Schema + if n.Schema == "" { + schema = defaultSchema + } + + if o.TableCatalog != nil && !o.TableCatalog.MatchString(n.Catalog) { + return false + } + + if o.TableSchema == nil && schema != "" { + return false + } + + if o.TableSchema != nil && !o.TableSchema.MatchString(schema) { + return false + } + + if o.TableRel == nil && n.Name != "" { + return false + } + + if o.TableRel != nil && !o.TableRel.MatchString(n.Name) { + return false + } + + return true +} + +func (o *Override) Parse() (err error) { + + // validate deprecated postgres_type field + if o.Deprecated_PostgresType != "" { + fmt.Fprintf(os.Stderr, "WARNING: \"postgres_type\" is deprecated. Instead, use \"db_type\" to specify a type override.\n") + if o.DBType != "" { + return fmt.Errorf(`Type override configurations cannot have "db_type" and "postres_type" together. Use "db_type" alone`) + } + o.DBType = o.Deprecated_PostgresType + } + + // validate deprecated null field + if o.Deprecated_Null { + fmt.Fprintf(os.Stderr, "WARNING: \"null\" is deprecated. Instead, use the \"nullable\" field.\n") + o.Nullable = true + } + + // validate option combinations + switch { + case o.Column != "" && o.DBType != "": + return fmt.Errorf("Override specifying both `column` (%q) and `db_type` (%q) is not valid.", o.Column, o.DBType) + case o.Column == "" && o.DBType == "": + return fmt.Errorf("Override must specify one of either `column` or `db_type`") + } + + // validate Column + if o.Column != "" { + colParts := strings.Split(o.Column, ".") + switch len(colParts) { + case 2: + if o.ColumnName, err = pattern.MatchCompile(colParts[1]); err != nil { + return err + } + if o.TableRel, err = pattern.MatchCompile(colParts[0]); err != nil { + return err + } + if o.TableSchema, err = pattern.MatchCompile("public"); err != nil { + return err + } + case 3: + if o.ColumnName, err = pattern.MatchCompile(colParts[2]); err != nil { + return err + } + if o.TableRel, err = pattern.MatchCompile(colParts[1]); err != nil { + return err + } + if o.TableSchema, err = pattern.MatchCompile(colParts[0]); err != nil { + return err + } + case 4: + if o.ColumnName, err = pattern.MatchCompile(colParts[3]); err != nil { + return err + } + if o.TableRel, err = pattern.MatchCompile(colParts[2]); err != nil { + return err + } + if o.TableSchema, err = pattern.MatchCompile(colParts[1]); err != nil { + return err + } + if o.TableCatalog, err = pattern.MatchCompile(colParts[0]); err != nil { + return err + } + default: + return fmt.Errorf("Override `column` specifier %q is not the proper format, expected '[catalog.][schema.]tablename.colname'", o.Column) + } + } + + // validate GoType + parsed, err := o.GoType.Parse() + if err != nil { + return err + } + o.GoImportPath = parsed.ImportPath + o.GoPackage = parsed.Package + o.GoTypeName = parsed.TypeName + o.GoBasicType = parsed.BasicType + + return nil +} diff --git a/internal/config/v_two.go b/internal/config/v_two.go index 144577dd08..f88c5c3206 100644 --- a/internal/config/v_two.go +++ b/internal/config/v_two.go @@ -10,7 +10,7 @@ import ( func v2ParseConfig(rd io.Reader) (Config, error) { dec := yaml.NewDecoder(rd) - dec.KnownFields(true) + // dec.KnownFields(true) var conf Config if err := dec.Decode(&conf); err != nil { return conf, err @@ -81,6 +81,37 @@ func v2ParseConfig(rd io.Reader) (Config, error) { } } } + // TODO: Store built-in plugins somewhere else + builtins := map[string]struct{}{ + "go": struct{}{}, + "json": struct{}{}, + "kotlin": struct{}{}, + "python": struct{}{}, + } + seen := map[string]struct{}{} + for i := range conf.Plugins { + if conf.Plugins[i].Name == "" { + return conf, ErrPluginNoName + } + if _, ok := builtins[conf.Plugins[i].Name]; ok { + return conf, ErrPluginBuiltin + } + if _, ok := seen[conf.Plugins[i].Name]; ok { + return conf, ErrPluginExists + } + if conf.Plugins[i].Process == nil && conf.Plugins[i].WASM == nil { + return conf, ErrPluginNoType + } + if conf.Plugins[i].Process != nil && conf.Plugins[i].WASM != nil { + return conf, ErrPluginBothTypes + } + if conf.Plugins[i].Process != nil { + if conf.Plugins[i].Process.Cmd == "" { + return conf, ErrPluginProcessNoCmd + } + } + seen[conf.Plugins[i].Name] = struct{}{} + } return conf, nil } From bae83b6fa9cf2f53400dddcef280de69da003502 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Fri, 29 Apr 2022 22:02:39 -0700 Subject: [PATCH 2/8] It works! --- cmd/sqlc-gen-json/main.go | 45 ++ internal/cmd/generate.go | 42 +- internal/cmd/shim.go | 19 +- internal/codegen/json/gen.go | 42 +- internal/codegen/process/gen.go | 75 ++++ internal/config/config.go | 17 +- internal/config/convert/convert.go | 55 ++- internal/config/v_two.go | 70 +-- .../{codegen_request.json => codegen.json} | 8 +- .../endtoend/testdata/codegen_json/sqlc.json | 3 +- internal/plugin/codegen.pb.go | 415 +++++++++++++----- internal/plugin/codegen_vtproto.pb.go | 320 ++++++++++++++ protos/plugin/codegen.proto | 9 + 13 files changed, 944 insertions(+), 176 deletions(-) create mode 100644 cmd/sqlc-gen-json/main.go create mode 100644 internal/codegen/process/gen.go rename internal/endtoend/testdata/codegen_json/gen/{codegen_request.json => codegen.json} (98%) diff --git a/cmd/sqlc-gen-json/main.go b/cmd/sqlc-gen-json/main.go new file mode 100644 index 0000000000..6e776290db --- /dev/null +++ b/cmd/sqlc-gen-json/main.go @@ -0,0 +1,45 @@ +package main + +import ( + "bufio" + "fmt" + "io" + "os" + + "github.com/kyleconroy/sqlc/internal/codegen/json" + "github.com/kyleconroy/sqlc/internal/plugin" +) + +func main() { + if err := run(); err != nil { + fmt.Fprintf(os.Stderr, "error generating JSON: %s", err) + os.Exit(2) + } +} + +func run() error { + var req plugin.CodeGenRequest + reqBlob, err := io.ReadAll(os.Stdin) + if err != nil { + return err + } + if err := req.UnmarshalVT(reqBlob); err != nil { + return err + } + resp, err := json.Generate(&req) + if err != nil { + return err + } + respBlob, err := resp.MarshalVT() + if err != nil { + return err + } + w := bufio.NewWriter(os.Stdout) + if _, err := w.Write(respBlob); err != nil { + return err + } + if err := w.Flush(); err != nil { + return err + } + return nil +} diff --git a/internal/cmd/generate.go b/internal/cmd/generate.go index cea706d5d9..d28971eacb 100644 --- a/internal/cmd/generate.go +++ b/internal/cmd/generate.go @@ -14,6 +14,7 @@ import ( "github.com/kyleconroy/sqlc/internal/codegen/golang" "github.com/kyleconroy/sqlc/internal/codegen/json" "github.com/kyleconroy/sqlc/internal/codegen/kotlin" + "github.com/kyleconroy/sqlc/internal/codegen/process" "github.com/kyleconroy/sqlc/internal/codegen/python" "github.com/kyleconroy/sqlc/internal/compiler" "github.com/kyleconroy/sqlc/internal/config" @@ -44,7 +45,9 @@ func printFileErr(stderr io.Writer, dir string, fileErr *multierr.FileError) { } type outPair struct { - Gen config.SQLGen + Gen config.SQLGen + Plugin *config.Codegen + config.SQL } @@ -145,10 +148,19 @@ func Generate(ctx context.Context, e Env, dir, filename string, stderr io.Writer Gen: config.SQLGen{JSON: sql.Gen.JSON}, }) } + for i, _ := range sql.Codegen { + pairs = append(pairs, outPair{ + SQL: sql, + Plugin: &sql.Codegen[i], + }) + } } for _, sql := range pairs { combo := config.Combine(*conf, sql.SQL) + if sql.Plugin != nil { + combo.Codegen = *sql.Plugin + } // TODO: This feels like a hack that will bite us later joined := make([]string, 0, len(sql.Schema)) @@ -167,24 +179,32 @@ func Generate(ctx context.Context, e Env, dir, filename string, stderr io.Writer parseOpts := opts.Parser{ Debug: debug.Debug, } - if sql.Gen.Go != nil { + + switch { + case sql.Gen.Go != nil: name = combo.Go.Package lang = "golang" - } else if sql.Gen.Kotlin != nil { + + case sql.Gen.Kotlin != nil: if sql.Engine == config.EnginePostgreSQL { parseOpts.UsePositionalParameters = true } lang = "kotlin" name = combo.Kotlin.Package - } else if sql.Gen.Python != nil { + + 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 } var packageRegion *trace.Region if debug.Traced { packageRegion = trace.StartRegion(ctx, "package") - trace.Logf(ctx, "", "name=%s dir=%s language=%s", name, dir, lang) + trace.Logf(ctx, "", "name=%s dir=%s plugin=%s", name, dir, lang) } result, failed := parse(ctx, e, name, dir, sql.SQL, combo, parseOpts, stderr) @@ -206,15 +226,27 @@ func Generate(ctx context.Context, e Env, dir, filename string, stderr io.Writer case sql.Gen.Go != nil: out = combo.Go.Out genfunc = golang.Generate + case sql.Gen.Kotlin != nil: out = combo.Kotlin.Out genfunc = kotlin.Generate + case sql.Gen.Python != nil: out = combo.Python.Out genfunc = python.Generate + case sql.Gen.JSON != nil: out = combo.JSON.Out genfunc = json.Generate + + case sql.Plugin != nil: + out = sql.Plugin.Out + runner := process.Runner{ + Config: combo.Global, + Plugin: sql.Plugin.Plugin, + } + genfunc = runner.Generate + default: panic("missing language backend") } diff --git a/internal/cmd/shim.go b/internal/cmd/shim.go index 946e6d338c..d217b992d4 100644 --- a/internal/cmd/shim.go +++ b/internal/cmd/shim.go @@ -5,6 +5,7 @@ import ( "github.com/kyleconroy/sqlc/internal/compiler" "github.com/kyleconroy/sqlc/internal/config" + "github.com/kyleconroy/sqlc/internal/config/convert" "github.com/kyleconroy/sqlc/internal/info" "github.com/kyleconroy/sqlc/internal/plugin" "github.com/kyleconroy/sqlc/internal/sql/catalog" @@ -56,6 +57,7 @@ func pluginSettings(cs config.CombinedSettings) *plugin.Settings { Queries: []string(cs.Package.Queries), Overrides: over, Rename: cs.Rename, + Codegen: pluginCodegen(cs.Codegen), Python: pluginPythonCode(cs.Python), Kotlin: pluginKotlinCode(cs.Kotlin), Go: pluginGoCode(cs.Go), @@ -63,6 +65,18 @@ func pluginSettings(cs config.CombinedSettings) *plugin.Settings { } } +func pluginCodegen(s config.Codegen) *plugin.Codegen { + opts, err := convert.YAMLtoJSON(s.Options) + if err != nil { + panic(err) + } + return &plugin.Codegen{ + Out: s.Out, + Plugin: s.Plugin, + Options: opts, + } +} + func pluginPythonCode(s config.SQLPython) *plugin.PythonCode { return &plugin.PythonCode{ Out: s.Out, @@ -129,8 +143,9 @@ func pluginKotlinCode(s config.SQLKotlin) *plugin.KotlinCode { func pluginJSONCode(s config.SQLJSON) *plugin.JSONCode { return &plugin.JSONCode{ - Out: s.Out, - Indent: s.Indent, + Out: s.Out, + Indent: s.Indent, + Filename: s.Filename, } } diff --git a/internal/codegen/json/gen.go b/internal/codegen/json/gen.go index 6e11ef0a07..c862909535 100644 --- a/internal/codegen/json/gen.go +++ b/internal/codegen/json/gen.go @@ -1,18 +1,52 @@ package json import ( + "bytes" ejson "encoding/json" + "fmt" "google.golang.org/protobuf/encoding/protojson" "github.com/kyleconroy/sqlc/internal/plugin" ) +func parseOptions(req *plugin.CodeGenRequest) (plugin.JSONCode, error) { + if req.Settings == nil { + return plugin.JSONCode{}, nil + } + if req.Settings.Codegen != nil { + if len(req.Settings.Codegen.Options) != 0 { + var options plugin.JSONCode + dec := ejson.NewDecoder(bytes.NewReader(req.Settings.Codegen.Options)) + dec.DisallowUnknownFields() + if err := dec.Decode(&options); err != nil { + return options, fmt.Errorf("unmarshalling options: %s", err) + } + return options, nil + } + } + if req.Settings.Json != nil { + return *req.Settings.Json, nil + } + return plugin.JSONCode{}, nil +} + func Generate(req *plugin.CodeGenRequest) (*plugin.CodeGenResponse, error) { - indent := "" - if req.Settings != nil && req.Settings.Json != nil { - indent = req.Settings.Json.Indent + options, err := parseOptions(req) + if err != nil { + return nil, err + } + + indent := " " + if options.Indent != "" { + indent = options.Indent } + + filename := "codegen_request.json" + if options.Filename != "" { + filename = options.Filename + } + // The output of protojson has randomized whitespace // https://github.com/golang/protobuf/issues/1082 m := &protojson.MarshalOptions{ @@ -32,7 +66,7 @@ func Generate(req *plugin.CodeGenRequest) (*plugin.CodeGenResponse, error) { return &plugin.CodeGenResponse{ Files: []*plugin.File{ { - Name: "codegen_request.json", + Name: filename, Contents: append(blob, '\n'), }, }, diff --git a/internal/codegen/process/gen.go b/internal/codegen/process/gen.go new file mode 100644 index 0000000000..0e3a20d615 --- /dev/null +++ b/internal/codegen/process/gen.go @@ -0,0 +1,75 @@ +package process + +import ( + "bytes" + "context" + "errors" + "fmt" + "os/exec" + + "google.golang.org/protobuf/proto" + + "github.com/kyleconroy/sqlc/internal/config" + "github.com/kyleconroy/sqlc/internal/plugin" +) + +type Runner struct { + Config config.Config + Plugin string +} + +func (r Runner) pluginCmd() (string, error) { + for _, plug := range r.Config.Plugins { + if plug.Name != r.Plugin { + continue + } + if plug.Process == nil { + continue + } + return plug.Process.Cmd, nil + } + return "", fmt.Errorf("plugin not found") +} + +// TODO: Update the gen func signature to take a ctx +func (r Runner) Generate(req *plugin.CodeGenRequest) (*plugin.CodeGenResponse, error) { + stdin, err := proto.Marshal(req) + if err != nil { + return nil, fmt.Errorf("failed to encode codegen request: %s", err) + } + + name, err := r.pluginCmd() + if err != nil { + return nil, fmt.Errorf("process: unknown plugin %s", r.Plugin) + } + + // Check if the output plugin exists + path, err := exec.LookPath(name) + if err != nil { + return nil, fmt.Errorf("process: %s not found", name) + } + + ctx := context.Background() + cmd := exec.CommandContext(ctx, path) + cmd.Stdin = bytes.NewReader(stdin) + cmd.Env = []string{ + "SQLC_VERSION=foo", + } + + out, err := cmd.Output() + if err != nil { + stderr := err.Error() + var exit *exec.ExitError + if errors.As(err, &exit) { + stderr = string(exit.Stderr) + } + return nil, fmt.Errorf("process: error running command %s", stderr) + } + + var resp plugin.CodeGenResponse + if err := proto.Unmarshal(out, &resp); err != nil { + return nil, fmt.Errorf("process: failed to read codegen resp: %s", err) + } + + return &resp, nil +} diff --git a/internal/config/config.go b/internal/config/config.go index 47f0437e8f..f12df00685 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -8,8 +8,6 @@ import ( "io" yaml "gopkg.in/yaml.v3" - - "github.com/kyleconroy/sqlc/internal/config/convert" ) const errMessageNoVersion = `The configuration file must have a version number. @@ -119,6 +117,7 @@ type SQL struct { Codegen []Codegen `json:"codegen" yaml:"codegen"` } +// TODO: Figure out a better name for this type Codegen struct { Out string `json:"out" yaml:"out"` Plugin string `json:"plugin" yaml:"plugin"` @@ -174,8 +173,9 @@ type SQLPython struct { } type SQLJSON struct { - Out string `json:"out" yaml:"out"` - Indent string `json:"indent,omitempty" yaml:"indent"` + Out string `json:"out" yaml:"out"` + Indent string `json:"indent,omitempty" yaml:"indent"` + Filename string `json:"filename,omitempty" yaml:"filename"` } var ErrMissingEngine = errors.New("unknown engine") @@ -191,6 +191,7 @@ var ErrUnknownVersion = errors.New("invalid version number") var ErrPluginBuiltin = errors.New("a built-in plugin with that name already exists") var ErrPluginNoName = errors.New("missing plugin name") var ErrPluginExists = errors.New("a plugin with that name already exists") +var ErrPluginNotFound = errors.New("no plugin found") var ErrPluginNoType = errors.New("plugin: field `process` or `wasm` required") var ErrPluginBothTypes = errors.New("plugin: both `process` and `wasm` cannot both be defined") var ErrPluginProcessNoCmd = errors.New("plugin: missing process command") @@ -240,6 +241,9 @@ type CombinedSettings struct { JSON SQLJSON Rename map[string]string Overrides []Override + + // TODO: Combine these into a more usable type + Codegen Codegen } func Combine(conf Config, pkg SQL) CombinedSettings { @@ -247,11 +251,6 @@ func Combine(conf Config, pkg SQL) CombinedSettings { Global: conf, Package: pkg, } - - for i, cg := range pkg.Codegen { - fmt.Printf("%d: %s\n", i, convert.YAMLtoJSON(cg.Options)) - } - if conf.Gen.Go != nil { cs.Rename = conf.Gen.Go.Rename cs.Overrides = append(cs.Overrides, conf.Gen.Go.Overrides...) diff --git a/internal/config/convert/convert.go b/internal/config/convert/convert.go index 8814d729e1..555b0f027c 100644 --- a/internal/config/convert/convert.go +++ b/internal/config/convert/convert.go @@ -2,12 +2,13 @@ package convert import ( "encoding/json" + "fmt" "strconv" "gopkg.in/yaml.v3" ) -func gen(n *yaml.Node) interface{} { +func gen(n *yaml.Node) (interface{}, error) { switch n.Kind { case yaml.MappingNode: @@ -15,46 +16,66 @@ func gen(n *yaml.Node) interface{} { for i, _ := range n.Content { if i%2 == 0 { k := n.Content[i] - nn[k.Value] = gen(n.Content[i+1]) + v, err := gen(n.Content[i+1]) + if err != nil { + return nil, err + } + nn[k.Value] = v } } - return nn + return nn, nil case yaml.SequenceNode: nn := []interface{}{} for i, _ := range n.Content { - nn = append(nn, gen(n.Content[i])) + v, err := gen(n.Content[i]) + if err != nil { + return nil, err + } + nn = append(nn, v) } - return nn + return nn, nil case yaml.ScalarNode: switch n.Tag { case "!!bool": - return n.Value == "true" + return strconv.ParseBool(n.Value) + + case "!!float": + return strconv.ParseFloat(n.Value, 64) case "!!int": - i, err := strconv.Atoi(n.Value) - if err != nil { - panic(err) - } - return i + return strconv.Atoi(n.Value) + + case "!!null": + return nil, nil + + case "!!str": + return n.Value, nil default: - return n.Value + return n.Value, nil } default: - return "" + return nil, fmt.Errorf("unknown yaml value: %s (%s)", n.Value, n.Tag) } } -func YAMLtoJSON(n yaml.Node) []byte { - blob, err := json.Marshal(gen(&n)) +func YAMLtoJSON(n yaml.Node) ([]byte, error) { + if n.Kind == 0 { + return []byte{}, nil + } + iface, err := gen(&n) + if err != nil { + return nil, err + } + blob, err := json.Marshal(iface) if err != nil { - panic(err) + return nil, err } - return blob + return blob, nil } diff --git a/internal/config/v_two.go b/internal/config/v_two.go index f88c5c3206..94ec4ee6c7 100644 --- a/internal/config/v_two.go +++ b/internal/config/v_two.go @@ -34,6 +34,37 @@ func v2ParseConfig(rd io.Reader) (Config, error) { } } } + // TODO: Store built-in plugins somewhere else + builtins := map[string]struct{}{ + "go": struct{}{}, + "json": struct{}{}, + "kotlin": struct{}{}, + "python": struct{}{}, + } + plugins := map[string]struct{}{} + for i := range conf.Plugins { + if conf.Plugins[i].Name == "" { + return conf, ErrPluginNoName + } + if _, ok := builtins[conf.Plugins[i].Name]; ok { + return conf, ErrPluginBuiltin + } + if _, ok := plugins[conf.Plugins[i].Name]; ok { + return conf, ErrPluginExists + } + if conf.Plugins[i].Process == nil && conf.Plugins[i].WASM == nil { + return conf, ErrPluginNoType + } + if conf.Plugins[i].Process != nil && conf.Plugins[i].WASM != nil { + return conf, ErrPluginBothTypes + } + if conf.Plugins[i].Process != nil { + if conf.Plugins[i].Process.Cmd == "" { + return conf, ErrPluginProcessNoCmd + } + } + plugins[conf.Plugins[i].Name] = struct{}{} + } for j := range conf.SQL { if conf.SQL[j].Engine == "" { return conf, ErrMissingEngine @@ -80,37 +111,18 @@ func v2ParseConfig(rd io.Reader) (Config, error) { return conf, ErrNoOutPath } } - } - // TODO: Store built-in plugins somewhere else - builtins := map[string]struct{}{ - "go": struct{}{}, - "json": struct{}{}, - "kotlin": struct{}{}, - "python": struct{}{}, - } - seen := map[string]struct{}{} - for i := range conf.Plugins { - if conf.Plugins[i].Name == "" { - return conf, ErrPluginNoName - } - if _, ok := builtins[conf.Plugins[i].Name]; ok { - return conf, ErrPluginBuiltin - } - if _, ok := seen[conf.Plugins[i].Name]; ok { - return conf, ErrPluginExists - } - if conf.Plugins[i].Process == nil && conf.Plugins[i].WASM == nil { - return conf, ErrPluginNoType - } - if conf.Plugins[i].Process != nil && conf.Plugins[i].WASM != nil { - return conf, ErrPluginBothTypes - } - if conf.Plugins[i].Process != nil { - if conf.Plugins[i].Process.Cmd == "" { - return conf, ErrPluginProcessNoCmd + for _, cg := range conf.SQL[j].Codegen { + if cg.Plugin == "" { + return conf, ErrPluginNoName + } + if cg.Out == "" { + return conf, ErrNoOutPath + } + // TOOD: Allow the use of built-in codegen from here + if _, ok := plugins[cg.Plugin]; !ok { + return conf, ErrPluginNotFound } } - seen[conf.Plugins[i].Name] = struct{}{} } return conf, nil } diff --git a/internal/endtoend/testdata/codegen_json/gen/codegen_request.json b/internal/endtoend/testdata/codegen_json/gen/codegen.json similarity index 98% rename from internal/endtoend/testdata/codegen_json/gen/codegen_request.json rename to internal/endtoend/testdata/codegen_json/gen/codegen.json index 36239b3913..1aefd1c866 100644 --- a/internal/endtoend/testdata/codegen_json/gen/codegen_request.json +++ b/internal/endtoend/testdata/codegen_json/gen/codegen.json @@ -10,6 +10,11 @@ ], "rename": {}, "overrides": [], + "codegen": { + "out": "", + "plugin": "", + "options": "" + }, "python": { "emit_exact_table_names": false, "emit_sync_querier": false, @@ -47,7 +52,8 @@ }, "json": { "out": "gen", - "indent": " " + "indent": " ", + "filename": "codegen.json" } }, "catalog": { diff --git a/internal/endtoend/testdata/codegen_json/sqlc.json b/internal/endtoend/testdata/codegen_json/sqlc.json index 70c16d69b4..cbbf97440c 100644 --- a/internal/endtoend/testdata/codegen_json/sqlc.json +++ b/internal/endtoend/testdata/codegen_json/sqlc.json @@ -8,7 +8,8 @@ "gen": { "json": { "out": "gen", - "indent": " " + "indent": " ", + "filename": "codegen.json" } } } diff --git a/internal/plugin/codegen.pb.go b/internal/plugin/codegen.pb.go index e28a4e90b9..83212db824 100644 --- a/internal/plugin/codegen.pb.go +++ b/internal/plugin/codegen.pb.go @@ -319,6 +319,7 @@ type Settings struct { Queries []string `protobuf:"bytes,4,rep,name=queries,proto3" json:"queries,omitempty"` Rename map[string]string `protobuf:"bytes,5,rep,name=rename,proto3" json:"rename,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 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"` Kotlin *KotlinCode `protobuf:"bytes,9,opt,name=kotlin,proto3" json:"kotlin,omitempty"` @@ -400,6 +401,13 @@ func (x *Settings) GetOverrides() []*Override { return nil } +func (x *Settings) GetCodegen() *Codegen { + if x != nil { + return x.Codegen + } + return nil +} + func (x *Settings) GetPython() *PythonCode { if x != nil { return x.Python @@ -428,6 +436,69 @@ func (x *Settings) GetJson() *JSONCode { return nil } +type Codegen struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Out string `protobuf:"bytes,1,opt,name=out,proto3" json:"out,omitempty"` + Plugin string `protobuf:"bytes,2,opt,name=plugin,proto3" json:"plugin,omitempty"` + Options []byte `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"` +} + +func (x *Codegen) Reset() { + *x = Codegen{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_codegen_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Codegen) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Codegen) ProtoMessage() {} + +func (x *Codegen) ProtoReflect() protoreflect.Message { + mi := &file_plugin_codegen_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Codegen.ProtoReflect.Descriptor instead. +func (*Codegen) Descriptor() ([]byte, []int) { + return file_plugin_codegen_proto_rawDescGZIP(), []int{5} +} + +func (x *Codegen) GetOut() string { + if x != nil { + return x.Out + } + return "" +} + +func (x *Codegen) GetPlugin() string { + if x != nil { + return x.Plugin + } + return "" +} + +func (x *Codegen) GetOptions() []byte { + if x != nil { + return x.Options + } + return nil +} + type PythonCode struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -444,7 +515,7 @@ type PythonCode struct { func (x *PythonCode) Reset() { *x = PythonCode{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[5] + mi := &file_plugin_codegen_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -457,7 +528,7 @@ func (x *PythonCode) String() string { func (*PythonCode) ProtoMessage() {} func (x *PythonCode) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[5] + mi := &file_plugin_codegen_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -470,7 +541,7 @@ func (x *PythonCode) ProtoReflect() protoreflect.Message { // Deprecated: Use PythonCode.ProtoReflect.Descriptor instead. func (*PythonCode) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{5} + return file_plugin_codegen_proto_rawDescGZIP(), []int{6} } func (x *PythonCode) GetEmitExactTableNames() bool { @@ -528,7 +599,7 @@ type KotlinCode struct { func (x *KotlinCode) Reset() { *x = KotlinCode{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[6] + mi := &file_plugin_codegen_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -541,7 +612,7 @@ func (x *KotlinCode) String() string { func (*KotlinCode) ProtoMessage() {} func (x *KotlinCode) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[6] + mi := &file_plugin_codegen_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -554,7 +625,7 @@ func (x *KotlinCode) ProtoReflect() protoreflect.Message { // Deprecated: Use KotlinCode.ProtoReflect.Descriptor instead. func (*KotlinCode) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{6} + return file_plugin_codegen_proto_rawDescGZIP(), []int{7} } func (x *KotlinCode) GetEmitExactTableNames() bool { @@ -608,7 +679,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[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -621,7 +692,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[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -634,7 +705,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{8} } func (x *GoCode) GetEmitInterface() bool { @@ -782,14 +853,15 @@ type JSONCode struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Out string `protobuf:"bytes,1,opt,name=out,proto3" json:"out,omitempty"` - Indent string `protobuf:"bytes,2,opt,name=indent,proto3" json:"indent,omitempty"` + Out string `protobuf:"bytes,1,opt,name=out,proto3" json:"out,omitempty"` + Indent string `protobuf:"bytes,2,opt,name=indent,proto3" json:"indent,omitempty"` + Filename string `protobuf:"bytes,3,opt,name=filename,proto3" json:"filename,omitempty"` } func (x *JSONCode) Reset() { *x = JSONCode{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[8] + mi := &file_plugin_codegen_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -802,7 +874,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[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -815,7 +887,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{9} } func (x *JSONCode) GetOut() string { @@ -832,6 +904,13 @@ func (x *JSONCode) GetIndent() string { return "" } +func (x *JSONCode) GetFilename() string { + if x != nil { + return x.Filename + } + return "" +} + type Catalog struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -846,7 +925,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[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -859,7 +938,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[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -872,7 +951,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{10} } func (x *Catalog) GetComment() string { @@ -918,7 +997,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[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -931,7 +1010,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[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -944,7 +1023,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{11} } func (x *Schema) GetComment() string { @@ -994,7 +1073,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[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1007,7 +1086,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[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1020,7 +1099,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{12} } func (x *CompositeType) GetName() string { @@ -1050,7 +1129,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[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1063,7 +1142,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[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1076,7 +1155,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{13} } func (x *Enum) GetName() string { @@ -1113,7 +1192,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[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1126,7 +1205,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[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1139,7 +1218,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{14} } func (x *Table) GetRel() *Identifier { @@ -1176,7 +1255,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[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1189,7 +1268,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[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1202,7 +1281,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{15} } func (x *Identifier) GetCatalog() string { @@ -1248,7 +1327,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[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1261,7 +1340,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[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1274,7 +1353,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{16} } func (x *Column) GetName() string { @@ -1372,7 +1451,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[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1385,7 +1464,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[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1398,7 +1477,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{17} } func (x *Query) GetText() string { @@ -1469,7 +1548,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[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1482,7 +1561,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[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1495,7 +1574,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{18} } func (x *Parameter) GetNumber() int32 { @@ -1526,7 +1605,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[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1539,7 +1618,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[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1552,7 +1631,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{19} } func (x *CodeGenRequest) GetSettings() *Settings { @@ -1594,7 +1673,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[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1607,7 +1686,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[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1620,7 +1699,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{20} } func (x *CodeGenResponse) GetFiles() []*File { @@ -1669,7 +1748,7 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 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, 0x22, 0xad, 0x03, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x18, + 0x65, 0x22, 0xd8, 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, @@ -1682,6 +1761,7 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 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, +<<<<<<< HEAD 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x70, 0x79, @@ -1730,9 +1810,35 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 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, +======= + 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, + 0x2a, 0x0a, 0x06, 0x6b, 0x6f, 0x74, 0x6c, 0x69, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x4b, 0x6f, 0x74, 0x6c, 0x69, 0x6e, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x06, 0x6b, 0x6f, 0x74, 0x6c, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x02, 0x67, + 0x6f, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x47, 0x6f, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x02, 0x67, 0x6f, 0x12, 0x24, 0x0a, 0x04, 0x6a, + 0x73, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6a, 0x73, 0x6f, + 0x6e, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4d, 0x0a, 0x07, + 0x43, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x75, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xf9, 0x01, 0x0a, 0x0a, + 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x16, 0x65, 0x6d, +>>>>>>> e2440d6 (It works!) 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, + 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6d, 0x69, 0x74, 0x45, 0x78, 0x61, 0x63, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, +<<<<<<< HEAD 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, @@ -1782,6 +1888,85 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 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, 0x22, 0x88, 0x01, 0x0a, 0x07, 0x43, 0x61, 0x74, +======= + 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, 0x22, 0x6d, 0x0a, 0x0a, 0x4b, 0x6f, 0x74, 0x6c, 0x69, + 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x16, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x65, 0x78, + 0x61, 0x63, 0x74, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6d, 0x69, 0x74, 0x45, 0x78, 0x61, 0x63, 0x74, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x22, 0xcd, 0x06, 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, 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, +>>>>>>> e2440d6 (It works!) 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, @@ -1900,61 +2085,63 @@ func file_plugin_codegen_proto_rawDescGZIP() []byte { return file_plugin_codegen_proto_rawDescData } -var file_plugin_codegen_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_plugin_codegen_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_plugin_codegen_proto_goTypes = []interface{}{ (*File)(nil), // 0: plugin.File (*Override)(nil), // 1: plugin.Override (*PythonType)(nil), // 2: plugin.PythonType (*ParsedGoType)(nil), // 3: plugin.ParsedGoType (*Settings)(nil), // 4: plugin.Settings - (*PythonCode)(nil), // 5: plugin.PythonCode - (*KotlinCode)(nil), // 6: plugin.KotlinCode - (*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.Settings.RenameEntry + (*Codegen)(nil), // 5: plugin.Codegen + (*PythonCode)(nil), // 6: plugin.PythonCode + (*KotlinCode)(nil), // 7: plugin.KotlinCode + (*GoCode)(nil), // 8: plugin.GoCode + (*JSONCode)(nil), // 9: plugin.JSONCode + (*Catalog)(nil), // 10: plugin.Catalog + (*Schema)(nil), // 11: plugin.Schema + (*CompositeType)(nil), // 12: plugin.CompositeType + (*Enum)(nil), // 13: plugin.Enum + (*Table)(nil), // 14: plugin.Table + (*Identifier)(nil), // 15: plugin.Identifier + (*Column)(nil), // 16: plugin.Column + (*Query)(nil), // 17: plugin.Query + (*Parameter)(nil), // 18: plugin.Parameter + (*CodeGenRequest)(nil), // 19: plugin.CodeGenRequest + (*CodeGenResponse)(nil), // 20: plugin.CodeGenResponse + nil, // 21: plugin.Settings.RenameEntry } var file_plugin_codegen_proto_depIdxs = []int32{ - 14, // 0: plugin.Override.table:type_name -> plugin.Identifier + 15, // 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.Settings.rename:type_name -> plugin.Settings.RenameEntry + 21, // 3: plugin.Settings.rename:type_name -> plugin.Settings.RenameEntry 1, // 4: plugin.Settings.overrides:type_name -> plugin.Override - 5, // 5: plugin.Settings.python:type_name -> plugin.PythonCode - 6, // 6: plugin.Settings.kotlin:type_name -> plugin.KotlinCode - 7, // 7: plugin.Settings.go:type_name -> plugin.GoCode - 8, // 8: plugin.Settings.json:type_name -> plugin.JSONCode - 10, // 9: plugin.Catalog.schemas:type_name -> plugin.Schema - 13, // 10: plugin.Schema.tables:type_name -> plugin.Table - 12, // 11: plugin.Schema.enums:type_name -> plugin.Enum - 11, // 12: plugin.Schema.composite_types:type_name -> plugin.CompositeType - 14, // 13: plugin.Table.rel:type_name -> plugin.Identifier - 15, // 14: plugin.Table.columns:type_name -> plugin.Column - 14, // 15: plugin.Column.table:type_name -> plugin.Identifier - 14, // 16: plugin.Column.type:type_name -> plugin.Identifier - 15, // 17: plugin.Query.columns:type_name -> plugin.Column - 17, // 18: plugin.Query.params:type_name -> plugin.Parameter - 14, // 19: plugin.Query.insert_into_table:type_name -> plugin.Identifier - 15, // 20: plugin.Parameter.column:type_name -> plugin.Column - 4, // 21: plugin.CodeGenRequest.settings:type_name -> plugin.Settings - 9, // 22: plugin.CodeGenRequest.catalog:type_name -> plugin.Catalog - 16, // 23: plugin.CodeGenRequest.queries:type_name -> plugin.Query - 0, // 24: plugin.CodeGenResponse.files:type_name -> plugin.File - 25, // [25:25] is the sub-list for method output_type - 25, // [25:25] is the sub-list for method input_type - 25, // [25:25] is the sub-list for extension type_name - 25, // [25:25] is the sub-list for extension extendee - 0, // [0:25] is the sub-list for field type_name + 5, // 5: plugin.Settings.codegen:type_name -> plugin.Codegen + 6, // 6: plugin.Settings.python:type_name -> plugin.PythonCode + 7, // 7: plugin.Settings.kotlin:type_name -> plugin.KotlinCode + 8, // 8: plugin.Settings.go:type_name -> plugin.GoCode + 9, // 9: plugin.Settings.json:type_name -> plugin.JSONCode + 11, // 10: plugin.Catalog.schemas:type_name -> plugin.Schema + 14, // 11: plugin.Schema.tables:type_name -> plugin.Table + 13, // 12: plugin.Schema.enums:type_name -> plugin.Enum + 12, // 13: plugin.Schema.composite_types:type_name -> plugin.CompositeType + 15, // 14: plugin.Table.rel:type_name -> plugin.Identifier + 16, // 15: plugin.Table.columns:type_name -> plugin.Column + 15, // 16: plugin.Column.table:type_name -> plugin.Identifier + 15, // 17: plugin.Column.type:type_name -> plugin.Identifier + 16, // 18: plugin.Query.columns:type_name -> plugin.Column + 18, // 19: plugin.Query.params:type_name -> plugin.Parameter + 15, // 20: plugin.Query.insert_into_table:type_name -> plugin.Identifier + 16, // 21: plugin.Parameter.column:type_name -> plugin.Column + 4, // 22: plugin.CodeGenRequest.settings:type_name -> plugin.Settings + 10, // 23: plugin.CodeGenRequest.catalog:type_name -> plugin.Catalog + 17, // 24: plugin.CodeGenRequest.queries:type_name -> plugin.Query + 0, // 25: plugin.CodeGenResponse.files:type_name -> plugin.File + 26, // [26:26] is the sub-list for method output_type + 26, // [26:26] is the sub-list for method input_type + 26, // [26:26] is the sub-list for extension type_name + 26, // [26:26] is the sub-list for extension extendee + 0, // [0:26] is the sub-list for field type_name } func init() { file_plugin_codegen_proto_init() } @@ -2024,7 +2211,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PythonCode); i { + switch v := v.(*Codegen); i { case 0: return &v.state case 1: @@ -2036,7 +2223,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KotlinCode); i { + switch v := v.(*PythonCode); i { case 0: return &v.state case 1: @@ -2048,7 +2235,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GoCode); i { + switch v := v.(*KotlinCode); i { case 0: return &v.state case 1: @@ -2060,7 +2247,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JSONCode); i { + switch v := v.(*GoCode); i { case 0: return &v.state case 1: @@ -2072,7 +2259,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Catalog); i { + switch v := v.(*JSONCode); i { case 0: return &v.state case 1: @@ -2084,7 +2271,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Schema); i { + switch v := v.(*Catalog); i { case 0: return &v.state case 1: @@ -2096,7 +2283,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CompositeType); i { + switch v := v.(*Schema); i { case 0: return &v.state case 1: @@ -2108,7 +2295,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Enum); i { + switch v := v.(*CompositeType); i { case 0: return &v.state case 1: @@ -2120,7 +2307,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Table); i { + switch v := v.(*Enum); i { case 0: return &v.state case 1: @@ -2132,7 +2319,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Identifier); i { + switch v := v.(*Table); i { case 0: return &v.state case 1: @@ -2144,7 +2331,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Column); i { + switch v := v.(*Identifier); i { case 0: return &v.state case 1: @@ -2156,7 +2343,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Query); i { + switch v := v.(*Column); i { case 0: return &v.state case 1: @@ -2168,7 +2355,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Parameter); i { + switch v := v.(*Query); i { case 0: return &v.state case 1: @@ -2180,7 +2367,7 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CodeGenRequest); i { + switch v := v.(*Parameter); i { case 0: return &v.state case 1: @@ -2192,6 +2379,18 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CodeGenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_codegen_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CodeGenResponse); i { case 0: return &v.state @@ -2210,7 +2409,7 @@ func file_plugin_codegen_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_plugin_codegen_proto_rawDesc, NumEnums: 0, - NumMessages: 21, + NumMessages: 22, NumExtensions: 0, NumServices: 0, }, diff --git a/internal/plugin/codegen_vtproto.pb.go b/internal/plugin/codegen_vtproto.pb.go index 0b70319cb4..5bd75542e1 100644 --- a/internal/plugin/codegen_vtproto.pb.go +++ b/internal/plugin/codegen_vtproto.pb.go @@ -307,6 +307,16 @@ func (m *Settings) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.Codegen != nil { + size, err := m.Codegen.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x62 + } if m.Json != nil { size, err := m.Json.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -413,6 +423,60 @@ func (m *Settings) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Codegen) 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 *Codegen) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Codegen) 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.Options) > 0 { + i -= len(m.Options) + copy(dAtA[i:], m.Options) + i = encodeVarint(dAtA, i, uint64(len(m.Options))) + i-- + dAtA[i] = 0x1a + } + if len(m.Plugin) > 0 { + i -= len(m.Plugin) + copy(dAtA[i:], m.Plugin) + i = encodeVarint(dAtA, i, uint64(len(m.Plugin))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + func (m *PythonCode) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -806,6 +870,13 @@ func (m *JSONCode) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Filename) > 0 { + i -= len(m.Filename) + copy(dAtA[i:], m.Filename) + i = encodeVarint(dAtA, i, uint64(len(m.Filename))) + i-- + dAtA[i] = 0x1a + } if len(m.Indent) > 0 { i -= len(m.Indent) copy(dAtA[i:], m.Indent) @@ -1763,6 +1834,34 @@ func (m *Settings) SizeVT() (n int) { l = m.Json.SizeVT() n += 1 + l + sov(uint64(l)) } + if m.Codegen != nil { + l = m.Codegen.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.unknownFields != nil { + n += len(m.unknownFields) + } + return n +} + +func (m *Codegen) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Out) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Plugin) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Options) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } if m.unknownFields != nil { n += len(m.unknownFields) } @@ -1918,6 +2017,10 @@ func (m *JSONCode) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } + l = len(m.Filename) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } if m.unknownFields != nil { n += len(m.unknownFields) } @@ -3430,6 +3533,191 @@ func (m *Settings) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Codegen", 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.Codegen == nil { + m.Codegen = &Codegen{} + } + if err := m.Codegen.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 *Codegen) 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: Codegen: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Codegen: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Plugin", 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.Plugin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Options = append(m.Options[:0], dAtA[iNdEx:postIndex]...) + if m.Options == nil { + m.Options = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -4422,6 +4710,38 @@ func (m *JSONCode) UnmarshalVT(dAtA []byte) error { } m.Indent = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filename", 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.Filename = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) diff --git a/protos/plugin/codegen.proto b/protos/plugin/codegen.proto index 8dc6360399..eded105a4a 100644 --- a/protos/plugin/codegen.proto +++ b/protos/plugin/codegen.proto @@ -54,6 +54,7 @@ message Settings repeated string queries = 4 [json_name="queries"]; map rename = 5 [json_name="rename"]; repeated Override overrides = 6 [json_name="overrides"]; + Codegen codegen = 12 [json_name="codegen"]; // TODO: Refactor codegen settings PythonCode python = 8; @@ -62,6 +63,13 @@ message Settings JSONCode json = 11; } +message Codegen +{ + string out = 1 [json_name="out"]; + string plugin = 2 [json_name="plugin"]; + bytes options = 3 [json_name="options"]; +} + message PythonCode { bool emit_exact_table_names = 1; @@ -107,6 +115,7 @@ message JSONCode { string out = 1; string indent = 2; + string filename = 3; } message Catalog From 19e65c083c692f950ca7cbe2547874943250f623 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Fri, 29 Apr 2022 22:33:01 -0700 Subject: [PATCH 3/8] Fix two small issues --- internal/codegen/process/gen.go | 2 +- internal/config/v_two.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/codegen/process/gen.go b/internal/codegen/process/gen.go index 0e3a20d615..09e68038ef 100644 --- a/internal/codegen/process/gen.go +++ b/internal/codegen/process/gen.go @@ -53,7 +53,7 @@ func (r Runner) Generate(req *plugin.CodeGenRequest) (*plugin.CodeGenResponse, e cmd := exec.CommandContext(ctx, path) cmd.Stdin = bytes.NewReader(stdin) cmd.Env = []string{ - "SQLC_VERSION=foo", + fmt.Sprintf("SQLC_VERSION=%s", req.SqlcVersion), } out, err := cmd.Output() diff --git a/internal/config/v_two.go b/internal/config/v_two.go index 94ec4ee6c7..1cee9b0adf 100644 --- a/internal/config/v_two.go +++ b/internal/config/v_two.go @@ -10,7 +10,7 @@ import ( func v2ParseConfig(rd io.Reader) (Config, error) { dec := yaml.NewDecoder(rd) - // dec.KnownFields(true) + dec.KnownFields(true) var conf Config if err := dec.Decode(&conf); err != nil { return conf, err From 5933a30067e56fdd791b11771b0a67037f5dbf82 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Wed, 4 May 2022 09:20:58 -0700 Subject: [PATCH 4/8] Create a new ext package --- internal/cmd/generate.go | 19 +++++++++---------- internal/ext/handler.go | 21 +++++++++++++++++++++ internal/{codegen => ext}/process/gen.go | 0 3 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 internal/ext/handler.go rename internal/{codegen => ext}/process/gen.go (100%) diff --git a/internal/cmd/generate.go b/internal/cmd/generate.go index d28971eacb..3afd79220f 100644 --- a/internal/cmd/generate.go +++ b/internal/cmd/generate.go @@ -14,14 +14,14 @@ import ( "github.com/kyleconroy/sqlc/internal/codegen/golang" "github.com/kyleconroy/sqlc/internal/codegen/json" "github.com/kyleconroy/sqlc/internal/codegen/kotlin" - "github.com/kyleconroy/sqlc/internal/codegen/process" "github.com/kyleconroy/sqlc/internal/codegen/python" "github.com/kyleconroy/sqlc/internal/compiler" "github.com/kyleconroy/sqlc/internal/config" "github.com/kyleconroy/sqlc/internal/debug" + "github.com/kyleconroy/sqlc/internal/ext" + "github.com/kyleconroy/sqlc/internal/ext/process" "github.com/kyleconroy/sqlc/internal/multierr" "github.com/kyleconroy/sqlc/internal/opts" - "github.com/kyleconroy/sqlc/internal/plugin" ) const errMessageNoVersion = `The configuration file must have a version number. @@ -220,37 +220,36 @@ func Generate(ctx context.Context, e Env, dir, filename string, stderr io.Writer if debug.Traced { region = trace.StartRegion(ctx, "codegen") } - var genfunc func(req *plugin.CodeGenRequest) (*plugin.CodeGenResponse, error) + var handler ext.Handler var out string switch { case sql.Gen.Go != nil: out = combo.Go.Out - genfunc = golang.Generate + handler = ext.HandleFunc(golang.Generate) case sql.Gen.Kotlin != nil: out = combo.Kotlin.Out - genfunc = kotlin.Generate + handler = ext.HandleFunc(kotlin.Generate) case sql.Gen.Python != nil: out = combo.Python.Out - genfunc = python.Generate + handler = ext.HandleFunc(python.Generate) case sql.Gen.JSON != nil: out = combo.JSON.Out - genfunc = json.Generate + handler = ext.HandleFunc(json.Generate) case sql.Plugin != nil: out = sql.Plugin.Out - runner := process.Runner{ + handler = &process.Runner{ Config: combo.Global, Plugin: sql.Plugin.Plugin, } - genfunc = runner.Generate default: panic("missing language backend") } - resp, err := genfunc(codeGenRequest(result, combo)) + resp, err := handler.Generate(codeGenRequest(result, combo)) if region != nil { region.End() } diff --git a/internal/ext/handler.go b/internal/ext/handler.go new file mode 100644 index 0000000000..a65f7d0398 --- /dev/null +++ b/internal/ext/handler.go @@ -0,0 +1,21 @@ +package ext + +import ( + "github.com/kyleconroy/sqlc/internal/plugin" +) + +type Handler interface { + Generate(*plugin.CodeGenRequest) (*plugin.CodeGenResponse, error) +} + +type wrapper struct { + fn func(*plugin.CodeGenRequest) (*plugin.CodeGenResponse, error) +} + +func (w *wrapper) Generate(req *plugin.CodeGenRequest) (*plugin.CodeGenResponse, error) { + return w.fn(req) +} + +func HandleFunc(fn func(*plugin.CodeGenRequest) (*plugin.CodeGenResponse, error)) Handler { + return &wrapper{fn} +} diff --git a/internal/codegen/process/gen.go b/internal/ext/process/gen.go similarity index 100% rename from internal/codegen/process/gen.go rename to internal/ext/process/gen.go From 5d42beb706f87421e7409a121ef09b4796be039a Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Thu, 12 May 2022 00:34:47 -0700 Subject: [PATCH 5/8] Add end-to-end test for process plugins --- .github/workflows/ci.yml | 3 + Makefile | 3 + .../endtoend/sqlc-gen-json/gen/codegen.json | 497 ++++++++++++++++++ internal/endtoend/sqlc-gen-json/query.sql | 19 + internal/endtoend/sqlc-gen-json/schema.sql | 5 + internal/endtoend/sqlc-gen-json/sqlc.json | 28 + 6 files changed, 555 insertions(+) create mode 100644 internal/endtoend/sqlc-gen-json/gen/codegen.json create mode 100644 internal/endtoend/sqlc-gen-json/query.sql create mode 100644 internal/endtoend/sqlc-gen-json/schema.sql create mode 100644 internal/endtoend/sqlc-gen-json/sqlc.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index faae3e0256..d8ebb843d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,9 @@ jobs: with: go-version: '1.18' + - name: install ./... + run: go install ./... + - name: test ./... run: go test --tags=examples ./... env: diff --git a/Makefile b/Makefile index a6f94a1cb6..156245fbd4 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,9 @@ build: go build ./... +install: + go install ./... + test: go test ./... diff --git a/internal/endtoend/sqlc-gen-json/gen/codegen.json b/internal/endtoend/sqlc-gen-json/gen/codegen.json new file mode 100644 index 0000000000..6cad7d2c2a --- /dev/null +++ b/internal/endtoend/sqlc-gen-json/gen/codegen.json @@ -0,0 +1,497 @@ +{ + "settings": { + "version": "2", + "engine": "postgresql", + "schema": [ + "../authors/postgresql/schema.sql" + ], + "queries": [ + "../authors/postgresql/query.sql" + ], + "rename": {}, + "overrides": [], + "codegen": { + "out": "gen", + "plugin": "jsonb", + "options": "eyJmaWxlbmFtZSI6ImNvZGVnZW4uanNvbiIsImluZGVudCI6IiAgICAifQ==" + }, + "python": { + "emit_exact_table_names": false, + "emit_sync_querier": true, + "emit_async_querier": true, + "package": "authors", + "out": "src/authors", + "emit_pydantic_models": false + }, + "kotlin": { + "emit_exact_table_names": false, + "package": "", + "out": "" + }, + "go": { + "emit_interface": false, + "emit_json_tags": false, + "emit_db_tags": false, + "emit_prepared_queries": false, + "emit_exact_table_names": false, + "emit_empty_slices": false, + "emit_exported_queries": false, + "emit_result_struct_pointers": false, + "emit_params_struct_pointers": false, + "emit_methods_with_db_argument": false, + "json_tags_case_style": "", + "package": "", + "out": "", + "sql_package": "", + "output_db_file_name": "", + "output_models_file_name": "", + "output_querier_file_name": "", + "output_files_suffix": "" + }, + "json": { + "out": "", + "indent": "", + "filename": "" + } + }, + "catalog": { + "comment": "", + "default_schema": "public", + "name": "", + "schemas": [ + { + "comment": "", + "name": "public", + "tables": [ + { + "rel": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "columns": [ + { + "name": "id", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "bigserial" + } + }, + { + "name": "name", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + }, + { + "name": "bio", + "not_null": false, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + } + ], + "comment": "" + } + ], + "enums": [], + "composite_types": [] + }, + { + "comment": "", + "name": "pg_temp", + "tables": [], + "enums": [], + "composite_types": [] + }, + { + "comment": "", + "name": "pg_catalog", + "tables": [], + "enums": [], + "composite_types": [] + } + ] + }, + "queries": [ + { + "text": "SELECT id, name, bio FROM authors\nWHERE id = $1 LIMIT 1", + "name": "GetAuthor", + "cmd": ":one", + "columns": [ + { + "name": "id", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "bigserial" + } + }, + { + "name": "name", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + }, + { + "name": "bio", + "not_null": false, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + } + ], + "params": [ + { + "number": 1, + "column": { + "name": "id", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "bigserial" + } + } + } + ], + "comments": [], + "filename": "query.sql", + "insert_into_table": null + }, + { + "text": "SELECT id, name, bio FROM authors\nORDER BY name", + "name": "ListAuthors", + "cmd": ":many", + "columns": [ + { + "name": "id", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "bigserial" + } + }, + { + "name": "name", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + }, + { + "name": "bio", + "not_null": false, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + } + ], + "params": [], + "comments": [], + "filename": "query.sql", + "insert_into_table": null + }, + { + "text": "INSERT INTO authors (\n name, bio\n) VALUES (\n $1, $2\n)\nRETURNING id, name, bio", + "name": "CreateAuthor", + "cmd": ":one", + "columns": [ + { + "name": "id", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "bigserial" + } + }, + { + "name": "name", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + }, + { + "name": "bio", + "not_null": false, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + } + ], + "params": [ + { + "number": 1, + "column": { + "name": "name", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "public", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + } + }, + { + "number": 2, + "column": { + "name": "bio", + "not_null": false, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "public", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + } + } + ], + "comments": [], + "filename": "query.sql", + "insert_into_table": { + "catalog": "", + "schema": "", + "name": "authors" + } + }, + { + "text": "DELETE FROM authors\nWHERE id = $1", + "name": "DeleteAuthor", + "cmd": ":exec", + "columns": [], + "params": [ + { + "number": 1, + "column": { + "name": "id", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "bigserial" + } + } + } + ], + "comments": [], + "filename": "query.sql", + "insert_into_table": null + } + ], + "sqlc_version": "v1.13.0" +} diff --git a/internal/endtoend/sqlc-gen-json/query.sql b/internal/endtoend/sqlc-gen-json/query.sql new file mode 100644 index 0000000000..75e38b2caf --- /dev/null +++ b/internal/endtoend/sqlc-gen-json/query.sql @@ -0,0 +1,19 @@ +-- 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/sqlc-gen-json/schema.sql b/internal/endtoend/sqlc-gen-json/schema.sql new file mode 100644 index 0000000000..b4fad78497 --- /dev/null +++ b/internal/endtoend/sqlc-gen-json/schema.sql @@ -0,0 +1,5 @@ +CREATE TABLE authors ( + id BIGSERIAL PRIMARY KEY, + name text NOT NULL, + bio text +); diff --git a/internal/endtoend/sqlc-gen-json/sqlc.json b/internal/endtoend/sqlc-gen-json/sqlc.json new file mode 100644 index 0000000000..f47189143a --- /dev/null +++ b/internal/endtoend/sqlc-gen-json/sqlc.json @@ -0,0 +1,28 @@ +{ + "version": "2", + "sql": [ + { + "schema": "schema.sql", + "queries": "query.sql", + "engine": "postgresql", + "codegen": [ + { + "out": "gen", + "plugin": "jsonb", + "options": { + "indent": " ", + "filename": "codegen.json" + } + } + ] + } + ], + "plugins": [ + { + "name": "jsonb", + "process": { + "cmd": "sqlc-gen-json" + } + } + ] +} From 68a6cf5c924ccf66d2a3d3d029eade85da19070b Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Wed, 1 Jun 2022 21:22:23 -0700 Subject: [PATCH 6/8] Put test data in the correct spot --- .../endtoend/sqlc-gen-json/gen/codegen.json | 497 ------------------ .../gen/codegen.json | 497 ++++++++++++++++++ .../process_plugin_sqlc_gen_json}/query.sql | 0 .../process_plugin_sqlc_gen_json}/schema.sql | 0 .../process_plugin_sqlc_gen_json}/sqlc.json | 0 5 files changed, 497 insertions(+), 497 deletions(-) delete mode 100644 internal/endtoend/sqlc-gen-json/gen/codegen.json create mode 100644 internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json rename internal/endtoend/{sqlc-gen-json => testdata/process_plugin_sqlc_gen_json}/query.sql (100%) rename internal/endtoend/{sqlc-gen-json => testdata/process_plugin_sqlc_gen_json}/schema.sql (100%) rename internal/endtoend/{sqlc-gen-json => testdata/process_plugin_sqlc_gen_json}/sqlc.json (100%) diff --git a/internal/endtoend/sqlc-gen-json/gen/codegen.json b/internal/endtoend/sqlc-gen-json/gen/codegen.json deleted file mode 100644 index 6cad7d2c2a..0000000000 --- a/internal/endtoend/sqlc-gen-json/gen/codegen.json +++ /dev/null @@ -1,497 +0,0 @@ -{ - "settings": { - "version": "2", - "engine": "postgresql", - "schema": [ - "../authors/postgresql/schema.sql" - ], - "queries": [ - "../authors/postgresql/query.sql" - ], - "rename": {}, - "overrides": [], - "codegen": { - "out": "gen", - "plugin": "jsonb", - "options": "eyJmaWxlbmFtZSI6ImNvZGVnZW4uanNvbiIsImluZGVudCI6IiAgICAifQ==" - }, - "python": { - "emit_exact_table_names": false, - "emit_sync_querier": true, - "emit_async_querier": true, - "package": "authors", - "out": "src/authors", - "emit_pydantic_models": false - }, - "kotlin": { - "emit_exact_table_names": false, - "package": "", - "out": "" - }, - "go": { - "emit_interface": false, - "emit_json_tags": false, - "emit_db_tags": false, - "emit_prepared_queries": false, - "emit_exact_table_names": false, - "emit_empty_slices": false, - "emit_exported_queries": false, - "emit_result_struct_pointers": false, - "emit_params_struct_pointers": false, - "emit_methods_with_db_argument": false, - "json_tags_case_style": "", - "package": "", - "out": "", - "sql_package": "", - "output_db_file_name": "", - "output_models_file_name": "", - "output_querier_file_name": "", - "output_files_suffix": "" - }, - "json": { - "out": "", - "indent": "", - "filename": "" - } - }, - "catalog": { - "comment": "", - "default_schema": "public", - "name": "", - "schemas": [ - { - "comment": "", - "name": "public", - "tables": [ - { - "rel": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "columns": [ - { - "name": "id", - "not_null": true, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "bigserial" - } - }, - { - "name": "name", - "not_null": true, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "text" - } - }, - { - "name": "bio", - "not_null": false, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "text" - } - } - ], - "comment": "" - } - ], - "enums": [], - "composite_types": [] - }, - { - "comment": "", - "name": "pg_temp", - "tables": [], - "enums": [], - "composite_types": [] - }, - { - "comment": "", - "name": "pg_catalog", - "tables": [], - "enums": [], - "composite_types": [] - } - ] - }, - "queries": [ - { - "text": "SELECT id, name, bio FROM authors\nWHERE id = $1 LIMIT 1", - "name": "GetAuthor", - "cmd": ":one", - "columns": [ - { - "name": "id", - "not_null": true, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "bigserial" - } - }, - { - "name": "name", - "not_null": true, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "text" - } - }, - { - "name": "bio", - "not_null": false, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "text" - } - } - ], - "params": [ - { - "number": 1, - "column": { - "name": "id", - "not_null": true, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "bigserial" - } - } - } - ], - "comments": [], - "filename": "query.sql", - "insert_into_table": null - }, - { - "text": "SELECT id, name, bio FROM authors\nORDER BY name", - "name": "ListAuthors", - "cmd": ":many", - "columns": [ - { - "name": "id", - "not_null": true, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "bigserial" - } - }, - { - "name": "name", - "not_null": true, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "text" - } - }, - { - "name": "bio", - "not_null": false, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "text" - } - } - ], - "params": [], - "comments": [], - "filename": "query.sql", - "insert_into_table": null - }, - { - "text": "INSERT INTO authors (\n name, bio\n) VALUES (\n $1, $2\n)\nRETURNING id, name, bio", - "name": "CreateAuthor", - "cmd": ":one", - "columns": [ - { - "name": "id", - "not_null": true, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "bigserial" - } - }, - { - "name": "name", - "not_null": true, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "text" - } - }, - { - "name": "bio", - "not_null": false, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "text" - } - } - ], - "params": [ - { - "number": 1, - "column": { - "name": "name", - "not_null": true, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "public", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "text" - } - } - }, - { - "number": 2, - "column": { - "name": "bio", - "not_null": false, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "public", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "text" - } - } - } - ], - "comments": [], - "filename": "query.sql", - "insert_into_table": { - "catalog": "", - "schema": "", - "name": "authors" - } - }, - { - "text": "DELETE FROM authors\nWHERE id = $1", - "name": "DeleteAuthor", - "cmd": ":exec", - "columns": [], - "params": [ - { - "number": 1, - "column": { - "name": "id", - "not_null": true, - "is_array": false, - "comment": "", - "length": -1, - "is_named_param": false, - "is_func_call": false, - "scope": "", - "table": { - "catalog": "", - "schema": "", - "name": "authors" - }, - "table_alias": "", - "type": { - "catalog": "", - "schema": "", - "name": "bigserial" - } - } - } - ], - "comments": [], - "filename": "query.sql", - "insert_into_table": null - } - ], - "sqlc_version": "v1.13.0" -} 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 new file mode 100644 index 0000000000..1b627833e4 --- /dev/null +++ b/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json @@ -0,0 +1,497 @@ +{ + "settings": { + "version": "2", + "engine": "postgresql", + "schema": [ + "schema.sql" + ], + "queries": [ + "query.sql" + ], + "rename": {}, + "overrides": [], + "codegen": { + "out": "gen", + "plugin": "jsonb", + "options": "eyJmaWxlbmFtZSI6ImNvZGVnZW4uanNvbiIsImluZGVudCI6IiAgIn0=" + }, + "python": { + "emit_exact_table_names": false, + "emit_sync_querier": false, + "emit_async_querier": false, + "package": "", + "out": "", + "emit_pydantic_models": false + }, + "kotlin": { + "emit_exact_table_names": false, + "package": "", + "out": "" + }, + "go": { + "emit_interface": false, + "emit_json_tags": false, + "emit_db_tags": false, + "emit_prepared_queries": false, + "emit_exact_table_names": false, + "emit_empty_slices": false, + "emit_exported_queries": false, + "emit_result_struct_pointers": false, + "emit_params_struct_pointers": false, + "emit_methods_with_db_argument": false, + "json_tags_case_style": "", + "package": "", + "out": "", + "sql_package": "", + "output_db_file_name": "", + "output_models_file_name": "", + "output_querier_file_name": "", + "output_files_suffix": "" + }, + "json": { + "out": "", + "indent": "", + "filename": "" + } + }, + "catalog": { + "comment": "", + "default_schema": "public", + "name": "", + "schemas": [ + { + "comment": "", + "name": "public", + "tables": [ + { + "rel": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "columns": [ + { + "name": "id", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "bigserial" + } + }, + { + "name": "name", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + }, + { + "name": "bio", + "not_null": false, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + } + ], + "comment": "" + } + ], + "enums": [], + "composite_types": [] + }, + { + "comment": "", + "name": "pg_temp", + "tables": [], + "enums": [], + "composite_types": [] + }, + { + "comment": "", + "name": "pg_catalog", + "tables": [], + "enums": [], + "composite_types": [] + } + ] + }, + "queries": [ + { + "text": "SELECT id, name, bio FROM authors\nWHERE id = $1 LIMIT 1", + "name": "GetAuthor", + "cmd": ":one", + "columns": [ + { + "name": "id", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "bigserial" + } + }, + { + "name": "name", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + }, + { + "name": "bio", + "not_null": false, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + } + ], + "params": [ + { + "number": 1, + "column": { + "name": "id", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "bigserial" + } + } + } + ], + "comments": [], + "filename": "query.sql", + "insert_into_table": null + }, + { + "text": "SELECT id, name, bio FROM authors\nORDER BY name", + "name": "ListAuthors", + "cmd": ":many", + "columns": [ + { + "name": "id", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "bigserial" + } + }, + { + "name": "name", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + }, + { + "name": "bio", + "not_null": false, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + } + ], + "params": [], + "comments": [], + "filename": "query.sql", + "insert_into_table": null + }, + { + "text": "INSERT INTO authors (\n name, bio\n) VALUES (\n $1, $2\n)\nRETURNING id, name, bio", + "name": "CreateAuthor", + "cmd": ":one", + "columns": [ + { + "name": "id", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "bigserial" + } + }, + { + "name": "name", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + }, + { + "name": "bio", + "not_null": false, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + } + ], + "params": [ + { + "number": 1, + "column": { + "name": "name", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "public", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + } + }, + { + "number": 2, + "column": { + "name": "bio", + "not_null": false, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "public", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "text" + } + } + } + ], + "comments": [], + "filename": "query.sql", + "insert_into_table": { + "catalog": "", + "schema": "", + "name": "authors" + } + }, + { + "text": "DELETE FROM authors\nWHERE id = $1", + "name": "DeleteAuthor", + "cmd": ":exec", + "columns": [], + "params": [ + { + "number": 1, + "column": { + "name": "id", + "not_null": true, + "is_array": false, + "comment": "", + "length": -1, + "is_named_param": false, + "is_func_call": false, + "scope": "", + "table": { + "catalog": "", + "schema": "", + "name": "authors" + }, + "table_alias": "", + "type": { + "catalog": "", + "schema": "", + "name": "bigserial" + } + } + } + ], + "comments": [], + "filename": "query.sql", + "insert_into_table": null + } + ], + "sqlc_version": "v1.13.0" +} diff --git a/internal/endtoend/sqlc-gen-json/query.sql b/internal/endtoend/testdata/process_plugin_sqlc_gen_json/query.sql similarity index 100% rename from internal/endtoend/sqlc-gen-json/query.sql rename to internal/endtoend/testdata/process_plugin_sqlc_gen_json/query.sql diff --git a/internal/endtoend/sqlc-gen-json/schema.sql b/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql similarity index 100% rename from internal/endtoend/sqlc-gen-json/schema.sql rename to internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql diff --git a/internal/endtoend/sqlc-gen-json/sqlc.json b/internal/endtoend/testdata/process_plugin_sqlc_gen_json/sqlc.json similarity index 100% rename from internal/endtoend/sqlc-gen-json/sqlc.json rename to internal/endtoend/testdata/process_plugin_sqlc_gen_json/sqlc.json From c3e3a7a9e98867bad91ec6571cf028b62ec8310a Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Wed, 1 Jun 2022 21:29:07 -0700 Subject: [PATCH 7/8] Regen proto files --- internal/plugin/codegen.pb.go | 329 +++++++++----------------- internal/plugin/codegen_vtproto.pb.go | 2 +- 2 files changed, 117 insertions(+), 214 deletions(-) diff --git a/internal/plugin/codegen.pb.go b/internal/plugin/codegen.pb.go index 83212db824..8bd59ee5eb 100644 --- a/internal/plugin/codegen.pb.go +++ b/internal/plugin/codegen.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.27.1 // protoc v3.19.4 // source: plugin/codegen.proto @@ -1761,56 +1761,6 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 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, -<<<<<<< HEAD - 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x79, 0x74, 0x68, - 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x2e, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x70, 0x79, - 0x74, 0x68, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x06, 0x6b, 0x6f, 0x74, 0x6c, 0x69, 0x6e, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x4b, 0x6f, - 0x74, 0x6c, 0x69, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x6b, 0x6f, 0x74, 0x6c, 0x69, 0x6e, - 0x12, 0x1e, 0x0a, 0x02, 0x67, 0x6f, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x47, 0x6f, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x02, 0x67, 0x6f, - 0x12, 0x24, 0x0a, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x43, 0x6f, 0x64, 0x65, - 0x52, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0xf9, 0x01, 0x0a, 0x0a, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, - 0x12, 0x33, 0x0a, 0x16, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x65, 0x78, 0x61, 0x63, 0x74, 0x5f, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x13, 0x65, 0x6d, 0x69, 0x74, 0x45, 0x78, 0x61, 0x63, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x73, 0x79, - 0x6e, 0x63, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0f, 0x65, 0x6d, 0x69, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, - 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x6d, 0x69, 0x74, 0x5f, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, - 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, - 0x6d, 0x69, 0x74, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x72, 0x12, - 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x75, 0x74, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x75, 0x74, 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, 0x22, 0x6d, 0x0a, - 0x0a, 0x4b, 0x6f, 0x74, 0x6c, 0x69, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x16, 0x65, - 0x6d, 0x69, 0x74, 0x5f, 0x65, 0x78, 0x61, 0x63, 0x74, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6d, 0x69, - 0x74, 0x45, 0x78, 0x61, 0x63, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, - 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x75, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x22, 0xb3, 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, -======= 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, @@ -1834,61 +1784,9 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 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, 0xf9, 0x01, 0x0a, 0x0a, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x16, 0x65, 0x6d, ->>>>>>> e2440d6 (It works!) 0x69, 0x74, 0x5f, 0x65, 0x78, 0x61, 0x63, 0x74, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x6d, 0x69, 0x74, 0x45, 0x78, 0x61, 0x63, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, -<<<<<<< HEAD - 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, 0x22, 0x34, 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, 0x22, 0x88, 0x01, 0x0a, 0x07, 0x43, 0x61, 0x74, -======= 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, @@ -1907,7 +1805,7 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x22, 0xcd, 0x06, 0x0a, 0x06, 0x47, 0x6f, 0x43, 0x6f, 0x64, + 0x09, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x22, 0xb3, 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, @@ -1960,117 +1858,122 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 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, 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, ->>>>>>> e2440d6 (It works!) - 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, + 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, 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, 0x12, 0x0a, 0x04, 0x76, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x04, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x22, 0x71, 0x0a, 0x05, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x24, 0x0a, 0x03, 0x72, 0x65, 0x6c, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, - 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x03, 0x72, 0x65, 0x6c, 0x12, - 0x28, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, - 0x65, 0x6e, 0x74, 0x22, 0x52, 0x0a, 0x0a, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, - 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xd5, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6c, 0x75, - 0x6d, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x74, 0x5f, 0x6e, 0x75, - 0x6c, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6e, 0x6f, 0x74, 0x4e, 0x75, 0x6c, - 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x18, 0x0a, 0x07, - 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x24, - 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x12, 0x20, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x5f, - 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x46, 0x75, - 0x6e, 0x63, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x05, - 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x6c, + 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x48, 0x0a, 0x04, + 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x61, 0x6c, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x71, 0x0a, 0x05, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, + 0x24, 0x0a, 0x03, 0x72, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x52, 0x03, 0x72, 0x65, 0x6c, 0x12, 0x28, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, + 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, + 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x52, 0x0a, 0x0a, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, + 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, + 0x67, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xd5, 0x02, + 0x0a, 0x06, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x6e, 0x6f, 0x74, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x6e, 0x6f, 0x74, 0x4e, 0x75, 0x6c, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x61, 0x72, + 0x72, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x41, 0x72, 0x72, + 0x61, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x64, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, + 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x20, 0x0a, 0x0c, 0x69, 0x73, + 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0a, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, + 0x70, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x26, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, - 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, 0xb6, 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, 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, + 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, 0xb6, 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, 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 ( diff --git a/internal/plugin/codegen_vtproto.pb.go b/internal/plugin/codegen_vtproto.pb.go index 5bd75542e1..f1c093c08d 100644 --- a/internal/plugin/codegen_vtproto.pb.go +++ b/internal/plugin/codegen_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.3.0 +// protoc-gen-go-vtproto version: v0.2.0 // source: plugin/codegen.proto package plugin From 2e7086c2cf001b8adacac12f5f65fc29dad6b4a9 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Thu, 9 Jun 2022 21:34:04 -0700 Subject: [PATCH 8/8] Update codegen settings --- .../testdata/process_plugin_sqlc_gen_json/gen/codegen.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 1b627833e4..592a895ee9 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 @@ -46,7 +46,9 @@ "output_db_file_name": "", "output_models_file_name": "", "output_querier_file_name": "", - "output_files_suffix": "" + "output_files_suffix": "", + "emit_enum_valid_method": false, + "emit_all_enum_values": false }, "json": { "out": "",