diff --git a/internal/cmd/shim.go b/internal/cmd/shim.go index 587c8bff6d..307bbbe485 100644 --- a/internal/cmd/shim.go +++ b/internal/cmd/shim.go @@ -1,8 +1,10 @@ package cmd import ( + "encoding/json" "strings" + gopluginopts "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" "github.com/sqlc-dev/sqlc/internal/compiler" "github.com/sqlc-dev/sqlc/internal/config" "github.com/sqlc-dev/sqlc/internal/config/convert" @@ -33,19 +35,35 @@ func pluginOverride(r *compiler.Result, o config.Override) *plugin.Override { column = colParts[3] } } + + var options []byte + var err error + if len(o.Options) == 0 { + // Send go-specific override information to the go codegen plugin + options, err = json.Marshal(gopluginopts.OverrideOptions{ + GoType: o.GoType, + GoStructTag: o.GoStructTag, + }) + if err != nil { + panic(err) // TODO don't panic, return err + } + } else { + options = o.Options + } + return &plugin.Override{ - CodeType: "", // FIXME DbType: o.DBType, Nullable: o.Nullable, Unsigned: o.Unsigned, Column: o.Column, ColumnName: column, Table: &table, - GoType: pluginGoType(o), + Options: options, } } func pluginSettings(r *compiler.Result, cs config.CombinedSettings) *plugin.Settings { + // TODO only send overrides meant for this plugin var over []*plugin.Override for _, o := range cs.Overrides { over = append(over, pluginOverride(r, o)) @@ -101,20 +119,6 @@ func pluginWASM(p config.Plugin) *plugin.Codegen_WASM { return nil } -func pluginGoType(o config.Override) *plugin.ParsedGoType { - // Note that there is a slight mismatch between this and the - // proto api. The GoType on the override is the unparsed type, - // which could be a qualified path or an object, as per - // https://docs.sqlc.dev/en/v1.18.0/reference/config.html#type-overriding - return &plugin.ParsedGoType{ - ImportPath: o.GoImportPath, - Package: o.GoPackage, - TypeName: o.GoTypeName, - BasicType: o.GoBasicType, - StructTags: o.GoStructTags, - } -} - func pluginCatalog(c *catalog.Catalog) *plugin.Catalog { var schemas []*plugin.Schema for _, s := range c.Schemas { diff --git a/internal/codegen/golang/gen.go b/internal/codegen/golang/gen.go index 6daa977872..0e03781ee4 100644 --- a/internal/codegen/golang/gen.go +++ b/internal/codegen/golang/gen.go @@ -129,11 +129,10 @@ func Generate(ctx context.Context, req *plugin.CodeGenRequest) (*plugin.CodeGenR func generate(req *plugin.CodeGenRequest, options *opts.Options, enums []Enum, structs []Struct, queries []Query) (*plugin.CodeGenResponse, error) { i := &importer{ - Settings: req.Settings, - Options: options, - Queries: queries, - Enums: enums, - Structs: structs, + Options: options, + Queries: queries, + Enums: enums, + Structs: structs, } tctx := tmplCtx{ diff --git a/internal/codegen/golang/go_type.go b/internal/codegen/golang/go_type.go index 6adb4b5058..92aa1a8125 100644 --- a/internal/codegen/golang/go_type.go +++ b/internal/codegen/golang/go_type.go @@ -8,12 +8,12 @@ import ( "github.com/sqlc-dev/sqlc/internal/plugin" ) -func addExtraGoStructTags(tags map[string]string, req *plugin.CodeGenRequest, col *plugin.Column) { - for _, oride := range req.Settings.Overrides { +func addExtraGoStructTags(tags map[string]string, req *plugin.CodeGenRequest, options *opts.Options, col *plugin.Column) { + for _, oride := range options.Overrides { if oride.GoType.StructTags == nil { continue } - if !sdk.Matches(oride, col.Table, req.Catalog.DefaultSchema) { + if !oride.Matches(col.Table, req.Catalog.DefaultSchema) { // Different table. continue } @@ -34,7 +34,7 @@ func addExtraGoStructTags(tags map[string]string, req *plugin.CodeGenRequest, co func goType(req *plugin.CodeGenRequest, options *opts.Options, col *plugin.Column) string { // Check if the column's type has been overridden - for _, oride := range req.Settings.Overrides { + for _, oride := range options.Overrides { if oride.GoType.TypeName == "" { continue } @@ -42,7 +42,7 @@ func goType(req *plugin.CodeGenRequest, options *opts.Options, col *plugin.Colum if col.OriginalName != "" { cname = col.OriginalName } - sameTable := sdk.Matches(oride, col.Table, req.Catalog.DefaultSchema) + sameTable := oride.Matches(col.Table, req.Catalog.DefaultSchema) if oride.Column != "" && sdk.MatchString(oride.ColumnName, cname) && sameTable { if col.IsSqlcSlice { return "[]" + oride.GoType.TypeName @@ -65,7 +65,7 @@ func goInnerType(req *plugin.CodeGenRequest, options *opts.Options, col *plugin. notNull := col.NotNull || col.IsArray // package overrides have a higher precedence - for _, oride := range req.Settings.Overrides { + for _, oride := range options.Overrides { if oride.GoType.TypeName == "" { continue } diff --git a/internal/codegen/golang/imports.go b/internal/codegen/golang/imports.go index c436e68e99..5779038400 100644 --- a/internal/codegen/golang/imports.go +++ b/internal/codegen/golang/imports.go @@ -7,7 +7,6 @@ import ( "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" "github.com/sqlc-dev/sqlc/internal/metadata" - "github.com/sqlc-dev/sqlc/internal/plugin" ) type fileImports struct { @@ -59,11 +58,10 @@ func mergeImports(imps ...fileImports) [][]ImportSpec { } type importer struct { - Settings *plugin.Settings - Options *opts.Options - Queries []Query - Enums []Enum - Structs []Struct + Options *opts.Options + Queries []Query + Enums []Enum + Structs []Struct } func (i *importer) usesType(typ string) bool { @@ -157,7 +155,7 @@ var pqtypeTypes = map[string]struct{}{ "pqtype.NullRawMessage": {}, } -func buildImports(settings *plugin.Settings, options *opts.Options, queries []Query, uses func(string) bool) (map[string]struct{}, map[ImportSpec]struct{}) { +func buildImports(options *opts.Options, queries []Query, uses func(string) bool) (map[string]struct{}, map[ImportSpec]struct{}) { pkg := make(map[ImportSpec]struct{}) std := make(map[string]struct{}) @@ -201,7 +199,7 @@ func buildImports(settings *plugin.Settings, options *opts.Options, queries []Qu } overrideTypes := map[string]string{} - for _, o := range settings.Overrides { + for _, o := range options.Overrides { if o.GoType.BasicType || o.GoType.TypeName == "" { continue } @@ -226,7 +224,7 @@ func buildImports(settings *plugin.Settings, options *opts.Options, queries []Qu } // Custom imports - for _, o := range settings.Overrides { + for _, o := range options.Overrides { if o.GoType.BasicType || o.GoType.TypeName == "" { continue } @@ -241,7 +239,7 @@ func buildImports(settings *plugin.Settings, options *opts.Options, queries []Qu } func (i *importer) interfaceImports() fileImports { - std, pkg := buildImports(i.Settings, i.Options, i.Queries, func(name string) bool { + std, pkg := buildImports(i.Options, i.Queries, func(name string) bool { for _, q := range i.Queries { if q.hasRetType() { if usesBatch([]Query{q}) { @@ -266,7 +264,7 @@ func (i *importer) interfaceImports() fileImports { } func (i *importer) modelImports() fileImports { - std, pkg := buildImports(i.Settings, i.Options, nil, i.usesType) + std, pkg := buildImports(i.Options, nil, i.usesType) if len(i.Enums) > 0 { std["fmt"] = struct{}{} @@ -305,7 +303,7 @@ func (i *importer) queryImports(filename string) fileImports { } } - std, pkg := buildImports(i.Settings, i.Options, gq, func(name string) bool { + std, pkg := buildImports(i.Options, gq, func(name string) bool { for _, q := range gq { if q.hasRetType() { if q.Ret.EmitStruct() { @@ -406,7 +404,7 @@ func (i *importer) copyfromImports() fileImports { copyFromQueries = append(copyFromQueries, q) } } - std, pkg := buildImports(i.Settings, i.Options, copyFromQueries, func(name string) bool { + std, pkg := buildImports(i.Options, copyFromQueries, func(name string) bool { for _, q := range copyFromQueries { if q.hasRetType() { if strings.HasPrefix(q.Ret.Type(), name) { @@ -441,7 +439,7 @@ func (i *importer) batchImports() fileImports { batchQueries = append(batchQueries, q) } } - std, pkg := buildImports(i.Settings, i.Options, batchQueries, func(name string) bool { + std, pkg := buildImports(i.Options, batchQueries, func(name string) bool { for _, q := range batchQueries { if q.hasRetType() { if q.Ret.EmitStruct() { diff --git a/internal/codegen/golang/opts/go_override.go b/internal/codegen/golang/opts/go_override.go new file mode 100644 index 0000000000..fe73fbfc91 --- /dev/null +++ b/internal/codegen/golang/opts/go_override.go @@ -0,0 +1,40 @@ +package opts + +import ( + "github.com/sqlc-dev/sqlc/internal/codegen/sdk" + "github.com/sqlc-dev/sqlc/internal/plugin" +) + +type GoOverride struct { + *plugin.Override + + GoType *ParsedGoType +} + +func (o *GoOverride) Convert() *plugin.Override { + return &plugin.Override{ + DbType: o.DbType, + Nullable: o.Nullable, + Column: o.Column, + Table: o.Table, + ColumnName: o.ColumnName, + Unsigned: o.Unsigned, + } +} + +func (o *GoOverride) Matches(n *plugin.Identifier, defaultSchema string) bool { + return sdk.Matches(o.Convert(), n, defaultSchema) +} + +func NewGoOverride(po *plugin.Override, o Override) GoOverride { + return GoOverride{ + po, + &ParsedGoType{ + ImportPath: o.GoImportPath, + Package: o.GoPackage, + TypeName: o.GoTypeName, + BasicType: o.GoBasicType, + StructTags: o.GoStructTags, + }, + } +} diff --git a/internal/codegen/golang/opts/go_type.go b/internal/codegen/golang/opts/go_type.go new file mode 100644 index 0000000000..af3db71bde --- /dev/null +++ b/internal/codegen/golang/opts/go_type.go @@ -0,0 +1,185 @@ +// Copied from github.com/sqlc-dev/sqlc/internal/config/go_type.go with minor changes to ParsedGoType +package opts + +import ( + "encoding/json" + "fmt" + "go/types" + "regexp" + "strings" + + "github.com/fatih/structtag" +) + +type GoType struct { + Path string `json:"import" yaml:"import"` + Package string `json:"package" yaml:"package"` + Name string `json:"type" yaml:"type"` + Pointer bool `json:"pointer" yaml:"pointer"` + Slice bool `json:"slice" yaml:"slice"` + Spec string + BuiltIn bool +} + +type ParsedGoType struct { + ImportPath string `json:"import_path"` + Package string `json:"package"` + TypeName string `json:"type_name"` + BasicType bool `json:"basic_type"` + StructTags map[string]string `json:"struct_tags"` +} + +func (o *GoType) UnmarshalJSON(data []byte) error { + var spec string + if err := json.Unmarshal(data, &spec); err == nil { + *o = GoType{Spec: spec} + return nil + } + type alias GoType + var a alias + if err := json.Unmarshal(data, &a); err != nil { + return err + } + *o = GoType(a) + return nil +} + +func (o *GoType) UnmarshalYAML(unmarshal func(interface{}) error) error { + var spec string + if err := unmarshal(&spec); err == nil { + *o = GoType{Spec: spec} + return nil + } + type alias GoType + var a alias + if err := unmarshal(&a); err != nil { + return err + } + *o = GoType(a) + return nil +} + +var validIdentifier = regexp.MustCompile(`^[a-zA-Z0-9_]+$`) +var versionNumber = regexp.MustCompile(`^v[0-9]+$`) +var invalidIdentifier = regexp.MustCompile(`[^a-zA-Z0-9_]`) + +func generatePackageID(importPath string) (string, bool) { + parts := strings.Split(importPath, "/") + name := parts[len(parts)-1] + // If the last part of the import path is a valid identifier, assume that's the package name + if versionNumber.MatchString(name) && len(parts) >= 2 { + name = parts[len(parts)-2] + return invalidIdentifier.ReplaceAllString(strings.ToLower(name), "_"), true + } + if validIdentifier.MatchString(name) { + return name, false + } + return invalidIdentifier.ReplaceAllString(strings.ToLower(name), "_"), true +} + +// validate GoType +func (gt GoType) Parse() (*ParsedGoType, error) { + var o ParsedGoType + + if gt.Spec == "" { + // TODO: Validation + if gt.Path == "" && gt.Package != "" { + return nil, fmt.Errorf("Package override `go_type`: package name requires an import path") + } + var pkg string + var pkgNeedsAlias bool + + if gt.Package == "" && gt.Path != "" { + pkg, pkgNeedsAlias = generatePackageID(gt.Path) + if pkgNeedsAlias { + o.Package = pkg + } + } else { + pkg = gt.Package + o.Package = gt.Package + } + + o.ImportPath = gt.Path + o.TypeName = gt.Name + o.BasicType = gt.Path == "" && gt.Package == "" + if pkg != "" { + o.TypeName = pkg + "." + o.TypeName + } + if gt.Pointer { + o.TypeName = "*" + o.TypeName + } + if gt.Slice { + o.TypeName = "[]" + o.TypeName + } + return &o, nil + } + + input := gt.Spec + lastDot := strings.LastIndex(input, ".") + lastSlash := strings.LastIndex(input, "/") + typename := input + if lastDot == -1 && lastSlash == -1 { + // if the type name has no slash and no dot, validate that the type is a basic Go type + var found bool + for _, typ := range types.Typ { + info := typ.Info() + if info == 0 { + continue + } + if info&types.IsUntyped != 0 { + continue + } + if typename == typ.Name() { + found = true + } + } + if !found { + return nil, fmt.Errorf("Package override `go_type` specifier %q is not a Go basic type e.g. 'string'", input) + } + o.BasicType = true + } else { + // assume the type lives in a Go package + if lastDot == -1 { + return nil, fmt.Errorf("Package override `go_type` specifier %q is not the proper format, expected 'package.type', e.g. 'github.com/segmentio/ksuid.KSUID'", input) + } + typename = input[lastSlash+1:] + // a package name beginning with "go-" will give syntax errors in + // generated code. We should do the right thing and get the actual + // import name, but in lieu of that, stripping the leading "go-" may get + // us what we want. + typename = strings.TrimPrefix(typename, "go-") + typename = strings.TrimSuffix(typename, "-go") + o.ImportPath = input[:lastDot] + } + o.TypeName = typename + isPointer := input[0] == '*' + if isPointer { + o.ImportPath = o.ImportPath[1:] + o.TypeName = "*" + o.TypeName + } + return &o, nil +} + +// GoStructTag is a raw Go struct tag. +type GoStructTag string + +// Parse parses and validates a GoStructTag. +// The output is in a form convenient for codegen. +// +// Sample valid inputs/outputs: +// +// In Out +// empty string {} +// `a:"b"` {"a": "b"} +// `a:"b" x:"y,z"` {"a": "b", "x": "y,z"} +func (s GoStructTag) Parse() (map[string]string, error) { + m := make(map[string]string) + tags, err := structtag.Parse(string(s)) + if err != nil { + return nil, err + } + for _, tag := range tags.Tags() { + m[tag.Key] = tag.Value() + } + return m, nil +} diff --git a/internal/codegen/golang/opts/options.go b/internal/codegen/golang/opts/options.go index 2e07b7a025..d703450070 100644 --- a/internal/codegen/golang/opts/options.go +++ b/internal/codegen/golang/opts/options.go @@ -1,7 +1,6 @@ package opts import ( - "bytes" "encoding/json" "fmt" @@ -39,19 +38,51 @@ type Options struct { OmitUnusedStructs bool `json:"omit_unused_structs,omitempty"` BuildTags string `json:"build_tags,omitempty"` - // Unused but included in marshaled json we receive - Overrides json.RawMessage `json:"overrides,omitempty"` - Rename json.RawMessage `json:"rename,omitempty"` + QuerySetOverrides []Override `json:"overrides,omitempty"` + QuerySetRename json.RawMessage `json:"rename,omitempty"` // Unused, TODO merge with req.Settings.Rename + + Overrides []GoOverride `json:"-"` } func ParseOpts(req *plugin.CodeGenRequest) (*Options, error) { var options *Options - dec := json.NewDecoder(bytes.NewReader(req.PluginOptions)) - dec.DisallowUnknownFields() - if err := dec.Decode(&options); err != nil { + if err := json.Unmarshal(req.PluginOptions, &options); err != nil { return options, fmt.Errorf("unmarshalling options: %w", err) } + for _, override := range req.Settings.Overrides { + var overrideOpts OverrideOptions + if err := json.Unmarshal(override.Options, &overrideOpts); err != nil { + return options, err + } + parsedGoType, err := overrideOpts.GoType.Parse() + if err != nil { + return options, err + } + parsedGoStructTags, err := overrideOpts.GoStructTag.Parse() + if err != nil { + return options, err + } + parsedGoType.StructTags = parsedGoStructTags + options.Overrides = append(options.Overrides, GoOverride{ + override, + parsedGoType, + }) + } + + // in sqlc config.Combine() the "package"-level overrides were appended to + // global overrides, so we mimic that behavior here + for i := range options.QuerySetOverrides { + if err := options.QuerySetOverrides[i].Parse(); err != nil { + return options, err + } + + options.Overrides = append(options.Overrides, NewGoOverride( + pluginOverride(req.Catalog.DefaultSchema, options.QuerySetOverrides[i]), + options.QuerySetOverrides[i], + )) + } + if options.QueryParameterLimit == nil { options.QueryParameterLimit = new(int32) *options.QueryParameterLimit = 1 diff --git a/internal/codegen/golang/opts/override.go b/internal/codegen/golang/opts/override.go new file mode 100644 index 0000000000..ea7660f32f --- /dev/null +++ b/internal/codegen/golang/opts/override.go @@ -0,0 +1,146 @@ +// Copied from github.com/sqlc-dev/sqlc/internal/config/override.go +package opts + +import ( + "fmt" + "os" + "strings" + + "github.com/sqlc-dev/sqlc/internal/pattern" +) + +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"` + + // additional Go struct tags to add to this field, in raw Go struct tag form, e.g. `validate:"required" x:"y,z"` + // see https://github.com/sqlc-dev/sqlc/issues/534 + GoStructTag GoStructTag `json:"go_struct_tag" yaml:"go_struct_tag"` + + // 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 string `json:"engine,omitempty" yaml:"engine"` + + // True if the GoType should override if the matching type is nullable + Nullable bool `json:"nullable" yaml:"nullable"` + + // True if the GoType should override if the matching type is unsiged. + Unsigned bool `json:"unsigned" yaml:"unsigned"` + + // 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 `json:"-"` + TableCatalog *pattern.Match `json:"-"` + TableSchema *pattern.Match `json:"-"` + TableRel *pattern.Match `json:"-"` + GoImportPath string `json:"-"` + GoPackage string `json:"-"` + GoTypeName string `json:"-"` + GoBasicType bool `json:"-"` + + // Parsed form of GoStructTag, e.g. {"validate:", "required"} + GoStructTags map[string]string `json:"-"` + + // For passing plugin-specific configuration + Plugin string `json:"plugin"` // Irrelevant here in the plugin context + Options OverrideOptions `json:"options"` +} + +type OverrideOptions struct { + GoType GoType `json:"go_type"` + GoStructTag GoStructTag `json:"go_struct_tag"` +} + +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 + + // validate GoStructTag + tags, err := o.GoStructTag.Parse() + if err != nil { + return err + } + o.GoStructTags = tags + + return nil +} diff --git a/internal/codegen/golang/opts/override_test.go b/internal/codegen/golang/opts/override_test.go new file mode 100644 index 0000000000..5a6f849a1a --- /dev/null +++ b/internal/codegen/golang/opts/override_test.go @@ -0,0 +1,117 @@ +package opts + +import ( + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestTypeOverrides(t *testing.T) { + for _, test := range []struct { + override Override + pkg string + typeName string + basic bool + }{ + { + Override{ + DBType: "uuid", + GoType: GoType{Spec: "github.com/segmentio/ksuid.KSUID"}, + }, + "github.com/segmentio/ksuid", + "ksuid.KSUID", + false, + }, + // TODO: Add test for struct pointers + // + // { + // Override{ + // DBType: "uuid", + // GoType: "github.com/segmentio/*ksuid.KSUID", + // }, + // "github.com/segmentio/ksuid", + // "*ksuid.KSUID", + // false, + // }, + { + Override{ + DBType: "citext", + GoType: GoType{Spec: "string"}, + }, + "", + "string", + true, + }, + { + Override{ + DBType: "timestamp", + GoType: GoType{Spec: "time.Time"}, + }, + "time", + "time.Time", + false, + }, + } { + tt := test + t.Run(tt.override.GoType.Spec, func(t *testing.T) { + if err := tt.override.Parse(); err != nil { + t.Fatalf("override parsing failed; %s", err) + } + if diff := cmp.Diff(tt.pkg, tt.override.GoImportPath); diff != "" { + t.Errorf("package mismatch;\n%s", diff) + } + if diff := cmp.Diff(tt.typeName, tt.override.GoTypeName); diff != "" { + t.Errorf("type name mismatch;\n%s", diff) + } + if diff := cmp.Diff(tt.basic, tt.override.GoBasicType); diff != "" { + t.Errorf("basic mismatch;\n%s", diff) + } + }) + } + for _, test := range []struct { + override Override + err string + }{ + { + Override{ + DBType: "uuid", + GoType: GoType{Spec: "Pointer"}, + }, + "Package override `go_type` specifier \"Pointer\" is not a Go basic type e.g. 'string'", + }, + { + Override{ + DBType: "uuid", + GoType: GoType{Spec: "untyped rune"}, + }, + "Package override `go_type` specifier \"untyped rune\" is not a Go basic type e.g. 'string'", + }, + } { + tt := test + t.Run(tt.override.GoType.Spec, func(t *testing.T) { + err := tt.override.Parse() + if err == nil { + t.Fatalf("expected parse to fail; got nil") + } + if diff := cmp.Diff(tt.err, err.Error()); diff != "" { + t.Errorf("error mismatch;\n%s", diff) + } + }) + } +} + +func FuzzOverride(f *testing.F) { + for _, spec := range []string{ + "string", + "github.com/gofrs/uuid.UUID", + "github.com/segmentio/ksuid.KSUID", + } { + f.Add(spec) + } + f.Fuzz(func(t *testing.T, s string) { + o := Override{ + GoType: GoType{Spec: s}, + } + o.Parse() + }) +} diff --git a/internal/codegen/golang/opts/plugin_override.go b/internal/codegen/golang/opts/plugin_override.go new file mode 100644 index 0000000000..c8d9735776 --- /dev/null +++ b/internal/codegen/golang/opts/plugin_override.go @@ -0,0 +1,41 @@ +// Extracted from github.com/sqlc-dev/sqlc/internal/cmd/shim.go +package opts + +import ( + "strings" + + "github.com/sqlc-dev/sqlc/internal/plugin" +) + +func pluginOverride(defaultSchema string, o Override) *plugin.Override { + var column string + var table plugin.Identifier + + if o.Column != "" { + colParts := strings.Split(o.Column, ".") + switch len(colParts) { + case 2: + table.Schema = defaultSchema + table.Name = colParts[0] + column = colParts[1] + case 3: + table.Schema = colParts[0] + table.Name = colParts[1] + column = colParts[2] + case 4: + table.Catalog = colParts[0] + table.Schema = colParts[1] + table.Name = colParts[2] + column = colParts[3] + } + } + + return &plugin.Override{ + DbType: o.DBType, + Nullable: o.Nullable, + Unsigned: o.Unsigned, + Column: o.Column, + ColumnName: column, + Table: &table, + } +} diff --git a/internal/codegen/golang/result.go b/internal/codegen/golang/result.go index e8c97df372..315e50a462 100644 --- a/internal/codegen/golang/result.go +++ b/internal/codegen/golang/result.go @@ -92,7 +92,7 @@ func buildStructs(req *plugin.CodeGenRequest, options *opts.Options) []Struct { if options.EmitJsonTags { tags["json"] = JSONTagName(column.Name, options) } - addExtraGoStructTags(tags, req, column) + addExtraGoStructTags(tags, req, options, column) s.Fields = append(s.Fields, Field{ Name: StructName(column.Name, req.Settings), Type: goType(req, options, column), @@ -370,7 +370,7 @@ func columnsToStruct(req *plugin.CodeGenRequest, options *opts.Options, name str if options.EmitJsonTags { tags["json"] = JSONTagName(tagName, options) } - addExtraGoStructTags(tags, req, c.Column) + addExtraGoStructTags(tags, req, options, c.Column) f := Field{ Name: fieldName, DBName: colName, diff --git a/internal/config/config.go b/internal/config/config.go index 8bd1f004f4..0cb5e3f131 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -269,7 +269,6 @@ func Combine(conf Config, pkg SQL) CombinedSettings { for k, v := range pkg.Gen.Go.Rename { cs.Rename[k] = v } - cs.Overrides = append(cs.Overrides, pkg.Gen.Go.Overrides...) } if pkg.Gen.JSON != nil { cs.JSON = *pkg.Gen.JSON diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 240a4b4e1c..57211d674c 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -89,113 +89,3 @@ func TestInvalidConfig(t *testing.T) { t.Errorf("expected err; got nil") } } - -func TestTypeOverrides(t *testing.T) { - for _, test := range []struct { - override Override - pkg string - typeName string - basic bool - }{ - { - Override{ - DBType: "uuid", - GoType: GoType{Spec: "github.com/segmentio/ksuid.KSUID"}, - }, - "github.com/segmentio/ksuid", - "ksuid.KSUID", - false, - }, - // TODO: Add test for struct pointers - // - // { - // Override{ - // DBType: "uuid", - // GoType: "github.com/segmentio/*ksuid.KSUID", - // }, - // "github.com/segmentio/ksuid", - // "*ksuid.KSUID", - // false, - // }, - { - Override{ - DBType: "citext", - GoType: GoType{Spec: "string"}, - }, - "", - "string", - true, - }, - { - Override{ - DBType: "timestamp", - GoType: GoType{Spec: "time.Time"}, - }, - "time", - "time.Time", - false, - }, - } { - tt := test - t.Run(tt.override.GoType.Spec, func(t *testing.T) { - if err := tt.override.Parse(); err != nil { - t.Fatalf("override parsing failed; %s", err) - } - if diff := cmp.Diff(tt.pkg, tt.override.GoImportPath); diff != "" { - t.Errorf("package mismatch;\n%s", diff) - } - if diff := cmp.Diff(tt.typeName, tt.override.GoTypeName); diff != "" { - t.Errorf("type name mismatch;\n%s", diff) - } - if diff := cmp.Diff(tt.basic, tt.override.GoBasicType); diff != "" { - t.Errorf("basic mismatch;\n%s", diff) - } - }) - } - for _, test := range []struct { - override Override - err string - }{ - { - Override{ - DBType: "uuid", - GoType: GoType{Spec: "Pointer"}, - }, - "Package override `go_type` specifier \"Pointer\" is not a Go basic type e.g. 'string'", - }, - { - Override{ - DBType: "uuid", - GoType: GoType{Spec: "untyped rune"}, - }, - "Package override `go_type` specifier \"untyped rune\" is not a Go basic type e.g. 'string'", - }, - } { - tt := test - t.Run(tt.override.GoType.Spec, func(t *testing.T) { - err := tt.override.Parse() - if err == nil { - t.Fatalf("expected parse to fail; got nil") - } - if diff := cmp.Diff(tt.err, err.Error()); diff != "" { - t.Errorf("error mismatch;\n%s", diff) - } - }) - } -} - -func FuzzOverride(f *testing.F) { - for _, spec := range []string{ - "string", - "github.com/gofrs/uuid.UUID", - "github.com/segmentio/ksuid.KSUID", - } { - f.Add(spec) - } - f.Fuzz(func(t *testing.T, s string) { - o := Override{ - GoType: GoType{Spec: s}, - } - o.Parse() - }) -} diff --git a/internal/config/go_type.go b/internal/config/go_type.go index 14765e5f32..d912156bec 100644 --- a/internal/config/go_type.go +++ b/internal/config/go_type.go @@ -1,184 +1 @@ package config - -import ( - "encoding/json" - "fmt" - "go/types" - "regexp" - "strings" - - "github.com/fatih/structtag" -) - -type GoType struct { - Path string `json:"import" yaml:"import"` - Package string `json:"package" yaml:"package"` - Name string `json:"type" yaml:"type"` - Pointer bool `json:"pointer" yaml:"pointer"` - Slice bool `json:"slice" yaml:"slice"` - Spec string - BuiltIn bool -} - -type ParsedGoType struct { - ImportPath string - Package string - TypeName string - BasicType bool - StructTag string -} - -func (o *GoType) UnmarshalJSON(data []byte) error { - var spec string - if err := json.Unmarshal(data, &spec); err == nil { - *o = GoType{Spec: spec} - return nil - } - type alias GoType - var a alias - if err := json.Unmarshal(data, &a); err != nil { - return err - } - *o = GoType(a) - return nil -} - -func (o *GoType) UnmarshalYAML(unmarshal func(interface{}) error) error { - var spec string - if err := unmarshal(&spec); err == nil { - *o = GoType{Spec: spec} - return nil - } - type alias GoType - var a alias - if err := unmarshal(&a); err != nil { - return err - } - *o = GoType(a) - return nil -} - -var validIdentifier = regexp.MustCompile(`^[a-zA-Z0-9_]+$`) -var versionNumber = regexp.MustCompile(`^v[0-9]+$`) -var invalidIdentifier = regexp.MustCompile(`[^a-zA-Z0-9_]`) - -func generatePackageID(importPath string) (string, bool) { - parts := strings.Split(importPath, "/") - name := parts[len(parts)-1] - // If the last part of the import path is a valid identifier, assume that's the package name - if versionNumber.MatchString(name) && len(parts) >= 2 { - name = parts[len(parts)-2] - return invalidIdentifier.ReplaceAllString(strings.ToLower(name), "_"), true - } - if validIdentifier.MatchString(name) { - return name, false - } - return invalidIdentifier.ReplaceAllString(strings.ToLower(name), "_"), true -} - -// validate GoType -func (gt GoType) Parse() (*ParsedGoType, error) { - var o ParsedGoType - - if gt.Spec == "" { - // TODO: Validation - if gt.Path == "" && gt.Package != "" { - return nil, fmt.Errorf("Package override `go_type`: package name requires an import path") - } - var pkg string - var pkgNeedsAlias bool - - if gt.Package == "" && gt.Path != "" { - pkg, pkgNeedsAlias = generatePackageID(gt.Path) - if pkgNeedsAlias { - o.Package = pkg - } - } else { - pkg = gt.Package - o.Package = gt.Package - } - - o.ImportPath = gt.Path - o.TypeName = gt.Name - o.BasicType = gt.Path == "" && gt.Package == "" - if pkg != "" { - o.TypeName = pkg + "." + o.TypeName - } - if gt.Pointer { - o.TypeName = "*" + o.TypeName - } - if gt.Slice { - o.TypeName = "[]" + o.TypeName - } - return &o, nil - } - - input := gt.Spec - lastDot := strings.LastIndex(input, ".") - lastSlash := strings.LastIndex(input, "/") - typename := input - if lastDot == -1 && lastSlash == -1 { - // if the type name has no slash and no dot, validate that the type is a basic Go type - var found bool - for _, typ := range types.Typ { - info := typ.Info() - if info == 0 { - continue - } - if info&types.IsUntyped != 0 { - continue - } - if typename == typ.Name() { - found = true - } - } - if !found { - return nil, fmt.Errorf("Package override `go_type` specifier %q is not a Go basic type e.g. 'string'", input) - } - o.BasicType = true - } else { - // assume the type lives in a Go package - if lastDot == -1 { - return nil, fmt.Errorf("Package override `go_type` specifier %q is not the proper format, expected 'package.type', e.g. 'github.com/segmentio/ksuid.KSUID'", input) - } - typename = input[lastSlash+1:] - // a package name beginning with "go-" will give syntax errors in - // generated code. We should do the right thing and get the actual - // import name, but in lieu of that, stripping the leading "go-" may get - // us what we want. - typename = strings.TrimPrefix(typename, "go-") - typename = strings.TrimSuffix(typename, "-go") - o.ImportPath = input[:lastDot] - } - o.TypeName = typename - isPointer := input[0] == '*' - if isPointer { - o.ImportPath = o.ImportPath[1:] - o.TypeName = "*" + o.TypeName - } - return &o, nil -} - -// GoStructTag is a raw Go struct tag. -type GoStructTag string - -// Parse parses and validates a GoStructTag. -// The output is in a form convenient for codegen. -// -// Sample valid inputs/outputs: -// -// In Out -// empty string {} -// `a:"b"` {"a": "b"} -// `a:"b" x:"y,z"` {"a": "b", "x": "y,z"} -func (s GoStructTag) Parse() (map[string]string, error) { - m := make(map[string]string) - tags, err := structtag.Parse(string(s)) - if err != nil { - return nil, err - } - for _, tag := range tags.Tags() { - m[tag.Key] = tag.Value() - } - return m, nil -} diff --git a/internal/config/override.go b/internal/config/override.go index 0bb050443b..208400c4d8 100644 --- a/internal/config/override.go +++ b/internal/config/override.go @@ -1,20 +1,22 @@ package config import ( + "encoding/json" "fmt" "os" "strings" + gopluginopts "github.com/sqlc-dev/sqlc/internal/codegen/golang/opts" "github.com/sqlc-dev/sqlc/internal/pattern" ) 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"` + GoType gopluginopts.GoType `json:"go_type" yaml:"go_type"` // additional Go struct tags to add to this field, in raw Go struct tag form, e.g. `validate:"required" x:"y,z"` // see https://github.com/sqlc-dev/sqlc/issues/534 - GoStructTag GoStructTag `json:"go_struct_tag" yaml:"go_struct_tag"` + GoStructTag gopluginopts.GoStructTag `json:"go_struct_tag" yaml:"go_struct_tag"` // fully qualified name of the Go type, e.g. `github.com/segmentio/ksuid.KSUID` DBType string `json:"db_type" yaml:"db_type"` @@ -35,21 +37,26 @@ type Override struct { // 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 - - // Parsed form of GoStructTag, e.g. {"validate:", "required"} - GoStructTags map[string]string + ColumnName *pattern.Match `json:"-"` + TableCatalog *pattern.Match `json:"-"` + TableSchema *pattern.Match `json:"-"` + TableRel *pattern.Match `json:"-"` + + // For passing plugin-specific configuration + Plugin string `json:"plugin,omitempty"` + Options json.RawMessage `json:"options,omitempty"` } -func (o *Override) Parse() (err error) { +func (o Override) hasGoOptions() bool { + hasGoTypePath := o.GoType.Path != "" + hasGoTypePackage := o.GoType.Package != "" + hasGoTypeName := o.GoType.Name != "" + hasGoType := hasGoTypePath || hasGoTypePackage || hasGoTypeName + hasGoStructTag := o.GoStructTag != "" + return hasGoType || hasGoStructTag +} +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") @@ -71,6 +78,8 @@ func (o *Override) Parse() (err error) { 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`") + case o.hasGoOptions() && len(o.Options) > 0: + return fmt.Errorf("Override can specify go_type/go_struct_tag or options but not both") } // validate Column @@ -115,22 +124,5 @@ func (o *Override) Parse() (err error) { } } - // 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 - - // validate GoStructTag - tags, err := o.GoStructTag.Parse() - if err != nil { - return err - } - o.GoStructTags = tags - return nil } diff --git a/internal/config/v_one.go b/internal/config/v_one.go index c6568ebb53..645f527837 100644 --- a/internal/config/v_one.go +++ b/internal/config/v_one.go @@ -96,18 +96,13 @@ func v1ParseConfig(rd io.Reader) (Config, error) { *settings.Packages[j].QueryParameterLimit = 1 } - for i := range settings.Packages[j].Overrides { - if err := settings.Packages[j].Overrides[i].Parse(); err != nil { - return config, err - } - } if settings.Packages[j].Name == "" { settings.Packages[j].Name = filepath.Base(settings.Packages[j].Path) } + if settings.Packages[j].Engine == "" { settings.Packages[j].Engine = EnginePostgreSQL } - } return settings.Translate(), nil diff --git a/internal/config/v_two.go b/internal/config/v_two.go index e2c97a2749..4da6fd0ae8 100644 --- a/internal/config/v_two.go +++ b/internal/config/v_two.go @@ -84,11 +84,6 @@ func v2ParseConfig(rd io.Reader) (Config, error) { *conf.SQL[j].Gen.Go.QueryParameterLimit = 1 } - for i := range conf.SQL[j].Gen.Go.Overrides { - if err := conf.SQL[j].Gen.Go.Overrides[i].Parse(); err != nil { - return conf, err - } - } for k, v := range conf.SQL[j].Gen.Go.Rename { conf.SQL[j].Gen.Go.Rename[k] = v } diff --git a/internal/endtoend/testdata/overrides_go_struct_tags/invalid_tags/stderr.txt b/internal/endtoend/testdata/overrides_go_struct_tags/invalid_tags/stderr.txt index cb6fb84aec..c6891c182b 100644 --- a/internal/endtoend/testdata/overrides_go_struct_tags/invalid_tags/stderr.txt +++ b/internal/endtoend/testdata/overrides_go_struct_tags/invalid_tags/stderr.txt @@ -1 +1,2 @@ -error parsing sqlc.json: bad syntax for struct tag pair +# package override +error generating code: bad syntax for struct tag pair diff --git a/internal/endtoend/testdata/process_plugin_disabled/gen/codegen.json b/internal/endtoend/testdata/process_plugin_disabled/gen/codegen.json index 29278472ab..fb251b23c7 100644 --- a/internal/endtoend/testdata/process_plugin_disabled/gen/codegen.json +++ b/internal/endtoend/testdata/process_plugin_disabled/gen/codegen.json @@ -14,41 +14,6 @@ "out": "gen", "plugin": "jsonb", "options": "eyJmaWxlbmFtZSI6ImNvZGVnZW4uanNvbiIsImluZGVudCI6IiAgIn0=" - }, - "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": "", - "sql_driver": "", - "output_db_file_name": "", - "output_models_file_name": "", - "output_querier_file_name": "", - "output_copyfrom_file_name": "", - "output_files_suffix": "", - "emit_enum_valid_method": false, - "emit_all_enum_values": false, - "inflection_exclude_table_names": [], - "emit_pointers_for_null_types": false, - "query_parameter_limit": 1, - "output_batch_file_name": "", - "json_tags_id_uppercase": false, - "omit_unused_structs": false - }, - "json": { - "out": "", - "indent": "", - "filename": "" } }, "catalog": { diff --git a/internal/plugin/codegen.pb.go b/internal/plugin/codegen.pb.go index 7b3347c6e1..302df29e1d 100644 --- a/internal/plugin/codegen.pb.go +++ b/internal/plugin/codegen.pb.go @@ -80,19 +80,18 @@ type Override struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // name of the type to use, e.g. `github.com/segmentio/ksuid.KSUID` or `mymodule.Type` - CodeType string `protobuf:"bytes,1,opt,name=code_type,proto3" json:"code_type,omitempty"` // name of the type to use, e.g. `text` DbType string `protobuf:"bytes,3,opt,name=db_type,proto3" json:"db_type,omitempty"` // True if the override should apply to a nullable database type Nullable bool `protobuf:"varint,5,opt,name=nullable,proto3" json:"nullable,omitempty"` // fully qualified name of the column, e.g. `accounts.id` - Column string `protobuf:"bytes,6,opt,name=column,proto3" json:"column,omitempty"` - Table *Identifier `protobuf:"bytes,7,opt,name=table,proto3" json:"table,omitempty"` - ColumnName string `protobuf:"bytes,8,opt,name=column_name,proto3" json:"column_name,omitempty"` - GoType *ParsedGoType `protobuf:"bytes,10,opt,name=go_type,json=goType,proto3" json:"go_type,omitempty"` + Column string `protobuf:"bytes,6,opt,name=column,proto3" json:"column,omitempty"` + Table *Identifier `protobuf:"bytes,7,opt,name=table,proto3" json:"table,omitempty"` + ColumnName string `protobuf:"bytes,8,opt,name=column_name,proto3" json:"column_name,omitempty"` // True if the override should apply to a unsigned database type - Unsigned bool `protobuf:"varint,11,opt,name=unsigned,proto3" json:"unsigned,omitempty"` + Unsigned bool `protobuf:"varint,11,opt,name=unsigned,proto3" json:"unsigned,omitempty"` + Plugin string `protobuf:"bytes,12,opt,name=plugin,proto3" json:"plugin,omitempty"` + Options []byte `protobuf:"bytes,13,opt,name=options,proto3" json:"options,omitempty"` } func (x *Override) Reset() { @@ -127,13 +126,6 @@ func (*Override) Descriptor() ([]byte, []int) { return file_plugin_codegen_proto_rawDescGZIP(), []int{1} } -func (x *Override) GetCodeType() string { - if x != nil { - return x.CodeType - } - return "" -} - func (x *Override) GetDbType() string { if x != nil { return x.DbType @@ -169,13 +161,6 @@ func (x *Override) GetColumnName() string { return "" } -func (x *Override) GetGoType() *ParsedGoType { - if x != nil { - return x.GoType - } - return nil -} - func (x *Override) GetUnsigned() bool { if x != nil { return x.Unsigned @@ -183,81 +168,16 @@ func (x *Override) GetUnsigned() bool { return false } -type ParsedGoType struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ImportPath string `protobuf:"bytes,1,opt,name=import_path,json=importPath,proto3" json:"import_path,omitempty"` - Package string `protobuf:"bytes,2,opt,name=package,proto3" json:"package,omitempty"` - TypeName string `protobuf:"bytes,3,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` - BasicType bool `protobuf:"varint,4,opt,name=basic_type,json=basicType,proto3" json:"basic_type,omitempty"` - StructTags map[string]string `protobuf:"bytes,5,rep,name=struct_tags,json=structTags,proto3" json:"struct_tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *ParsedGoType) Reset() { - *x = ParsedGoType{} - if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParsedGoType) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParsedGoType) ProtoMessage() {} - -func (x *ParsedGoType) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ParsedGoType.ProtoReflect.Descriptor instead. -func (*ParsedGoType) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{2} -} - -func (x *ParsedGoType) GetImportPath() string { +func (x *Override) GetPlugin() string { if x != nil { - return x.ImportPath - } - return "" -} - -func (x *ParsedGoType) GetPackage() string { - if x != nil { - return x.Package - } - return "" -} - -func (x *ParsedGoType) GetTypeName() string { - if x != nil { - return x.TypeName + return x.Plugin } return "" } -func (x *ParsedGoType) GetBasicType() bool { - if x != nil { - return x.BasicType - } - return false -} - -func (x *ParsedGoType) GetStructTags() map[string]string { +func (x *Override) GetOptions() []byte { if x != nil { - return x.StructTags + return x.Options } return nil } @@ -279,7 +199,7 @@ type Settings struct { func (x *Settings) Reset() { *x = Settings{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[3] + mi := &file_plugin_codegen_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -292,7 +212,7 @@ func (x *Settings) String() string { func (*Settings) ProtoMessage() {} func (x *Settings) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[3] + mi := &file_plugin_codegen_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -305,7 +225,7 @@ func (x *Settings) ProtoReflect() protoreflect.Message { // Deprecated: Use Settings.ProtoReflect.Descriptor instead. func (*Settings) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{3} + return file_plugin_codegen_proto_rawDescGZIP(), []int{2} } func (x *Settings) GetVersion() string { @@ -373,7 +293,7 @@ type Codegen struct { func (x *Codegen) Reset() { *x = Codegen{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[4] + mi := &file_plugin_codegen_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -386,7 +306,7 @@ func (x *Codegen) String() string { func (*Codegen) ProtoMessage() {} func (x *Codegen) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[4] + mi := &file_plugin_codegen_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -399,7 +319,7 @@ func (x *Codegen) ProtoReflect() protoreflect.Message { // Deprecated: Use Codegen.ProtoReflect.Descriptor instead. func (*Codegen) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{4} + return file_plugin_codegen_proto_rawDescGZIP(), []int{3} } func (x *Codegen) GetOut() string { @@ -458,7 +378,7 @@ type Catalog struct { func (x *Catalog) Reset() { *x = Catalog{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[5] + mi := &file_plugin_codegen_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -471,7 +391,7 @@ func (x *Catalog) String() string { func (*Catalog) ProtoMessage() {} func (x *Catalog) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[5] + mi := &file_plugin_codegen_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -484,7 +404,7 @@ func (x *Catalog) ProtoReflect() protoreflect.Message { // Deprecated: Use Catalog.ProtoReflect.Descriptor instead. func (*Catalog) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{5} + return file_plugin_codegen_proto_rawDescGZIP(), []int{4} } func (x *Catalog) GetComment() string { @@ -530,7 +450,7 @@ type Schema struct { func (x *Schema) Reset() { *x = Schema{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[6] + mi := &file_plugin_codegen_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -543,7 +463,7 @@ func (x *Schema) String() string { func (*Schema) ProtoMessage() {} func (x *Schema) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[6] + mi := &file_plugin_codegen_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -556,7 +476,7 @@ func (x *Schema) ProtoReflect() protoreflect.Message { // Deprecated: Use Schema.ProtoReflect.Descriptor instead. func (*Schema) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{6} + return file_plugin_codegen_proto_rawDescGZIP(), []int{5} } func (x *Schema) GetComment() string { @@ -606,7 +526,7 @@ type CompositeType struct { func (x *CompositeType) Reset() { *x = CompositeType{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[7] + mi := &file_plugin_codegen_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -619,7 +539,7 @@ func (x *CompositeType) String() string { func (*CompositeType) ProtoMessage() {} func (x *CompositeType) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[7] + mi := &file_plugin_codegen_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -632,7 +552,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{7} + return file_plugin_codegen_proto_rawDescGZIP(), []int{6} } func (x *CompositeType) GetName() string { @@ -662,7 +582,7 @@ type Enum struct { func (x *Enum) Reset() { *x = Enum{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[8] + mi := &file_plugin_codegen_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -675,7 +595,7 @@ func (x *Enum) String() string { func (*Enum) ProtoMessage() {} func (x *Enum) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[8] + mi := &file_plugin_codegen_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -688,7 +608,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{8} + return file_plugin_codegen_proto_rawDescGZIP(), []int{7} } func (x *Enum) GetName() string { @@ -725,7 +645,7 @@ type Table struct { func (x *Table) Reset() { *x = Table{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[9] + mi := &file_plugin_codegen_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -738,7 +658,7 @@ func (x *Table) String() string { func (*Table) ProtoMessage() {} func (x *Table) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[9] + mi := &file_plugin_codegen_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -751,7 +671,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{9} + return file_plugin_codegen_proto_rawDescGZIP(), []int{8} } func (x *Table) GetRel() *Identifier { @@ -788,7 +708,7 @@ type Identifier struct { func (x *Identifier) Reset() { *x = Identifier{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[10] + mi := &file_plugin_codegen_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -801,7 +721,7 @@ func (x *Identifier) String() string { func (*Identifier) ProtoMessage() {} func (x *Identifier) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[10] + mi := &file_plugin_codegen_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -814,7 +734,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{10} + return file_plugin_codegen_proto_rawDescGZIP(), []int{9} } func (x *Identifier) GetCatalog() string { @@ -865,7 +785,7 @@ type Column struct { func (x *Column) Reset() { *x = Column{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[11] + mi := &file_plugin_codegen_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -878,7 +798,7 @@ func (x *Column) String() string { func (*Column) ProtoMessage() {} func (x *Column) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[11] + mi := &file_plugin_codegen_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -891,7 +811,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{11} + return file_plugin_codegen_proto_rawDescGZIP(), []int{10} } func (x *Column) GetName() string { @@ -1024,7 +944,7 @@ type Query struct { func (x *Query) Reset() { *x = Query{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[12] + mi := &file_plugin_codegen_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1037,7 +957,7 @@ func (x *Query) String() string { func (*Query) ProtoMessage() {} func (x *Query) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[12] + mi := &file_plugin_codegen_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1050,7 +970,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{12} + return file_plugin_codegen_proto_rawDescGZIP(), []int{11} } func (x *Query) GetText() string { @@ -1121,7 +1041,7 @@ type Parameter struct { func (x *Parameter) Reset() { *x = Parameter{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[13] + mi := &file_plugin_codegen_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1134,7 +1054,7 @@ func (x *Parameter) String() string { func (*Parameter) ProtoMessage() {} func (x *Parameter) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[13] + mi := &file_plugin_codegen_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1147,7 +1067,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{13} + return file_plugin_codegen_proto_rawDescGZIP(), []int{12} } func (x *Parameter) GetNumber() int32 { @@ -1179,7 +1099,7 @@ type CodeGenRequest struct { func (x *CodeGenRequest) Reset() { *x = CodeGenRequest{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[14] + mi := &file_plugin_codegen_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1192,7 +1112,7 @@ func (x *CodeGenRequest) String() string { func (*CodeGenRequest) ProtoMessage() {} func (x *CodeGenRequest) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[14] + mi := &file_plugin_codegen_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1205,7 +1125,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{14} + return file_plugin_codegen_proto_rawDescGZIP(), []int{13} } func (x *CodeGenRequest) GetSettings() *Settings { @@ -1254,7 +1174,7 @@ type CodeGenResponse struct { func (x *CodeGenResponse) Reset() { *x = CodeGenResponse{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[15] + mi := &file_plugin_codegen_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1267,7 +1187,7 @@ func (x *CodeGenResponse) String() string { func (*CodeGenResponse) ProtoMessage() {} func (x *CodeGenResponse) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[15] + mi := &file_plugin_codegen_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1280,7 +1200,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{15} + return file_plugin_codegen_proto_rawDescGZIP(), []int{14} } func (x *CodeGenResponse) GetFiles() []*File { @@ -1301,7 +1221,7 @@ type Codegen_Process struct { func (x *Codegen_Process) Reset() { *x = Codegen_Process{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[18] + mi := &file_plugin_codegen_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1314,7 +1234,7 @@ func (x *Codegen_Process) String() string { func (*Codegen_Process) ProtoMessage() {} func (x *Codegen_Process) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[18] + mi := &file_plugin_codegen_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1327,7 +1247,7 @@ func (x *Codegen_Process) ProtoReflect() protoreflect.Message { // Deprecated: Use Codegen_Process.ProtoReflect.Descriptor instead. func (*Codegen_Process) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{4, 0} + return file_plugin_codegen_proto_rawDescGZIP(), []int{3, 0} } func (x *Codegen_Process) GetCmd() string { @@ -1349,7 +1269,7 @@ type Codegen_WASM struct { func (x *Codegen_WASM) Reset() { *x = Codegen_WASM{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_codegen_proto_msgTypes[19] + mi := &file_plugin_codegen_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1362,7 +1282,7 @@ func (x *Codegen_WASM) String() string { func (*Codegen_WASM) ProtoMessage() {} func (x *Codegen_WASM) ProtoReflect() protoreflect.Message { - mi := &file_plugin_codegen_proto_msgTypes[19] + mi := &file_plugin_codegen_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1375,7 +1295,7 @@ func (x *Codegen_WASM) ProtoReflect() protoreflect.Message { // Deprecated: Use Codegen_WASM.ProtoReflect.Descriptor instead. func (*Codegen_WASM) Descriptor() ([]byte, []int) { - return file_plugin_codegen_proto_rawDescGZIP(), []int{4, 1} + return file_plugin_codegen_proto_rawDescGZIP(), []int{3, 1} } func (x *Codegen_WASM) GetUrl() string { @@ -1400,202 +1320,185 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x93, 0x02, 0x0a, 0x08, 0x4f, 0x76, 0x65, 0x72, 0x72, - 0x69, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x64, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, - 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6e, - 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, - 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, - 0x28, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x07, 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, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, - 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x67, - 0x6f, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x47, 0x6f, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x06, 0x67, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x6e, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x75, 0x6e, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x22, 0x8b, 0x02, 0x0a, - 0x0c, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x47, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x18, - 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x62, 0x61, 0x73, 0x69, 0x63, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x74, - 0x61, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x47, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x2e, - 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x54, 0x61, 0x67, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x53, - 0x74, 0x72, 0x75, 0x63, 0x74, 0x54, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x84, 0x02, 0x0a, 0x08, 0x4f, 0x76, 0x65, 0x72, 0x72, + 0x69, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, + 0x75, 0x6d, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x12, 0x28, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x07, 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, 0x20, 0x0a, 0x0b, 0x63, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, + 0x02, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x4a, 0x04, 0x08, 0x0a, 0x10, 0x0b, 0x22, 0xd2, 0x02, + 0x0a, 0x08, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x34, + 0x0a, 0x06, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x72, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, + 0x69, 0x64, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x07, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, + 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 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, 0xd2, 0x02, 0x0a, 0x08, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x12, 0x18, 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x06, 0x72, - 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x52, 0x65, - 0x6e, 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x72, 0x65, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x2e, 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x4f, 0x76, - 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, - 0x73, 0x12, 0x29, 0x0a, 0x07, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x64, 0x65, - 0x67, 0x65, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x1a, 0x39, 0x0a, 0x0b, - 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x4a, 0x04, 0x08, - 0x09, 0x10, 0x0a, 0x4a, 0x04, 0x08, 0x0a, 0x10, 0x0b, 0x4a, 0x04, 0x08, 0x0b, 0x10, 0x0c, 0x22, - 0x8b, 0x02, 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, 0x12, - 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, - 0x76, 0x12, 0x31, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x64, 0x65, - 0x67, 0x65, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x07, 0x70, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x12, 0x28, 0x0a, 0x04, 0x77, 0x61, 0x73, 0x6d, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x64, 0x65, - 0x67, 0x65, 0x6e, 0x2e, 0x57, 0x41, 0x53, 0x4d, 0x52, 0x04, 0x77, 0x61, 0x73, 0x6d, 0x1a, 0x1b, - 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6d, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x1a, 0x30, 0x0a, 0x04, 0x57, - 0x41, 0x53, 0x4d, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x22, 0x88, 0x01, - 0x0a, 0x07, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, - 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, - 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, - 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x22, 0xc1, 0x01, 0x0a, 0x06, 0x53, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x05, 0x65, 0x6e, 0x75, 0x6d, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x05, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x3e, 0x0a, 0x0f, - 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, - 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0e, 0x63, 0x6f, - 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3d, 0x0a, 0x0d, - 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x48, 0x0a, 0x04, 0x45, - 0x6e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x61, 0x6c, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x71, 0x0a, 0x05, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x24, - 0x0a, 0x03, 0x72, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, - 0x03, 0x72, 0x65, 0x6c, 0x12, 0x28, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, - 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x18, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, + 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x4a, 0x04, 0x08, 0x0a, 0x10, 0x0b, 0x4a, 0x04, 0x08, 0x0b, + 0x10, 0x0c, 0x22, 0x8b, 0x02, 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, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x03, 0x65, 0x6e, 0x76, 0x12, 0x31, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, + 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x07, + 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x12, 0x28, 0x0a, 0x04, 0x77, 0x61, 0x73, 0x6d, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, + 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x57, 0x41, 0x53, 0x4d, 0x52, 0x04, 0x77, 0x61, 0x73, + 0x6d, 0x1a, 0x1b, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, + 0x63, 0x6d, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x1a, 0x30, + 0x0a, 0x04, 0x57, 0x41, 0x53, 0x4d, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x32, + 0x35, 0x36, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, + 0x22, 0x88, 0x01, 0x0a, 0x07, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x28, 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x22, 0xc1, 0x01, 0x0a, 0x06, + 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x05, 0x65, + 0x6e, 0x75, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x05, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x12, + 0x3e, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, + 0x3d, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x48, + 0x0a, 0x04, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x61, + 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 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, 0x8e, 0x04, 0x0a, - 0x06, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6e, - 0x6f, 0x74, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6e, - 0x6f, 0x74, 0x4e, 0x75, 0x6c, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x61, 0x72, 0x72, - 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, - 0x79, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6c, 0x65, 0x6e, - 0x67, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x5f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x4e, - 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x20, 0x0a, 0x0c, 0x69, 0x73, 0x5f, - 0x66, 0x75, 0x6e, 0x63, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0a, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, - 0x63, 0x6f, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, - 0x65, 0x12, 0x28, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x72, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x26, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x73, 0x71, 0x6c, 0x63, 0x5f, - 0x73, 0x6c, 0x69, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x53, - 0x71, 0x6c, 0x63, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x0b, 0x65, 0x6d, 0x62, 0x65, - 0x64, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0e, 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, 0x0a, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x23, 0x0a, - 0x0d, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0f, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x18, 0x10, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x12, 0x1d, - 0x0a, 0x0a, 0x61, 0x72, 0x72, 0x61, 0x79, 0x5f, 0x64, 0x69, 0x6d, 0x73, 0x18, 0x11, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x09, 0x61, 0x72, 0x72, 0x61, 0x79, 0x44, 0x69, 0x6d, 0x73, 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, + 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, + 0x8e, 0x04, 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, 0x11, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x6f, 0x5f, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x22, 0x4b, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x06, 0x63, 0x6f, 0x6c, - 0x75, 0x6d, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, - 0x6e, 0x22, 0xde, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x12, 0x29, 0x0a, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x61, 0x74, - 0x61, 0x6c, 0x6f, 0x67, 0x52, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x27, 0x0a, - 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x07, 0x71, - 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x71, 0x6c, 0x63, 0x5f, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x71, - 0x6c, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x22, 0x35, 0x0a, 0x0f, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x42, 0x0c, 0x43, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x71, 0x6c, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x73, 0x71, 0x6c, - 0x63, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0xca, 0x02, 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0xe2, 0x02, 0x12, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x73, 0x71, + 0x6c, 0x63, 0x5f, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, + 0x69, 0x73, 0x53, 0x71, 0x6c, 0x63, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x0b, 0x65, + 0x6d, 0x62, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0e, 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, 0x0a, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, + 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x72, 0x72, 0x61, 0x79, 0x5f, 0x64, 0x69, 0x6d, 0x73, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x61, 0x72, 0x72, 0x61, 0x79, 0x44, 0x69, 0x6d, 0x73, + 0x22, 0x94, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, + 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x63, 0x6d, 0x64, 0x12, 0x28, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x2d, + 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1a, 0x0a, + 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, + 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, + 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x11, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x5f, + 0x69, 0x6e, 0x74, 0x6f, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x12, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x72, 0x52, 0x11, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x74, + 0x6f, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x4b, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x06, + 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x06, 0x63, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x22, 0xde, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x08, 0x73, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x29, 0x0a, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, + 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x52, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, + 0x12, 0x27, 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x71, 0x6c, + 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x73, 0x71, 0x6c, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, + 0x0e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x35, 0x0a, 0x0f, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x42, 0x7c, 0x0a, 0x0a, + 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x42, 0x0c, 0x43, 0x6f, 0x64, 0x65, + 0x67, 0x65, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x71, 0x6c, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, + 0x73, 0x71, 0x6c, 0x63, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0xca, 0x02, 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0xe2, 0x02, 0x12, 0x50, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -1610,60 +1513,56 @@ func file_plugin_codegen_proto_rawDescGZIP() []byte { return file_plugin_codegen_proto_rawDescData } -var file_plugin_codegen_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_plugin_codegen_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_plugin_codegen_proto_goTypes = []interface{}{ (*File)(nil), // 0: plugin.File (*Override)(nil), // 1: plugin.Override - (*ParsedGoType)(nil), // 2: plugin.ParsedGoType - (*Settings)(nil), // 3: plugin.Settings - (*Codegen)(nil), // 4: plugin.Codegen - (*Catalog)(nil), // 5: plugin.Catalog - (*Schema)(nil), // 6: plugin.Schema - (*CompositeType)(nil), // 7: plugin.CompositeType - (*Enum)(nil), // 8: plugin.Enum - (*Table)(nil), // 9: plugin.Table - (*Identifier)(nil), // 10: plugin.Identifier - (*Column)(nil), // 11: plugin.Column - (*Query)(nil), // 12: plugin.Query - (*Parameter)(nil), // 13: plugin.Parameter - (*CodeGenRequest)(nil), // 14: plugin.CodeGenRequest - (*CodeGenResponse)(nil), // 15: plugin.CodeGenResponse - nil, // 16: plugin.ParsedGoType.StructTagsEntry - nil, // 17: plugin.Settings.RenameEntry - (*Codegen_Process)(nil), // 18: plugin.Codegen.Process - (*Codegen_WASM)(nil), // 19: plugin.Codegen.WASM + (*Settings)(nil), // 2: plugin.Settings + (*Codegen)(nil), // 3: plugin.Codegen + (*Catalog)(nil), // 4: plugin.Catalog + (*Schema)(nil), // 5: plugin.Schema + (*CompositeType)(nil), // 6: plugin.CompositeType + (*Enum)(nil), // 7: plugin.Enum + (*Table)(nil), // 8: plugin.Table + (*Identifier)(nil), // 9: plugin.Identifier + (*Column)(nil), // 10: plugin.Column + (*Query)(nil), // 11: plugin.Query + (*Parameter)(nil), // 12: plugin.Parameter + (*CodeGenRequest)(nil), // 13: plugin.CodeGenRequest + (*CodeGenResponse)(nil), // 14: plugin.CodeGenResponse + nil, // 15: plugin.Settings.RenameEntry + (*Codegen_Process)(nil), // 16: plugin.Codegen.Process + (*Codegen_WASM)(nil), // 17: plugin.Codegen.WASM } var file_plugin_codegen_proto_depIdxs = []int32{ - 10, // 0: plugin.Override.table:type_name -> plugin.Identifier - 2, // 1: plugin.Override.go_type:type_name -> plugin.ParsedGoType - 16, // 2: plugin.ParsedGoType.struct_tags:type_name -> plugin.ParsedGoType.StructTagsEntry - 17, // 3: plugin.Settings.rename:type_name -> plugin.Settings.RenameEntry - 1, // 4: plugin.Settings.overrides:type_name -> plugin.Override - 4, // 5: plugin.Settings.codegen:type_name -> plugin.Codegen - 18, // 6: plugin.Codegen.process:type_name -> plugin.Codegen.Process - 19, // 7: plugin.Codegen.wasm:type_name -> plugin.Codegen.WASM - 6, // 8: plugin.Catalog.schemas:type_name -> plugin.Schema - 9, // 9: plugin.Schema.tables:type_name -> plugin.Table - 8, // 10: plugin.Schema.enums:type_name -> plugin.Enum - 7, // 11: plugin.Schema.composite_types:type_name -> plugin.CompositeType - 10, // 12: plugin.Table.rel:type_name -> plugin.Identifier - 11, // 13: plugin.Table.columns:type_name -> plugin.Column - 10, // 14: plugin.Column.table:type_name -> plugin.Identifier - 10, // 15: plugin.Column.type:type_name -> plugin.Identifier - 10, // 16: plugin.Column.embed_table:type_name -> plugin.Identifier - 11, // 17: plugin.Query.columns:type_name -> plugin.Column - 13, // 18: plugin.Query.params:type_name -> plugin.Parameter - 10, // 19: plugin.Query.insert_into_table:type_name -> plugin.Identifier - 11, // 20: plugin.Parameter.column:type_name -> plugin.Column - 3, // 21: plugin.CodeGenRequest.settings:type_name -> plugin.Settings - 5, // 22: plugin.CodeGenRequest.catalog:type_name -> plugin.Catalog - 12, // 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 + 9, // 0: plugin.Override.table:type_name -> plugin.Identifier + 15, // 1: plugin.Settings.rename:type_name -> plugin.Settings.RenameEntry + 1, // 2: plugin.Settings.overrides:type_name -> plugin.Override + 3, // 3: plugin.Settings.codegen:type_name -> plugin.Codegen + 16, // 4: plugin.Codegen.process:type_name -> plugin.Codegen.Process + 17, // 5: plugin.Codegen.wasm:type_name -> plugin.Codegen.WASM + 5, // 6: plugin.Catalog.schemas:type_name -> plugin.Schema + 8, // 7: plugin.Schema.tables:type_name -> plugin.Table + 7, // 8: plugin.Schema.enums:type_name -> plugin.Enum + 6, // 9: plugin.Schema.composite_types:type_name -> plugin.CompositeType + 9, // 10: plugin.Table.rel:type_name -> plugin.Identifier + 10, // 11: plugin.Table.columns:type_name -> plugin.Column + 9, // 12: plugin.Column.table:type_name -> plugin.Identifier + 9, // 13: plugin.Column.type:type_name -> plugin.Identifier + 9, // 14: plugin.Column.embed_table:type_name -> plugin.Identifier + 10, // 15: plugin.Query.columns:type_name -> plugin.Column + 12, // 16: plugin.Query.params:type_name -> plugin.Parameter + 9, // 17: plugin.Query.insert_into_table:type_name -> plugin.Identifier + 10, // 18: plugin.Parameter.column:type_name -> plugin.Column + 2, // 19: plugin.CodeGenRequest.settings:type_name -> plugin.Settings + 4, // 20: plugin.CodeGenRequest.catalog:type_name -> plugin.Catalog + 11, // 21: plugin.CodeGenRequest.queries:type_name -> plugin.Query + 0, // 22: plugin.CodeGenResponse.files:type_name -> plugin.File + 23, // [23:23] is the sub-list for method output_type + 23, // [23:23] is the sub-list for method input_type + 23, // [23:23] is the sub-list for extension type_name + 23, // [23:23] is the sub-list for extension extendee + 0, // [0:23] is the sub-list for field type_name } func init() { file_plugin_codegen_proto_init() } @@ -1697,18 +1596,6 @@ func file_plugin_codegen_proto_init() { } } file_plugin_codegen_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParsedGoType); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_plugin_codegen_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Settings); i { case 0: return &v.state @@ -1720,7 +1607,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Codegen); i { case 0: return &v.state @@ -1732,7 +1619,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Catalog); i { case 0: return &v.state @@ -1744,7 +1631,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Schema); i { case 0: return &v.state @@ -1756,7 +1643,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CompositeType); i { case 0: return &v.state @@ -1768,7 +1655,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Enum); i { case 0: return &v.state @@ -1780,7 +1667,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Table); i { case 0: return &v.state @@ -1792,7 +1679,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Identifier); i { case 0: return &v.state @@ -1804,7 +1691,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Column); i { case 0: return &v.state @@ -1816,7 +1703,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Query); i { case 0: return &v.state @@ -1828,7 +1715,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Parameter); i { case 0: return &v.state @@ -1840,7 +1727,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CodeGenRequest); i { case 0: return &v.state @@ -1852,7 +1739,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CodeGenResponse); i { case 0: return &v.state @@ -1864,7 +1751,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Codegen_Process); i { case 0: return &v.state @@ -1876,7 +1763,7 @@ func file_plugin_codegen_proto_init() { return nil } } - file_plugin_codegen_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_plugin_codegen_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Codegen_WASM); i { case 0: return &v.state @@ -1895,7 +1782,7 @@ func file_plugin_codegen_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_plugin_codegen_proto_rawDesc, NumEnums: 0, - NumMessages: 20, + NumMessages: 18, NumExtensions: 0, NumServices: 0, }, diff --git a/internal/plugin/codegen_vtproto.pb.go b/internal/plugin/codegen_vtproto.pb.go index 3ff0dc600f..81711700a3 100644 --- a/internal/plugin/codegen_vtproto.pb.go +++ b/internal/plugin/codegen_vtproto.pb.go @@ -47,42 +47,18 @@ func (m *Override) CloneVT() *Override { return (*Override)(nil) } r := &Override{ - CodeType: m.CodeType, DbType: m.DbType, Nullable: m.Nullable, Column: m.Column, Table: m.Table.CloneVT(), ColumnName: m.ColumnName, - GoType: m.GoType.CloneVT(), Unsigned: m.Unsigned, + Plugin: m.Plugin, } - if len(m.unknownFields) > 0 { - r.unknownFields = make([]byte, len(m.unknownFields)) - copy(r.unknownFields, m.unknownFields) - } - return r -} - -func (m *Override) CloneMessageVT() proto.Message { - return m.CloneVT() -} - -func (m *ParsedGoType) CloneVT() *ParsedGoType { - if m == nil { - return (*ParsedGoType)(nil) - } - r := &ParsedGoType{ - ImportPath: m.ImportPath, - Package: m.Package, - TypeName: m.TypeName, - BasicType: m.BasicType, - } - if rhs := m.StructTags; rhs != nil { - tmpContainer := make(map[string]string, len(rhs)) - for k, v := range rhs { - tmpContainer[k] = v - } - r.StructTags = tmpContainer + if rhs := m.Options; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.Options = tmpBytes } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) @@ -91,7 +67,7 @@ func (m *ParsedGoType) CloneVT() *ParsedGoType { return r } -func (m *ParsedGoType) CloneMessageVT() proto.Message { +func (m *Override) CloneMessageVT() proto.Message { return m.CloneVT() } @@ -539,9 +515,6 @@ func (this *Override) EqualVT(that *Override) bool { } else if this == nil || that == nil { return false } - if this.CodeType != that.CodeType { - return false - } if this.DbType != that.DbType { return false } @@ -557,57 +530,20 @@ func (this *Override) EqualVT(that *Override) bool { if this.ColumnName != that.ColumnName { return false } - if !this.GoType.EqualVT(that.GoType) { - return false - } if this.Unsigned != that.Unsigned { return false } - return string(this.unknownFields) == string(that.unknownFields) -} - -func (this *Override) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*Override) - if !ok { - return false - } - return this.EqualVT(that) -} -func (this *ParsedGoType) EqualVT(that *ParsedGoType) bool { - if this == that { - return true - } else if this == nil || that == nil { - return false - } - if this.ImportPath != that.ImportPath { - return false - } - if this.Package != that.Package { - return false - } - if this.TypeName != that.TypeName { - return false - } - if this.BasicType != that.BasicType { + if this.Plugin != that.Plugin { return false } - if len(this.StructTags) != len(that.StructTags) { + if string(this.Options) != string(that.Options) { return false } - for i, vx := range this.StructTags { - vy, ok := that.StructTags[i] - if !ok { - return false - } - if vx != vy { - return false - } - } return string(this.unknownFields) == string(that.unknownFields) } -func (this *ParsedGoType) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*ParsedGoType) +func (this *Override) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Override) if !ok { return false } @@ -1313,6 +1249,20 @@ func (m *Override) MarshalToSizedBufferVT(dAtA []byte) (int, error) { 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] = 0x6a + } + 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] = 0x62 + } if m.Unsigned { i-- if m.Unsigned { @@ -1323,16 +1273,6 @@ func (m *Override) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x58 } - if m.GoType != nil { - size, err := m.GoType.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x52 - } if len(m.ColumnName) > 0 { i -= len(m.ColumnName) copy(dAtA[i:], m.ColumnName) @@ -1374,96 +1314,6 @@ func (m *Override) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if len(m.CodeType) > 0 { - i -= len(m.CodeType) - copy(dAtA[i:], m.CodeType) - i = encodeVarint(dAtA, i, uint64(len(m.CodeType))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ParsedGoType) 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 *ParsedGoType) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *ParsedGoType) 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.StructTags) > 0 { - for k := range m.StructTags { - v := m.StructTags[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x2a - } - } - if m.BasicType { - i-- - if m.BasicType { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.TypeName) > 0 { - i -= len(m.TypeName) - copy(dAtA[i:], m.TypeName) - i = encodeVarint(dAtA, i, uint64(len(m.TypeName))) - i-- - dAtA[i] = 0x1a - } - if len(m.Package) > 0 { - i -= len(m.Package) - copy(dAtA[i:], m.Package) - i = encodeVarint(dAtA, i, uint64(len(m.Package))) - i-- - dAtA[i] = 0x12 - } - if len(m.ImportPath) > 0 { - i -= len(m.ImportPath) - copy(dAtA[i:], m.ImportPath) - i = encodeVarint(dAtA, i, uint64(len(m.ImportPath))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } @@ -2647,6 +2497,20 @@ func (m *Override) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { 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] = 0x6a + } + 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] = 0x62 + } if m.Unsigned { i-- if m.Unsigned { @@ -2657,16 +2521,6 @@ func (m *Override) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i-- dAtA[i] = 0x58 } - if m.GoType != nil { - size, err := m.GoType.MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x52 - } if len(m.ColumnName) > 0 { i -= len(m.ColumnName) copy(dAtA[i:], m.ColumnName) @@ -2708,96 +2562,6 @@ func (m *Override) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if len(m.CodeType) > 0 { - i -= len(m.CodeType) - copy(dAtA[i:], m.CodeType) - i = encodeVarint(dAtA, i, uint64(len(m.CodeType))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ParsedGoType) MarshalVTStrict() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ParsedGoType) MarshalToVTStrict(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVTStrict(dAtA[:size]) -} - -func (m *ParsedGoType) MarshalToSizedBufferVTStrict(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.StructTags) > 0 { - for k := range m.StructTags { - v := m.StructTags[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x2a - } - } - if m.BasicType { - i-- - if m.BasicType { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.TypeName) > 0 { - i -= len(m.TypeName) - copy(dAtA[i:], m.TypeName) - i = encodeVarint(dAtA, i, uint64(len(m.TypeName))) - i-- - dAtA[i] = 0x1a - } - if len(m.Package) > 0 { - i -= len(m.Package) - copy(dAtA[i:], m.Package) - i = encodeVarint(dAtA, i, uint64(len(m.Package))) - i-- - dAtA[i] = 0x12 - } - if len(m.ImportPath) > 0 { - i -= len(m.ImportPath) - copy(dAtA[i:], m.ImportPath) - i = encodeVarint(dAtA, i, uint64(len(m.ImportPath))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } @@ -3917,10 +3681,6 @@ func (m *Override) SizeVT() (n int) { } var l int _ = l - l = len(m.CodeType) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } l = len(m.DbType) if l > 0 { n += 1 + l + sov(uint64(l)) @@ -3940,69 +3700,40 @@ func (m *Override) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } - if m.GoType != nil { - l = m.GoType.SizeVT() - n += 1 + l + sov(uint64(l)) - } if m.Unsigned { n += 2 } + 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)) + } n += len(m.unknownFields) return n } -func (m *ParsedGoType) SizeVT() (n int) { +func (m *Settings) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ImportPath) + l = len(m.Version) if l > 0 { n += 1 + l + sov(uint64(l)) } - l = len(m.Package) + l = len(m.Engine) if l > 0 { n += 1 + l + sov(uint64(l)) } - l = len(m.TypeName) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - if m.BasicType { - n += 2 - } - if len(m.StructTags) > 0 { - for k, v := range m.StructTags { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) - } - } - n += len(m.unknownFields) - return n -} - -func (m *Settings) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Version) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - l = len(m.Engine) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - if len(m.Schema) > 0 { - for _, s := range m.Schema { - l = len(s) - n += 1 + l + sov(uint64(l)) - } + if len(m.Schema) > 0 { + for _, s := range m.Schema { + l = len(s) + n += 1 + l + sov(uint64(l)) + } } if len(m.Queries) > 0 { for _, s := range m.Queries { @@ -4583,38 +4314,6 @@ func (m *Override) UnmarshalVT(dAtA []byte) error { return fmt.Errorf("proto: Override: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeType", 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.CodeType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DbType", wireType) @@ -4767,42 +4466,6 @@ func (m *Override) UnmarshalVT(dAtA []byte) error { } m.ColumnName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GoType", 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.GoType == nil { - m.GoType = &ParsedGoType{} - } - if err := m.GoType.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 11: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Unsigned", wireType) @@ -4823,124 +4486,9 @@ func (m *Override) UnmarshalVT(dAtA []byte) error { } } m.Unsigned = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ParsedGoType) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ParsedGoType: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ParsedGoType: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImportPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ImportPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Package", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Package = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TypeName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Plugin", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4968,33 +4516,13 @@ func (m *ParsedGoType) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TypeName = string(dAtA[iNdEx:postIndex]) + m.Plugin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BasicType", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.BasicType = bool(v != 0) - case 5: + case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StructTags", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -5004,118 +4532,25 @@ func (m *ParsedGoType) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if m.StructTags == nil { - m.StructTags = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := 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) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLength - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLength - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLength - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + m.Options = append(m.Options[:0], dAtA[iNdEx:postIndex]...) + if m.Options == nil { + m.Options = []byte{} } - m.StructTags[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex diff --git a/protos/plugin/codegen.proto b/protos/plugin/codegen.proto index 380ecf2777..7ac41a8bca 100644 --- a/protos/plugin/codegen.proto +++ b/protos/plugin/codegen.proto @@ -10,11 +10,10 @@ message File { } message Override { + // code_type string was field 1 // PythonType message was field 9 - reserved 9; - - // name of the type to use, e.g. `github.com/segmentio/ksuid.KSUID` or `mymodule.Type` - string code_type = 1 [json_name = "code_type"]; + // ParsedGoType message was field 10 + reserved 1, 9, 10; // name of the type to use, e.g. `text` string db_type = 3 [json_name = "db_type"]; @@ -29,25 +28,18 @@ message Override { string column_name = 8 [json_name = "column_name"]; - ParsedGoType go_type = 10; - // True if the override should apply to a unsigned database type bool unsigned = 11 [json_name = "unsigned"]; -} -message ParsedGoType { - string import_path = 1; - string package = 2; - string type_name = 3; - bool basic_type = 4; - map struct_tags = 5; + string plugin = 12 [json_name = "plugin"]; + bytes options = 13 [json_name = "options"]; } message Settings { // PythonCode message was field 8 // KotlinCode message was field 9 - // GoCode message was field 10; - // JSONCode message was field 11; + // GoCode message was field 10 + // JSONCode message was field 11 reserved 8, 9, 10, 11; string version = 1 [json_name = "version"];