From 6f6a3641b6f8fb5218672a5a021580dbaa54b401 Mon Sep 17 00:00:00 2001 From: Masahiro Sano Date: Wed, 10 Dec 2025 13:56:08 +0900 Subject: [PATCH 1/3] feat(exclude_columns): Add excluded columns to codegen output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add `excluded_columns` field to both Table and Query protobuf messages, allowing codegen plugins to access information about which columns were excluded from star expansion. Changes: - Add `IsExcluded` field to `catalog.Column` to track excluded state - Add `MarkExcludedColumns()` method to Compiler to mark columns after catalog parsing based on exclude_columns config - Add `ExcludedColumns` field to `compiler.Query` struct - Update `expand()` and `outputColumnsWithExcluded()` to return excluded columns separately from included columns - Update `pluginCatalog()` and `pluginQueries()` in shim.go to populate the new `excluded_columns` fields - Add proto definitions for `Table.excluded_columns` and `Query.excluded_columns` - Add E2E test for exclude_columns feature - Normalize JSON file paths in E2E tests for environment independence 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/cmd/shim.go | 26 +- internal/compiler/analyze.go | 53 +- internal/compiler/compile.go | 4 + internal/compiler/engine.go | 47 +- internal/compiler/exclude_columns.go | 48 ++ internal/compiler/exclude_columns_test.go | 113 +++ internal/compiler/expand.go | 31 +- internal/compiler/output_columns.go | 73 +- internal/compiler/parse.go | 1 + internal/compiler/query.go | 9 +- internal/config/config.go | 1 + internal/config/v_two.json | 7 + internal/endtoend/endtoend_test.go | 32 + .../testdata/codegen_json/gen/codegen.json | 653 ++++++++++++------ .../postgresql/pgx/v5/go/db.go | 32 + .../postgresql/pgx/v5/go/models.go | 21 + .../postgresql/pgx/v5/go/query.sql.go | 187 +++++ .../postgresql/pgx/v5/query.sql | 25 + .../postgresql/pgx/v5/schema.sql | 14 + .../postgresql/pgx/v5/sqlc.json | 22 + .../gen/codegen.json | 12 +- internal/plugin/codegen.pb.go | 457 ++++++------ internal/sql/catalog/table.go | 1 + protos/plugin/codegen.proto | 2 + 24 files changed, 1363 insertions(+), 508 deletions(-) create mode 100644 internal/compiler/exclude_columns.go create mode 100644 internal/compiler/exclude_columns_test.go create mode 100644 internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/go/db.go create mode 100644 internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/go/models.go create mode 100644 internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/go/query.sql.go create mode 100644 internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/query.sql create mode 100644 internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/schema.sql create mode 100644 internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/sqlc.json diff --git a/internal/cmd/shim.go b/internal/cmd/shim.go index 2c540723b..c463c418e 100644 --- a/internal/cmd/shim.go +++ b/internal/cmd/shim.go @@ -96,12 +96,13 @@ func pluginCatalog(c *catalog.Catalog) *plugin.Catalog { var tables []*plugin.Table for _, t := range s.Tables { var columns []*plugin.Column + var excludedCols []*plugin.Column for _, c := range t.Columns { l := -1 if c.Length != nil { l = *c.Length } - columns = append(columns, &plugin.Column{ + col := &plugin.Column{ Name: c.Name, Type: &plugin.Identifier{ Catalog: c.Type.Catalog, @@ -125,7 +126,12 @@ func pluginCatalog(c *catalog.Catalog) *plugin.Catalog { }, SourceLocation: pluginSourceLocation(c.SourceLocation), TypeMods: pluginTypeMods(c.Type.Typmods), - }) + } + if c.IsExcluded { + excludedCols = append(excludedCols, col) + } else { + columns = append(columns, col) + } } var indexes []*plugin.Index for _, idx := range t.Indexes { @@ -154,11 +160,12 @@ func pluginCatalog(c *catalog.Catalog) *plugin.Catalog { Schema: t.Rel.Schema, Name: t.Rel.Name, }, - Columns: columns, - Comment: t.Comment, - Indexes: indexes, - Constraints: pluginTableConstraints(t.Constraints), - SourceLocation: pluginSourceLocation(t.SourceLocation), + Columns: columns, + ExcludedColumns: excludedCols, + Comment: t.Comment, + Indexes: indexes, + Constraints: pluginTableConstraints(t.Constraints), + SourceLocation: pluginSourceLocation(t.SourceLocation), }) } schemas = append(schemas, &plugin.Schema{ @@ -256,9 +263,13 @@ func pluginQueries(r *compiler.Result) []*plugin.Query { for _, q := range r.Queries { var params []*plugin.Parameter var columns []*plugin.Column + var excludedColumns []*plugin.Column for _, c := range q.Columns { columns = append(columns, pluginQueryColumn(c)) } + for _, c := range q.ExcludedColumns { + excludedColumns = append(excludedColumns, pluginQueryColumn(c)) + } for _, p := range q.Params { params = append(params, pluginQueryParam(p)) } @@ -276,6 +287,7 @@ func pluginQueries(r *compiler.Result) []*plugin.Query { Text: q.SQL, Comments: q.Metadata.Comments, Columns: columns, + ExcludedColumns: excludedColumns, Params: params, Filename: q.Metadata.Filename, InsertIntoTable: iit, diff --git a/internal/compiler/analyze.go b/internal/compiler/analyze.go index 0d7d50757..987af5f74 100644 --- a/internal/compiler/analyze.go +++ b/internal/compiler/analyze.go @@ -13,11 +13,12 @@ import ( ) type analysis struct { - Table *ast.TableName - Columns []*Column - Parameters []Parameter - Named *named.ParamSet - Query string + Table *ast.TableName + Columns []*Column + ExcludedColumns []*Column + Parameters []Parameter + Named *named.ParamSet + Query string } func convertTableName(id *analyzer.Identifier) *ast.TableName { @@ -185,12 +186,12 @@ func (c *Compiler) _analyzeQuery(raw *ast.RawStmt, query string, failfast bool) if err := check(err); err != nil { return nil, err } - cols, err := c.outputColumns(qc, raw.Stmt) + cols, excludedFromOutput, err := c.outputColumnsWithExcluded(qc, raw.Stmt) if err := check(err); err != nil { return nil, err } - expandEdits, err := c.expand(qc, raw) + expandEdits, excludedFromExpand, err := c.expand(qc, raw) if check(err); err != nil { return nil, err } @@ -200,16 +201,44 @@ func (c *Compiler) _analyzeQuery(raw *ast.RawStmt, query string, failfast bool) return nil, err } + // Combine excluded columns from both outputColumns and expand. + // Note: This does not recursively collect excluded columns from subqueries, + // CTEs, or UNION clauses. Excluded columns are only collected from the + // top-level star expansions. + // Use a map to deduplicate based on table and column name. + excludedMap := make(map[string]*Column) + for _, col := range excludedFromOutput { + key := "" + if col.Table != nil { + key = col.Table.Schema + "." + col.Table.Name + "." + } + key += col.Name + excludedMap[key] = col + } + for _, col := range excludedFromExpand { + key := "" + if col.Table != nil { + key = col.Table.Schema + "." + col.Table.Name + "." + } + key += col.Name + excludedMap[key] = col + } + var excludedCols []*Column + for _, col := range excludedMap { + excludedCols = append(excludedCols, col) + } + var rerr error if len(errors) > 0 { rerr = errors[0] } return &analysis{ - Table: table, - Columns: cols, - Parameters: params, - Query: expanded, - Named: namedParams, + Table: table, + Columns: cols, + ExcludedColumns: excludedCols, + Parameters: params, + Query: expanded, + Named: namedParams, }, rerr } diff --git a/internal/compiler/compile.go b/internal/compiler/compile.go index 8bdc143dc..9e8d4786a 100644 --- a/internal/compiler/compile.go +++ b/internal/compiler/compile.go @@ -54,6 +54,10 @@ func (c *Compiler) parseCatalog(schemas []string) error { if len(merr.Errs()) > 0 { return merr } + + // Mark excluded columns in the catalog + c.MarkExcludedColumns() + return nil } diff --git a/internal/compiler/engine.go b/internal/compiler/engine.go index 75749cd6d..202982959 100644 --- a/internal/compiler/engine.go +++ b/internal/compiler/engine.go @@ -13,24 +13,30 @@ import ( "github.com/sqlc-dev/sqlc/internal/engine/sqlite" sqliteanalyze "github.com/sqlc-dev/sqlc/internal/engine/sqlite/analyzer" "github.com/sqlc-dev/sqlc/internal/opts" + "github.com/sqlc-dev/sqlc/internal/sql/ast" "github.com/sqlc-dev/sqlc/internal/sql/catalog" ) type Compiler struct { - conf config.SQL - combo config.CombinedSettings - catalog *catalog.Catalog - parser Parser - result *Result - analyzer analyzer.Analyzer - client dbmanager.Client - selector selector + conf config.SQL + combo config.CombinedSettings + catalog *catalog.Catalog + parser Parser + result *Result + analyzer analyzer.Analyzer + client dbmanager.Client + selector selector + excludeFilter *ExcludeColumnsFilter schema []string } func NewCompiler(conf config.SQL, combo config.CombinedSettings) (*Compiler, error) { - c := &Compiler{conf: conf, combo: combo} + c := &Compiler{ + conf: conf, + combo: combo, + excludeFilter: NewExcludeColumnsFilter(conf.ExcludeColumns), + } if conf.Database != nil && conf.Database.Managed { client := dbmanager.NewClient(combo.Global.Servers) @@ -103,3 +109,26 @@ func (c *Compiler) Close(ctx context.Context) { c.client.Close(ctx) } } + +// MarkExcludedColumns marks columns as excluded based on exclude_columns config. +// This should be called after ParseCatalog to set IsExcluded flag on catalog columns. +func (c *Compiler) MarkExcludedColumns() { + if c.excludeFilter == nil || len(c.conf.ExcludeColumns) == 0 { + return + } + + for _, schema := range c.catalog.Schemas { + for _, table := range schema.Tables { + tableName := &ast.TableName{ + Catalog: table.Rel.Catalog, + Schema: table.Rel.Schema, + Name: table.Rel.Name, + } + for _, col := range table.Columns { + if c.excludeFilter.ShouldExclude(tableName, col.Name) { + col.IsExcluded = true + } + } + } + } +} diff --git a/internal/compiler/exclude_columns.go b/internal/compiler/exclude_columns.go new file mode 100644 index 000000000..b063e1bd2 --- /dev/null +++ b/internal/compiler/exclude_columns.go @@ -0,0 +1,48 @@ +package compiler + +import ( + "strings" + + "github.com/sqlc-dev/sqlc/internal/sql/ast" +) + +// ExcludeColumnsFilter filters columns that should be excluded from star expansion. +type ExcludeColumnsFilter struct { + // excludeMap holds normalized (lowercase) column identifiers. + // Keys are in "table.column" or "schema.table.column" format. + excludeMap map[string]struct{} +} + +// NewExcludeColumnsFilter creates a new ExcludeColumnsFilter from a list of column identifiers. +// Each identifier should be in "table.column" or "schema.table.column" format. +func NewExcludeColumnsFilter(excludeColumns []string) *ExcludeColumnsFilter { + m := make(map[string]struct{}) + for _, col := range excludeColumns { + m[strings.ToLower(col)] = struct{}{} + } + return &ExcludeColumnsFilter{excludeMap: m} +} + +// ShouldExclude returns true if the specified column should be excluded from star expansion. +// tableName should be the actual table name (not an alias). +func (f *ExcludeColumnsFilter) ShouldExclude(tableName *ast.TableName, columnName string) bool { + if f == nil || len(f.excludeMap) == 0 || tableName == nil { + return false + } + + // Check "table.column" format + key := strings.ToLower(tableName.Name + "." + columnName) + if _, ok := f.excludeMap[key]; ok { + return true + } + + // Check "schema.table.column" format + if tableName.Schema != "" { + key = strings.ToLower(tableName.Schema + "." + tableName.Name + "." + columnName) + if _, ok := f.excludeMap[key]; ok { + return true + } + } + + return false +} diff --git a/internal/compiler/exclude_columns_test.go b/internal/compiler/exclude_columns_test.go new file mode 100644 index 000000000..b8f09556b --- /dev/null +++ b/internal/compiler/exclude_columns_test.go @@ -0,0 +1,113 @@ +package compiler + +import ( + "testing" + + "github.com/sqlc-dev/sqlc/internal/sql/ast" +) + +func TestExcludeColumnsFilter_ShouldExclude(t *testing.T) { + tests := []struct { + name string + excludeColumns []string + tableName *ast.TableName + columnName string + want bool + }{ + { + name: "table.column format matches", + excludeColumns: []string{"users.password"}, + tableName: &ast.TableName{Name: "users"}, + columnName: "password", + want: true, + }, + { + name: "table.column format does not match different column", + excludeColumns: []string{"users.password"}, + tableName: &ast.TableName{Name: "users"}, + columnName: "name", + want: false, + }, + { + name: "table.column format does not match different table", + excludeColumns: []string{"users.password"}, + tableName: &ast.TableName{Name: "admins"}, + columnName: "password", + want: false, + }, + { + name: "schema.table.column format matches", + excludeColumns: []string{"public.users.password"}, + tableName: &ast.TableName{Schema: "public", Name: "users"}, + columnName: "password", + want: true, + }, + { + name: "schema.table.column format does not match different schema", + excludeColumns: []string{"public.users.password"}, + tableName: &ast.TableName{Schema: "private", Name: "users"}, + columnName: "password", + want: false, + }, + { + name: "case insensitive match", + excludeColumns: []string{"Users.Password"}, + tableName: &ast.TableName{Name: "users"}, + columnName: "password", + want: true, + }, + { + name: "case insensitive match with schema", + excludeColumns: []string{"Public.Users.Password"}, + tableName: &ast.TableName{Schema: "public", Name: "users"}, + columnName: "password", + want: true, + }, + { + name: "empty filter excludes nothing", + excludeColumns: []string{}, + tableName: &ast.TableName{Name: "users"}, + columnName: "password", + want: false, + }, + { + name: "nil table name excludes nothing", + excludeColumns: []string{"users.password"}, + tableName: nil, + columnName: "password", + want: false, + }, + { + name: "multiple exclusions", + excludeColumns: []string{"users.password", "users.ssn", "accounts.secret"}, + tableName: &ast.TableName{Name: "users"}, + columnName: "ssn", + want: true, + }, + { + name: "table.column matches even when schema present in tableName", + excludeColumns: []string{"users.password"}, + tableName: &ast.TableName{Schema: "public", Name: "users"}, + columnName: "password", + want: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + filter := NewExcludeColumnsFilter(tt.excludeColumns) + got := filter.ShouldExclude(tt.tableName, tt.columnName) + if got != tt.want { + t.Errorf("ShouldExclude() = %v, want %v", got, tt.want) + } + }) + } +} + +func TestExcludeColumnsFilter_NilFilter(t *testing.T) { + var filter *ExcludeColumnsFilter + got := filter.ShouldExclude(&ast.TableName{Name: "users"}, "password") + if got != false { + t.Errorf("ShouldExclude() on nil filter = %v, want false", got) + } +} diff --git a/internal/compiler/expand.go b/internal/compiler/expand.go index c60b7618b..a4ec38d73 100644 --- a/internal/compiler/expand.go +++ b/internal/compiler/expand.go @@ -11,14 +11,14 @@ import ( "github.com/sqlc-dev/sqlc/internal/sql/astutils" ) -func (c *Compiler) expand(qc *QueryCatalog, raw *ast.RawStmt) ([]source.Edit, error) { +func (c *Compiler) expand(qc *QueryCatalog, raw *ast.RawStmt) ([]source.Edit, []*Column, error) { // Return early if there are no A_Star nodes to expand stars := astutils.Search(raw, func(node ast.Node) bool { _, ok := node.(*ast.A_Star) return ok }) if len(stars.Items) == 0 { - return nil, nil + return nil, nil, nil } list := astutils.Search(raw, func(node ast.Node) bool { switch node.(type) { @@ -32,17 +32,19 @@ func (c *Compiler) expand(qc *QueryCatalog, raw *ast.RawStmt) ([]source.Edit, er return true }) if len(list.Items) == 0 { - return nil, nil + return nil, nil, nil } var edits []source.Edit + var excludedCols []*Column for _, item := range list.Items { - edit, err := c.expandStmt(qc, raw, item) + edit, excluded, err := c.expandStmt(qc, raw, item) if err != nil { - return nil, err + return nil, nil, err } edits = append(edits, edit...) + excludedCols = append(excludedCols, excluded...) } - return edits, nil + return edits, excludedCols, nil } var validPostgresIdent = regexp.MustCompile(`^[a-z_][a-z0-9_$]*$`) @@ -78,10 +80,10 @@ func (c *Compiler) quote(x string) string { } } -func (c *Compiler) expandStmt(qc *QueryCatalog, raw *ast.RawStmt, node ast.Node) ([]source.Edit, error) { +func (c *Compiler) expandStmt(qc *QueryCatalog, raw *ast.RawStmt, node ast.Node) ([]source.Edit, []*Column, error) { tables, err := c.sourceTables(qc, node) if err != nil { - return nil, err + return nil, nil, err } var targets *ast.List @@ -95,10 +97,11 @@ func (c *Compiler) expandStmt(qc *QueryCatalog, raw *ast.RawStmt, node ast.Node) case *ast.UpdateStmt: targets = n.ReturningList default: - return nil, fmt.Errorf("outputColumns: unsupported node type: %T", n) + return nil, nil, fmt.Errorf("outputColumns: unsupported node type: %T", n) } var edits []source.Edit + var excludedCols []*Column for _, target := range targets.Items { res, ok := target.(*ast.ResTarget) if !ok { @@ -119,7 +122,7 @@ func (c *Compiler) expandStmt(qc *QueryCatalog, raw *ast.RawStmt, node ast.Node) case *ast.A_Star: parts = append(parts, "*") default: - return nil, fmt.Errorf("unknown field in ColumnRef: %T", f) + return nil, nil, fmt.Errorf("unknown field in ColumnRef: %T", f) } } scope := astutils.Join(ref.Fields, ".") @@ -138,6 +141,12 @@ func (c *Compiler) expandStmt(qc *QueryCatalog, raw *ast.RawStmt, node ast.Node) tableName := c.quoteIdent(t.Rel.Name) scopeName := c.quoteIdent(scope) for _, column := range t.Columns { + // Collect excluded columns and skip them from expansion + if c.excludeFilter.ShouldExclude(column.Table, column.Name) { + excludedCols = append(excludedCols, column) + continue + } + cname := column.Name if res.Name != nil { cname = *res.Name @@ -199,5 +208,5 @@ func (c *Compiler) expandStmt(qc *QueryCatalog, raw *ast.RawStmt, node ast.Node) }) } - return edits, nil + return edits, excludedCols, nil } diff --git a/internal/compiler/output_columns.go b/internal/compiler/output_columns.go index dbd486359..23ee2fce6 100644 --- a/internal/compiler/output_columns.go +++ b/internal/compiler/output_columns.go @@ -52,9 +52,16 @@ func hasStarRef(cf *ast.ColumnRef) bool { // Return an error if column references are ambiguous // Return an error if column references don't exist func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, error) { + cols, _, err := c.outputColumnsWithExcluded(qc, node) + return cols, err +} + +// outputColumnsWithExcluded computes the output columns for a statement and also +// returns columns that were excluded via exclude_columns configuration. +func (c *Compiler) outputColumnsWithExcluded(qc *QueryCatalog, node ast.Node) ([]*Column, []*Column, error) { tables, err := c.sourceTables(qc, node) if err != nil { - return nil, err + return nil, nil, err } targets := &ast.List{} @@ -70,7 +77,7 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er if n.GroupClause != nil { for _, item := range n.GroupClause.Items { if err := findColumnForNode(item, tables, targets); err != nil { - return nil, err + return nil, nil, err } } } @@ -86,7 +93,7 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er continue } if err := findColumnForNode(sb.Node, tables, targets); err != nil { - return nil, fmt.Errorf("%v: if you want to skip this validation, set 'strict_order_by' to false", err) + return nil, nil, fmt.Errorf("%v: if you want to skip this validation, set 'strict_order_by' to false", err) } } } @@ -102,7 +109,7 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er continue } if err := findColumnForNode(caseExpr.Xpr, tables, targets); err != nil { - return nil, fmt.Errorf("%v: if you want to skip this validation, set 'strict_order_by' to false", err) + return nil, nil, fmt.Errorf("%v: if you want to skip this validation, set 'strict_order_by' to false", err) } } } @@ -112,13 +119,14 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er // For UNION queries, targets is empty and we need to look for the // columns in Largs. if isUnion { - return c.outputColumns(qc, n.Larg) + return c.outputColumnsWithExcluded(qc, n.Larg) } case *ast.UpdateStmt: targets = n.ReturningList } var cols []*Column + var excludedCols []*Column for _, target := range targets.Items { res, ok := target.(*ast.ResTarget) @@ -191,7 +199,7 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er // need a recurse function to get the type of a node. if tc, ok := n.Defresult.(*ast.TypeCast); ok { if tc.TypeName == nil { - return nil, errors.New("no type name type cast") + return nil, nil, errors.New("no type name type cast") } name := "" if ref, ok := tc.Arg.(*ast.ColumnRef); ok { @@ -236,7 +244,7 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er if ref, ok := arg.(*ast.ColumnRef); ok { columns, err := outputColumnRefs(res, tables, ref) if err != nil { - return nil, err + return nil, nil, err } for _, c := range columns { if firstColumn == nil { @@ -272,24 +280,43 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er if scope != "" && scope != t.Rel.Name { continue } - for _, c := range t.Columns { - cname := c.Name + for _, col := range t.Columns { + // Collect excluded columns and skip them from output + if c.excludeFilter.ShouldExclude(col.Table, col.Name) { + excludedCols = append(excludedCols, &Column{ + Name: col.Name, + OriginalName: col.Name, + Type: col.Type, + Scope: scope, + Table: col.Table, + TableAlias: t.Rel.Name, + DataType: col.DataType, + NotNull: col.NotNull, + Unsigned: col.Unsigned, + IsArray: col.IsArray, + ArrayDims: col.ArrayDims, + Length: col.Length, + }) + continue + } + + cname := col.Name if res.Name != nil { cname = *res.Name } cols = append(cols, &Column{ Name: cname, - OriginalName: c.Name, - Type: c.Type, + OriginalName: col.Name, + Type: col.Type, Scope: scope, - Table: c.Table, + Table: col.Table, TableAlias: t.Rel.Name, - DataType: c.DataType, - NotNull: c.NotNull, - Unsigned: c.Unsigned, - IsArray: c.IsArray, - ArrayDims: c.ArrayDims, - Length: c.Length, + DataType: col.DataType, + NotNull: col.NotNull, + Unsigned: col.Unsigned, + IsArray: col.IsArray, + ArrayDims: col.ArrayDims, + Length: col.Length, }) } } @@ -298,7 +325,7 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er columns, err := outputColumnRefs(res, tables, n) if err != nil { - return nil, err + return nil, nil, err } cols = append(cols, columns...) @@ -335,7 +362,7 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er case ast.EXPR_SUBLINK: subcols, err := c.outputColumns(qc, n.Subselect) if err != nil { - return nil, err + return nil, nil, err } first := subcols[0] if res.Name != nil { @@ -348,7 +375,7 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er case *ast.TypeCast: if n.TypeName == nil { - return nil, errors.New("no type name type cast") + return nil, nil, errors.New("no type name type cast") } name := "" if ref, ok := n.Arg.(*ast.ColumnRef); ok { @@ -371,7 +398,7 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er case *ast.SelectStmt: subcols, err := c.outputColumns(qc, n) if err != nil { - return nil, err + return nil, nil, err } first := subcols[0] if res.Name != nil { @@ -404,7 +431,7 @@ func (c *Compiler) outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, er } } - return cols, nil + return cols, excludedCols, nil } const ( diff --git a/internal/compiler/parse.go b/internal/compiler/parse.go index 924dbc5c9..fbece6d70 100644 --- a/internal/compiler/parse.go +++ b/internal/compiler/parse.go @@ -127,6 +127,7 @@ func (c *Compiler) parseQuery(stmt ast.Node, src string, filename string, o opts Metadata: md, Params: anlys.Parameters, Columns: anlys.Columns, + ExcludedColumns: anlys.ExcludedColumns, SQL: trimmed, InsertIntoTable: anlys.Table, }, nil diff --git a/internal/compiler/query.go b/internal/compiler/query.go index b3cf9d615..f7610af9a 100644 --- a/internal/compiler/query.go +++ b/internal/compiler/query.go @@ -43,10 +43,11 @@ type Column struct { } type Query struct { - SQL string - Metadata metadata.Metadata - Columns []*Column - Params []Parameter + SQL string + Metadata metadata.Metadata + Columns []*Column + ExcludedColumns []*Column + Params []Parameter // Needed for CopyFrom InsertIntoTable *ast.TableName diff --git a/internal/config/config.go b/internal/config/config.go index 0ff805fcc..dd596ad5a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -120,6 +120,7 @@ type SQL struct { Codegen []Codegen `json:"codegen" yaml:"codegen"` Rules []string `json:"rules" yaml:"rules"` Analyzer Analyzer `json:"analyzer" yaml:"analyzer"` + ExcludeColumns []string `json:"exclude_columns" yaml:"exclude_columns"` } type Analyzer struct { diff --git a/internal/config/v_two.json b/internal/config/v_two.json index acf914997..3893fa14c 100644 --- a/internal/config/v_two.json +++ b/internal/config/v_two.json @@ -302,6 +302,13 @@ "items": { "type": "string" } + }, + "exclude_columns": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Columns to exclude from star expansion. Format: table.column or schema.table.column" } } } diff --git a/internal/endtoend/endtoend_test.go b/internal/endtoend/endtoend_test.go index 537307e45..81b71967c 100644 --- a/internal/endtoend/endtoend_test.go +++ b/internal/endtoend/endtoend_test.go @@ -6,6 +6,7 @@ import ( "os" osexec "os/exec" "path/filepath" + "regexp" "runtime" "slices" "strings" @@ -34,6 +35,30 @@ func stderrTransformer() cmp.Option { }) } +// normalizeJSONPaths normalizes absolute file paths in JSON content to make tests +// environment-independent. It replaces paths like "/home/user/.../sqlc/internal/..." +// with "/sqlc/internal/..." by finding the "sqlc" directory in the path. +func normalizeJSONPaths(content string) string { + // Match JSON string values containing absolute paths with "sqlc" in them + // Pattern: "filename": "/path/to/sqlc/..." + re := regexp.MustCompile(`"filename":\s*"([^"]*?/sqlc/[^"]*)"`) + return re.ReplaceAllStringFunc(content, func(match string) string { + // Extract the path and normalize it + submatch := re.FindStringSubmatch(match) + if len(submatch) < 2 { + return match + } + fullPath := submatch[1] + // Find "sqlc" in the path and keep everything from there + idx := strings.Index(fullPath, "/sqlc/") + if idx == -1 { + return match + } + normalizedPath := fullPath[idx:] + return `"filename": "` + normalizedPath + `"` + }) +} + func TestExamples(t *testing.T) { t.Parallel() ctx := context.Background() @@ -303,6 +328,13 @@ func cmpDirectory(t *testing.T, dir string, actual map[string]string) { t.Fatal(err) } + // Normalize JSON file paths in actual output to make tests environment-independent + for name, content := range actual { + if strings.HasSuffix(name, ".json") { + actual[name] = normalizeJSONPaths(content) + } + } + opts := []cmp.Option{ cmpopts.EquateEmpty(), lineEndings(), diff --git a/internal/endtoend/testdata/codegen_json/gen/codegen.json b/internal/endtoend/testdata/codegen_json/gen/codegen.json index 54b864b09..2f4db61a7 100644 --- a/internal/endtoend/testdata/codegen_json/gen/codegen.json +++ b/internal/endtoend/testdata/codegen_json/gen/codegen.json @@ -63,7 +63,7 @@ "unsigned": false, "array_dims": 0, "source_location": { - "filename": "/home/kazegusuri/go/src/github.com/kazegusuri/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", + "filename": "/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", "start_line": 2, "start_column": 10, "end_line": 0, @@ -104,7 +104,7 @@ "unsigned": false, "array_dims": 0, "source_location": { - "filename": "/home/kazegusuri/go/src/github.com/kazegusuri/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", + "filename": "/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", "start_line": 3, "start_column": 10, "end_line": 0, @@ -145,7 +145,7 @@ "unsigned": false, "array_dims": 0, "source_location": { - "filename": "/home/kazegusuri/go/src/github.com/kazegusuri/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", + "filename": "/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", "start_line": 4, "start_column": 10, "end_line": 0, @@ -179,7 +179,7 @@ "foreign_keys": [] }, "source_location": { - "filename": "/home/kazegusuri/go/src/github.com/kazegusuri/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", + "filename": "/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", "start_line": 1, "start_column": 0, "end_line": 0, @@ -187,7 +187,8 @@ "LeadingDetachedComments": [], "LeadingComments": " author", "TrailingComments": "" - } + }, + "excluded_columns": [] } ], "enums": [ @@ -202,7 +203,7 @@ { "value": "online", "source_location": { - "filename": "/home/kazegusuri/go/src/github.com/kazegusuri/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", + "filename": "/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", "start_line": 9, "start_column": 10, "end_line": 0, @@ -215,7 +216,7 @@ { "value": "offline", "source_location": { - "filename": "/home/kazegusuri/go/src/github.com/kazegusuri/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", + "filename": "/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", "start_line": 10, "start_column": 10, "end_line": 0, @@ -227,7 +228,7 @@ } ], "source_location": { - "filename": "/home/kazegusuri/go/src/github.com/kazegusuri/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", + "filename": "/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", "start_line": 8, "start_column": 0, "end_line": 0, @@ -1160,7 +1161,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -1493,7 +1495,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -1986,7 +1989,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -2383,7 +2387,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -2716,7 +2721,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -3753,7 +3759,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -4086,7 +4093,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -4675,7 +4683,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -4976,7 +4985,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -5117,7 +5127,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -5418,7 +5429,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -5815,7 +5827,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -7076,7 +7089,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -7633,7 +7647,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -7710,7 +7725,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -8747,7 +8763,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -9208,7 +9225,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -9413,7 +9431,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -10130,7 +10149,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -10431,7 +10451,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -10796,7 +10817,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -11225,7 +11247,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -11558,7 +11581,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -11891,7 +11915,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -12320,7 +12345,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -12781,7 +12807,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -13018,7 +13045,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -13447,7 +13475,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -13908,7 +13937,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -14209,7 +14239,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -14318,7 +14349,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -14619,7 +14651,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -14792,7 +14825,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -15669,7 +15703,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -15842,7 +15877,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -16175,7 +16211,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -16540,7 +16577,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -17033,7 +17071,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -17334,7 +17373,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -17635,7 +17675,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -18160,7 +18201,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -18397,7 +18439,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -18730,7 +18773,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -19223,7 +19267,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -19908,7 +19953,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -20273,7 +20319,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -20574,7 +20621,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -21035,7 +21083,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -21304,7 +21353,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -21765,7 +21815,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -22002,7 +22053,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -22175,7 +22227,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -23340,7 +23393,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -23833,7 +23887,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -24134,7 +24189,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -24499,7 +24555,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -24672,7 +24729,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -25101,7 +25159,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -25370,7 +25429,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -25511,7 +25571,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -26004,7 +26065,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -26465,7 +26527,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -26894,7 +26957,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -27035,7 +27099,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -27400,7 +27465,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -27669,7 +27735,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -28130,7 +28197,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -28495,7 +28563,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -29052,7 +29121,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -29353,7 +29423,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -29782,7 +29853,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -30083,7 +30155,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -30224,7 +30297,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -30557,7 +30631,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -31274,7 +31349,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -31543,7 +31619,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -32292,7 +32369,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -32529,7 +32607,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -32894,7 +32973,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -33803,7 +33883,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -34040,7 +34121,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -34181,7 +34263,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -34578,7 +34661,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -34783,7 +34867,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -35180,7 +35265,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -35513,7 +35599,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -36038,7 +36125,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -36403,7 +36491,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -36736,7 +36825,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -37389,7 +37479,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -37722,7 +37813,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -38023,7 +38115,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -38292,7 +38385,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -38593,7 +38687,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -38766,7 +38861,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -39035,7 +39131,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -39784,7 +39881,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -39989,7 +40087,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -40258,7 +40357,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -41007,7 +41107,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -41308,7 +41409,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -41801,7 +41903,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -42166,7 +42269,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -42531,7 +42635,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -42736,7 +42841,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -43101,7 +43207,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -43338,7 +43445,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -43511,7 +43619,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -43876,7 +43985,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -44113,7 +44223,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -44286,7 +44397,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -44651,7 +44763,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -44888,7 +45001,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -45061,7 +45175,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -45426,7 +45541,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -46623,7 +46739,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -47116,7 +47233,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -47513,7 +47631,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -47974,7 +48093,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -48467,7 +48587,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -49024,7 +49145,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -49677,7 +49799,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -50010,7 +50133,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -50279,7 +50403,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -50644,7 +50769,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -50753,7 +50879,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -50894,7 +51021,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -51259,7 +51387,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -52072,7 +52201,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -52437,7 +52567,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -52770,7 +52901,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -53167,7 +53299,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -53628,7 +53761,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -53993,7 +54127,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -55222,7 +55357,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -55523,7 +55659,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -55856,7 +55993,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -56061,7 +56199,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -56202,7 +56341,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] } ], "enums": [], @@ -56448,7 +56588,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -56749,7 +56890,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -56890,7 +57032,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -57127,7 +57270,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -57364,7 +57508,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -57473,7 +57618,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -57582,7 +57728,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -58587,7 +58734,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -58856,7 +59004,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -59061,7 +59210,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -59202,7 +59352,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -59407,7 +59558,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -59548,7 +59700,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -59721,7 +59874,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -59958,7 +60112,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -60163,7 +60318,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -60432,7 +60588,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -60669,7 +60826,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -62090,7 +62248,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -62327,7 +62486,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -62532,7 +62692,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -62705,7 +62866,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -62974,7 +63136,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -63179,7 +63342,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -64056,7 +64220,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -64997,7 +65162,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -65042,7 +65208,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -65183,7 +65350,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -65356,7 +65524,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -65497,7 +65666,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -65734,7 +65904,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -65907,7 +66078,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -66080,7 +66252,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -66125,7 +66298,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -66426,7 +66600,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -67463,7 +67638,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -67764,7 +67940,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -68033,7 +68210,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -68366,7 +68544,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -68635,7 +68814,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -68872,7 +69052,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -69141,7 +69322,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -69474,7 +69656,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -69807,7 +69990,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -70012,7 +70196,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -70313,7 +70498,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -70614,7 +70800,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -73251,7 +73438,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -73488,7 +73676,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -73885,7 +74074,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -74314,7 +74504,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -74679,7 +74870,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -75044,7 +75236,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -75377,7 +75570,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -75742,7 +75936,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -76011,7 +76206,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -76408,7 +76604,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -76677,7 +76874,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -76914,7 +77112,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -77471,7 +77670,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -77708,7 +77908,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -77977,7 +78178,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -78918,7 +79120,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -79091,7 +79294,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -79200,7 +79404,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -79437,7 +79642,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -79642,7 +79848,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -79847,7 +80054,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -80180,7 +80388,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] } ], "enums": [], @@ -80331,7 +80540,8 @@ ], "comments": [], "filename": "query.sql", - "insert_into_table": null + "insert_into_table": null, + "excluded_columns": [] }, { "text": "SELECT id, name, bio FROM authors\nORDER BY name", @@ -80438,7 +80648,8 @@ "params": [], "comments": [], "filename": "query.sql", - "insert_into_table": null + "insert_into_table": null, + "excluded_columns": [] }, { "text": "INSERT INTO authors (\n name, bio\n) VALUES (\n $1, $2\n)\nRETURNING id, name, bio", @@ -80620,7 +80831,8 @@ "catalog": "", "schema": "", "name": "authors" - } + }, + "excluded_columns": [] }, { "text": "DELETE FROM authors\nWHERE id = $1", @@ -80666,7 +80878,8 @@ ], "comments": [], "filename": "query.sql", - "insert_into_table": null + "insert_into_table": null, + "excluded_columns": [] } ], "sqlc_version": "v1.30.0", diff --git a/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/go/db.go b/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/go/db.go new file mode 100644 index 000000000..1e0054971 --- /dev/null +++ b/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/go/db.go @@ -0,0 +1,32 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.30.0 + +package querytest + +import ( + "context" + + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgconn" +) + +type DBTX interface { + Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow(context.Context, string, ...interface{}) pgx.Row +} + +func New(db DBTX) *Queries { + return &Queries{db: db} +} + +type Queries struct { + db DBTX +} + +func (q *Queries) WithTx(tx pgx.Tx) *Queries { + return &Queries{ + db: tx, + } +} diff --git a/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/go/models.go b/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/go/models.go new file mode 100644 index 000000000..298bbe78e --- /dev/null +++ b/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/go/models.go @@ -0,0 +1,21 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.30.0 + +package querytest + +import ( + "github.com/jackc/pgx/v5/pgtype" +) + +type Account struct { + ID int32 + UserID int32 + Balance pgtype.Numeric +} + +type User struct { + ID int32 + Name string + Email string +} diff --git a/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/go/query.sql.go b/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/go/query.sql.go new file mode 100644 index 000000000..00a69096d --- /dev/null +++ b/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/go/query.sql.go @@ -0,0 +1,187 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.30.0 +// source: query.sql + +package querytest + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" +) + +const createUser = `-- name: CreateUser :one +INSERT INTO users (name, email, password, ssn) +VALUES ($1, $2, $3, $4) +RETURNING id, name, email +` + +type CreateUserParams struct { + Name string + Email string + Password string + Ssn pgtype.Text +} + +func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) { + row := q.db.QueryRow(ctx, createUser, + arg.Name, + arg.Email, + arg.Password, + arg.Ssn, + ) + var i User + err := row.Scan(&i.ID, &i.Name, &i.Email) + return i, err +} + +const deleteUser = `-- name: DeleteUser :one +DELETE FROM users WHERE id = $1 RETURNING id, name, email +` + +func (q *Queries) DeleteUser(ctx context.Context, id int32) (User, error) { + row := q.db.QueryRow(ctx, deleteUser, id) + var i User + err := row.Scan(&i.ID, &i.Name, &i.Email) + return i, err +} + +const getAllAccounts = `-- name: GetAllAccounts :many +SELECT id, user_id, balance FROM accounts +` + +func (q *Queries) GetAllAccounts(ctx context.Context) ([]Account, error) { + rows, err := q.db.Query(ctx, getAllAccounts) + if err != nil { + return nil, err + } + defer rows.Close() + var items []Account + for rows.Next() { + var i Account + if err := rows.Scan(&i.ID, &i.UserID, &i.Balance); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getAllUsers = `-- name: GetAllUsers :many +SELECT id, name, email FROM users +` + +func (q *Queries) GetAllUsers(ctx context.Context) ([]User, error) { + rows, err := q.db.Query(ctx, getAllUsers) + if err != nil { + return nil, err + } + defer rows.Close() + var items []User + for rows.Next() { + var i User + if err := rows.Scan(&i.ID, &i.Name, &i.Email); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getUserAndAccount = `-- name: GetUserAndAccount :many +SELECT users.id, users.name, users.email, accounts.id, accounts.user_id, accounts.balance FROM users JOIN accounts ON users.id = accounts.user_id +` + +type GetUserAndAccountRow struct { + ID int32 + Name string + Email string + ID_2 int32 + UserID int32 + Balance pgtype.Numeric +} + +func (q *Queries) GetUserAndAccount(ctx context.Context) ([]GetUserAndAccountRow, error) { + rows, err := q.db.Query(ctx, getUserAndAccount) + if err != nil { + return nil, err + } + defer rows.Close() + var items []GetUserAndAccountRow + for rows.Next() { + var i GetUserAndAccountRow + if err := rows.Scan( + &i.ID, + &i.Name, + &i.Email, + &i.ID_2, + &i.UserID, + &i.Balance, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getUserByID = `-- name: GetUserByID :one +SELECT id, name, email FROM users WHERE id = $1 +` + +func (q *Queries) GetUserByID(ctx context.Context, id int32) (User, error) { + row := q.db.QueryRow(ctx, getUserByID, id) + var i User + err := row.Scan(&i.ID, &i.Name, &i.Email) + return i, err +} + +const getUserWithAlias = `-- name: GetUserWithAlias :many +SELECT u.id, u.name, u.email FROM users u +` + +func (q *Queries) GetUserWithAlias(ctx context.Context) ([]User, error) { + rows, err := q.db.Query(ctx, getUserWithAlias) + if err != nil { + return nil, err + } + defer rows.Close() + var items []User + for rows.Next() { + var i User + if err := rows.Scan(&i.ID, &i.Name, &i.Email); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const updateUser = `-- name: UpdateUser :one +UPDATE users SET name = $2 WHERE id = $1 RETURNING id, name, email +` + +type UpdateUserParams struct { + ID int32 + Name string +} + +func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error) { + row := q.db.QueryRow(ctx, updateUser, arg.ID, arg.Name) + var i User + err := row.Scan(&i.ID, &i.Name, &i.Email) + return i, err +} diff --git a/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/query.sql b/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/query.sql new file mode 100644 index 000000000..c144ea503 --- /dev/null +++ b/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/query.sql @@ -0,0 +1,25 @@ +-- name: GetAllUsers :many +SELECT * FROM users; + +-- name: GetUserByID :one +SELECT * FROM users WHERE id = $1; + +-- name: GetUserWithAlias :many +SELECT u.* FROM users u; + +-- name: CreateUser :one +INSERT INTO users (name, email, password, ssn) +VALUES ($1, $2, $3, $4) +RETURNING *; + +-- name: UpdateUser :one +UPDATE users SET name = $2 WHERE id = $1 RETURNING *; + +-- name: DeleteUser :one +DELETE FROM users WHERE id = $1 RETURNING *; + +-- name: GetAllAccounts :many +SELECT * FROM accounts; + +-- name: GetUserAndAccount :many +SELECT users.*, accounts.* FROM users JOIN accounts ON users.id = accounts.user_id; diff --git a/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/schema.sql b/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/schema.sql new file mode 100644 index 000000000..cae2fe98a --- /dev/null +++ b/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/schema.sql @@ -0,0 +1,14 @@ +CREATE TABLE users ( + id SERIAL PRIMARY KEY, + name TEXT NOT NULL, + email TEXT NOT NULL, + password TEXT NOT NULL, + ssn TEXT +); + +CREATE TABLE accounts ( + id SERIAL PRIMARY KEY, + user_id INTEGER NOT NULL REFERENCES users(id), + balance NUMERIC NOT NULL, + secret_key TEXT +); diff --git a/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/sqlc.json b/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/sqlc.json new file mode 100644 index 000000000..78896252b --- /dev/null +++ b/internal/endtoend/testdata/exclude_columns/postgresql/pgx/v5/sqlc.json @@ -0,0 +1,22 @@ +{ + "version": "2", + "sql": [ + { + "engine": "postgresql", + "schema": "schema.sql", + "queries": "query.sql", + "exclude_columns": [ + "users.password", + "users.ssn", + "accounts.secret_key" + ], + "gen": { + "go": { + "package": "querytest", + "sql_package": "pgx/v5", + "out": "go" + } + } + } + ] +} diff --git a/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json b/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json index 8a2f8d8a6..16060e9d4 100644 --- a/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json +++ b/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json @@ -65,7 +65,7 @@ "unsigned": false, "array_dims": 0, "source_location": { - "filename": "/home/kazegusuri/go/src/github.com/kazegusuri/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", + "filename": "/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", "start_line": 1, "start_column": 10, "end_line": 0, @@ -106,7 +106,7 @@ "unsigned": false, "array_dims": 0, "source_location": { - "filename": "/home/kazegusuri/go/src/github.com/kazegusuri/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", + "filename": "/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", "start_line": 2, "start_column": 10, "end_line": 0, @@ -147,7 +147,7 @@ "unsigned": false, "array_dims": 0, "source_location": { - "filename": "/home/kazegusuri/go/src/github.com/kazegusuri/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", + "filename": "/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", "start_line": 3, "start_column": 10, "end_line": 0, @@ -188,7 +188,7 @@ "is_unique": true, "is_primary": false, "source_location": { - "filename": "/home/kazegusuri/go/src/github.com/kazegusuri/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", + "filename": "/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", "start_line": 6, "start_column": 0, "end_line": 0, @@ -212,7 +212,7 @@ "is_unique": false, "is_primary": false, "source_location": { - "filename": "/home/kazegusuri/go/src/github.com/kazegusuri/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", + "filename": "/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", "start_line": 8, "start_column": 0, "end_line": 0, @@ -229,7 +229,7 @@ "foreign_keys": [] }, "source_location": { - "filename": "/home/kazegusuri/go/src/github.com/kazegusuri/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", + "filename": "/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", "start_line": 0, "start_column": 0, "end_line": 0, diff --git a/internal/plugin/codegen.pb.go b/internal/plugin/codegen.pb.go index b51adc010..2830e241a 100644 --- a/internal/plugin/codegen.pb.go +++ b/internal/plugin/codegen.pb.go @@ -700,12 +700,13 @@ type Table struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Rel *Identifier `protobuf:"bytes,1,opt,name=rel,proto3" json:"rel,omitempty"` - Columns []*Column `protobuf:"bytes,2,rep,name=columns,proto3" json:"columns,omitempty"` - Comment string `protobuf:"bytes,3,opt,name=comment,proto3" json:"comment,omitempty"` - Indexes []*Index `protobuf:"bytes,4,rep,name=indexes,proto3" json:"indexes,omitempty"` - Constraints *TableConstraints `protobuf:"bytes,6,opt,name=constraints,proto3" json:"constraints,omitempty"` - SourceLocation *SourceLocation `protobuf:"bytes,5,opt,name=source_location,json=sourceLocation,proto3" json:"source_location,omitempty"` + Rel *Identifier `protobuf:"bytes,1,opt,name=rel,proto3" json:"rel,omitempty"` + Columns []*Column `protobuf:"bytes,2,rep,name=columns,proto3" json:"columns,omitempty"` + Comment string `protobuf:"bytes,3,opt,name=comment,proto3" json:"comment,omitempty"` + Indexes []*Index `protobuf:"bytes,4,rep,name=indexes,proto3" json:"indexes,omitempty"` + Constraints *TableConstraints `protobuf:"bytes,6,opt,name=constraints,proto3" json:"constraints,omitempty"` + SourceLocation *SourceLocation `protobuf:"bytes,5,opt,name=source_location,json=sourceLocation,proto3" json:"source_location,omitempty"` + ExcludedColumns []*Column `protobuf:"bytes,7,rep,name=excluded_columns,json=excludedColumns,proto3" json:"excluded_columns,omitempty"` } func (x *Table) Reset() { @@ -782,6 +783,13 @@ func (x *Table) GetSourceLocation() *SourceLocation { return nil } +func (x *Table) GetExcludedColumns() []*Column { + if x != nil { + return x.ExcludedColumns + } + return nil +} + type Index struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1445,6 +1453,7 @@ type Query struct { Comments []string `protobuf:"bytes,6,rep,name=comments,proto3" json:"comments,omitempty"` Filename string `protobuf:"bytes,7,opt,name=filename,proto3" json:"filename,omitempty"` InsertIntoTable *Identifier `protobuf:"bytes,8,opt,name=insert_into_table,proto3" json:"insert_into_table,omitempty"` + ExcludedColumns []*Column `protobuf:"bytes,9,rep,name=excluded_columns,proto3" json:"excluded_columns,omitempty"` } func (x *Query) Reset() { @@ -1535,6 +1544,13 @@ func (x *Query) GetInsertIntoTable() *Identifier { return nil } +func (x *Query) GetExcludedColumns() []*Column { + if x != nil { + return x.ExcludedColumns + } + return nil +} + type Parameter struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1909,7 +1925,7 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 0x65, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x97, 0x02, 0x0a, 0x05, 0x54, 0x61, 0x62, + 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xd2, 0x02, 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, @@ -1927,190 +1943,197 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x83, 0x02, 0x0a, 0x05, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x27, 0x0a, 0x05, 0x65, 0x6c, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x45, 0x6c, - 0x65, 0x6d, 0x52, 0x05, 0x65, 0x6c, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, - 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, - 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x69, - 0x6d, 0x61, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x72, - 0x69, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x3f, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x70, 0x61, 0x72, - 0x74, 0x69, 0x61, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x61, - 0x72, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x68, 0x65, 0x72, 0x65, 0x5f, 0x63, - 0x6c, 0x61, 0x75, 0x73, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x77, 0x68, 0x65, - 0x72, 0x65, 0x43, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x22, 0x8a, 0x01, 0x0a, 0x09, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x45, 0x6c, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x08, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x42, 0x79, 0x44, 0x69, 0x72, 0x52, - 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x3a, 0x0a, 0x0e, 0x6e, 0x75, 0x6c, - 0x6c, 0x73, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x13, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x42, - 0x79, 0x4e, 0x75, 0x6c, 0x6c, 0x73, 0x52, 0x0d, 0x6e, 0x75, 0x6c, 0x6c, 0x73, 0x4f, 0x72, 0x64, - 0x65, 0x72, 0x69, 0x6e, 0x67, 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, 0xf8, 0x05, 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, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x69, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x15, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x45, 0x78, 0x70, 0x72, - 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x61, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, - 0x16, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x68, 0x61, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x65, 0x78, 0x70, - 0x72, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x45, 0x78, 0x70, 0x72, 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, 0x12, 0x3f, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, - 0x6d, 0x6f, 0x64, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, - 0x4d, 0x6f, 0x64, 0x73, 0x22, 0x53, 0x0a, 0x10, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x6e, - 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x66, 0x6f, 0x72, 0x65, - 0x69, 0x67, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x67, 0x69, 0x6e, 0x4b, - 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x66, 0x6f, - 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x14, 0x46, 0x6f, - 0x72, 0x65, 0x67, 0x69, 0x6e, 0x4b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, - 0x6e, 0x74, 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, 0x10, 0x72, 0x65, 0x6c, 0x5f, - 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x6c, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, - 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0xb8, 0x02, 0x0a, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6c, 0x69, - 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4c, - 0x69, 0x6e, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x6c, - 0x75, 0x6d, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x6c, 0x69, - 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x6e, - 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x12, 0x38, 0x0a, 0x17, 0x4c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x74, 0x61, 0x63, - 0x68, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x17, 0x4c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, - 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x4c, 0x65, - 0x61, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0f, 0x4c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, - 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, - 0x54, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 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, 0x87, 0x02, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 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, 0x12, 0x26, 0x0a, 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, - 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, - 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x36, - 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 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, 0x2a, 0x81, 0x01, 0x0a, 0x09, 0x53, 0x6f, 0x72, 0x74, 0x42, - 0x79, 0x44, 0x69, 0x72, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, - 0x44, 0x49, 0x52, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x17, 0x0a, 0x13, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x44, - 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x4f, 0x52, 0x54, - 0x5f, 0x42, 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x41, 0x53, 0x43, 0x10, 0x02, 0x12, 0x14, 0x0a, - 0x10, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x44, 0x45, 0x53, - 0x43, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x44, - 0x49, 0x52, 0x5f, 0x55, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x2a, 0x76, 0x0a, 0x0b, 0x53, 0x6f, - 0x72, 0x74, 0x42, 0x79, 0x4e, 0x75, 0x6c, 0x6c, 0x73, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x4f, 0x52, - 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x53, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x46, - 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, - 0x59, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x53, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, - 0x01, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x4e, 0x55, 0x4c, - 0x4c, 0x53, 0x5f, 0x46, 0x49, 0x52, 0x53, 0x54, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x4f, - 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x53, 0x5f, 0x4c, 0x41, 0x53, 0x54, - 0x10, 0x03, 0x32, 0x4f, 0x0a, 0x0e, 0x43, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x08, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x12, 0x17, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 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, + 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x5f, 0x63, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x0f, 0x65, 0x78, + 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x22, 0x83, 0x02, + 0x0a, 0x05, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x65, + 0x6c, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x45, 0x6c, 0x65, 0x6d, 0x52, 0x05, 0x65, + 0x6c, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x75, 0x6e, 0x69, 0x71, 0x75, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x55, 0x6e, 0x69, 0x71, 0x75, + 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, + 0x12, 0x3f, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, + 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x68, 0x65, 0x72, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x75, 0x73, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x77, 0x68, 0x65, 0x72, 0x65, 0x43, 0x6c, 0x61, + 0x75, 0x73, 0x65, 0x22, 0x8a, 0x01, 0x0a, 0x09, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x45, 0x6c, 0x65, + 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x69, 0x6e, + 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x42, 0x79, 0x44, 0x69, 0x72, 0x52, 0x08, 0x6f, 0x72, 0x64, 0x65, + 0x72, 0x69, 0x6e, 0x67, 0x12, 0x3a, 0x0a, 0x0e, 0x6e, 0x75, 0x6c, 0x6c, 0x73, 0x5f, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x42, 0x79, 0x4e, 0x75, 0x6c, 0x6c, + 0x73, 0x52, 0x0d, 0x6e, 0x75, 0x6c, 0x6c, 0x73, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x69, 0x6e, 0x67, + 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, 0xf8, 0x05, 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, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x65, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x65, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x45, 0x78, 0x70, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x68, + 0x61, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0a, 0x68, 0x61, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x18, 0x17, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x45, 0x78, 0x70, 0x72, 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, 0x12, 0x3f, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x73, 0x18, + 0x13, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x4d, 0x6f, 0x64, 0x73, 0x22, + 0x53, 0x0a, 0x10, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, + 0x6e, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x5f, 0x6b, + 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x67, 0x69, 0x6e, 0x4b, 0x65, 0x79, 0x43, 0x6f, 0x6e, + 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, + 0x4b, 0x65, 0x79, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x14, 0x46, 0x6f, 0x72, 0x65, 0x67, 0x69, 0x6e, + 0x4b, 0x65, 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 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, 0x10, 0x72, 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x72, + 0x65, 0x6c, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x21, 0x0a, + 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, + 0x22, 0xb8, 0x02, 0x0a, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x65, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x65, 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x38, 0x0a, 0x17, 0x4c, + 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x17, 0x4c, 0x65, + 0x61, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x4c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x4c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x2a, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x54, 0x72, 0x61, 0x69, 0x6c, + 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xd0, 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, 0x12, 0x3a, 0x0a, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x5f, 0x63, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x10, 0x65, 0x78, + 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 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, 0x87, 0x02, 0x0a, 0x0f, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 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, 0x12, 0x26, 0x0a, + 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x36, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 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, 0x2a, 0x81, 0x01, + 0x0a, 0x09, 0x53, 0x6f, 0x72, 0x74, 0x42, 0x79, 0x44, 0x69, 0x72, 0x12, 0x19, 0x0a, 0x15, 0x53, + 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x46, + 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, + 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x01, 0x12, + 0x13, 0x0a, 0x0f, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x41, + 0x53, 0x43, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, + 0x44, 0x49, 0x52, 0x5f, 0x44, 0x45, 0x53, 0x43, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x4f, + 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x55, 0x53, 0x49, 0x4e, 0x47, 0x10, + 0x04, 0x2a, 0x76, 0x0a, 0x0b, 0x53, 0x6f, 0x72, 0x74, 0x42, 0x79, 0x4e, 0x75, 0x6c, 0x6c, 0x73, + 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, + 0x53, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, + 0x15, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x53, 0x5f, 0x44, + 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x4f, 0x52, 0x54, + 0x5f, 0x42, 0x59, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x53, 0x5f, 0x46, 0x49, 0x52, 0x53, 0x54, 0x10, + 0x02, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x4e, 0x55, 0x4c, + 0x4c, 0x53, 0x5f, 0x4c, 0x41, 0x53, 0x54, 0x10, 0x03, 0x32, 0x4f, 0x0a, 0x0e, 0x43, 0x6f, 0x64, + 0x65, 0x67, 0x65, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x08, 0x47, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x18, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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 ( @@ -2170,31 +2193,33 @@ var file_plugin_codegen_proto_depIdxs = []int32{ 11, // 13: plugin.Table.indexes:type_name -> plugin.Index 15, // 14: plugin.Table.constraints:type_name -> plugin.TableConstraints 17, // 15: plugin.Table.source_location:type_name -> plugin.SourceLocation - 12, // 16: plugin.Index.elems:type_name -> plugin.IndexElem - 17, // 17: plugin.Index.source_location:type_name -> plugin.SourceLocation - 0, // 18: plugin.IndexElem.ordering:type_name -> plugin.SortByDir - 1, // 19: plugin.IndexElem.nulls_ordering:type_name -> plugin.SortByNulls - 13, // 20: plugin.Column.table:type_name -> plugin.Identifier - 13, // 21: plugin.Column.type:type_name -> plugin.Identifier - 13, // 22: plugin.Column.embed_table:type_name -> plugin.Identifier - 17, // 23: plugin.Column.source_location:type_name -> plugin.SourceLocation - 16, // 24: plugin.TableConstraints.foreign_keys:type_name -> plugin.ForeginKeyConstraint - 13, // 25: plugin.ForeginKeyConstraint.rel:type_name -> plugin.Identifier - 14, // 26: plugin.Query.columns:type_name -> plugin.Column - 19, // 27: plugin.Query.params:type_name -> plugin.Parameter - 13, // 28: plugin.Query.insert_into_table:type_name -> plugin.Identifier - 14, // 29: plugin.Parameter.column:type_name -> plugin.Column - 3, // 30: plugin.GenerateRequest.settings:type_name -> plugin.Settings - 5, // 31: plugin.GenerateRequest.catalog:type_name -> plugin.Catalog - 18, // 32: plugin.GenerateRequest.queries:type_name -> plugin.Query - 2, // 33: plugin.GenerateResponse.files:type_name -> plugin.File - 20, // 34: plugin.CodegenService.Generate:input_type -> plugin.GenerateRequest - 21, // 35: plugin.CodegenService.Generate:output_type -> plugin.GenerateResponse - 35, // [35:36] is the sub-list for method output_type - 34, // [34:35] is the sub-list for method input_type - 34, // [34:34] is the sub-list for extension type_name - 34, // [34:34] is the sub-list for extension extendee - 0, // [0:34] is the sub-list for field type_name + 14, // 16: plugin.Table.excluded_columns:type_name -> plugin.Column + 12, // 17: plugin.Index.elems:type_name -> plugin.IndexElem + 17, // 18: plugin.Index.source_location:type_name -> plugin.SourceLocation + 0, // 19: plugin.IndexElem.ordering:type_name -> plugin.SortByDir + 1, // 20: plugin.IndexElem.nulls_ordering:type_name -> plugin.SortByNulls + 13, // 21: plugin.Column.table:type_name -> plugin.Identifier + 13, // 22: plugin.Column.type:type_name -> plugin.Identifier + 13, // 23: plugin.Column.embed_table:type_name -> plugin.Identifier + 17, // 24: plugin.Column.source_location:type_name -> plugin.SourceLocation + 16, // 25: plugin.TableConstraints.foreign_keys:type_name -> plugin.ForeginKeyConstraint + 13, // 26: plugin.ForeginKeyConstraint.rel:type_name -> plugin.Identifier + 14, // 27: plugin.Query.columns:type_name -> plugin.Column + 19, // 28: plugin.Query.params:type_name -> plugin.Parameter + 13, // 29: plugin.Query.insert_into_table:type_name -> plugin.Identifier + 14, // 30: plugin.Query.excluded_columns:type_name -> plugin.Column + 14, // 31: plugin.Parameter.column:type_name -> plugin.Column + 3, // 32: plugin.GenerateRequest.settings:type_name -> plugin.Settings + 5, // 33: plugin.GenerateRequest.catalog:type_name -> plugin.Catalog + 18, // 34: plugin.GenerateRequest.queries:type_name -> plugin.Query + 2, // 35: plugin.GenerateResponse.files:type_name -> plugin.File + 20, // 36: plugin.CodegenService.Generate:input_type -> plugin.GenerateRequest + 21, // 37: plugin.CodegenService.Generate:output_type -> plugin.GenerateResponse + 37, // [37:38] is the sub-list for method output_type + 36, // [36:37] is the sub-list for method input_type + 36, // [36:36] is the sub-list for extension type_name + 36, // [36:36] is the sub-list for extension extendee + 0, // [0:36] is the sub-list for field type_name } func init() { file_plugin_codegen_proto_init() } diff --git a/internal/sql/catalog/table.go b/internal/sql/catalog/table.go index babc9c07d..99fdce08e 100644 --- a/internal/sql/catalog/table.go +++ b/internal/sql/catalog/table.go @@ -146,6 +146,7 @@ type Column struct { GenerateExpr string DefaultExpr string SourceLocation *SourceLocation + IsExcluded bool linkedType bool } diff --git a/protos/plugin/codegen.proto b/protos/plugin/codegen.proto index f6b9b2c2c..1181a807e 100644 --- a/protos/plugin/codegen.proto +++ b/protos/plugin/codegen.proto @@ -84,6 +84,7 @@ message Table { repeated Index indexes = 4; TableConstraints constraints = 6; SourceLocation source_location = 5; + repeated Column excluded_columns = 7; } message Index { @@ -182,6 +183,7 @@ message Query { repeated string comments = 6 [json_name = "comments"]; string filename = 7 [json_name = "filename"]; Identifier insert_into_table = 8 [json_name = "insert_into_table"]; + repeated Column excluded_columns = 9 [json_name = "excluded_columns"]; } message Parameter { From a4e9dee43b7cd807e8b4f9e0b0fe9e3906eb2344 Mon Sep 17 00:00:00 2001 From: Masahiro Sano Date: Wed, 10 Dec 2025 17:12:39 +0900 Subject: [PATCH 2/3] fix: Proto lint errors and add Deparse for non-cgo builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix proto lint errors: - Rename SORT_BY_DIR_UNDEFINED to SORT_BY_DIR_UNSPECIFIED - Rename SORT_BY_NULLS_UNDEFINED to SORT_BY_NULLS_UNSPECIFIED - Rename SourceLocation fields to snake_case (leading_detached_comments, etc.) - Add Deparse variable to parse_wasi.go for windows/non-cgo builds - Update E2E test data with new field names 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../testdata/codegen_json/gen/codegen.json | 42 +- .../gen/codegen.json | 675 ++++++++++++------ internal/engine/postgresql/parse_wasi.go | 1 + internal/plugin/codegen.pb.go | 221 +++--- protos/plugin/codegen.proto | 10 +- 5 files changed, 582 insertions(+), 367 deletions(-) diff --git a/internal/endtoend/testdata/codegen_json/gen/codegen.json b/internal/endtoend/testdata/codegen_json/gen/codegen.json index 2f4db61a7..515d2d5bc 100644 --- a/internal/endtoend/testdata/codegen_json/gen/codegen.json +++ b/internal/endtoend/testdata/codegen_json/gen/codegen.json @@ -68,9 +68,9 @@ "start_column": 10, "end_line": 0, "end_column": 0, - "LeadingDetachedComments": [], - "LeadingComments": "", - "TrailingComments": " id" + "leading_detached_comments": [], + "leading_comments": "", + "trailing_comments": " id" }, "type_mods": [] }, @@ -109,9 +109,9 @@ "start_column": 10, "end_line": 0, "end_column": 0, - "LeadingDetachedComments": [], - "LeadingComments": "", - "TrailingComments": " name" + "leading_detached_comments": [], + "leading_comments": "", + "trailing_comments": " name" }, "type_mods": [] }, @@ -150,9 +150,9 @@ "start_column": 10, "end_line": 0, "end_column": 0, - "LeadingDetachedComments": [], - "LeadingComments": "", - "TrailingComments": " bio" + "leading_detached_comments": [], + "leading_comments": "", + "trailing_comments": " bio" }, "type_mods": [] } @@ -184,9 +184,9 @@ "start_column": 0, "end_line": 0, "end_column": 0, - "LeadingDetachedComments": [], - "LeadingComments": " author", - "TrailingComments": "" + "leading_detached_comments": [], + "leading_comments": " author", + "trailing_comments": "" }, "excluded_columns": [] } @@ -208,9 +208,9 @@ "start_column": 10, "end_line": 0, "end_column": 0, - "LeadingDetachedComments": [], - "LeadingComments": "", - "TrailingComments": " online" + "leading_detached_comments": [], + "leading_comments": "", + "trailing_comments": " online" } }, { @@ -221,9 +221,9 @@ "start_column": 10, "end_line": 0, "end_column": 0, - "LeadingDetachedComments": [], - "LeadingComments": "", - "TrailingComments": " offline" + "leading_detached_comments": [], + "leading_comments": "", + "trailing_comments": " offline" } } ], @@ -233,9 +233,9 @@ "start_column": 0, "end_line": 0, "end_column": 0, - "LeadingDetachedComments": [], - "LeadingComments": " status", - "TrailingComments": "" + "leading_detached_comments": [], + "leading_comments": " status", + "trailing_comments": "" } } ], diff --git a/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json b/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json index 16060e9d4..e1d46f49c 100644 --- a/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json +++ b/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json @@ -70,9 +70,9 @@ "start_column": 10, "end_line": 0, "end_column": 0, - "LeadingDetachedComments": [], - "LeadingComments": "", - "TrailingComments": "" + "leading_detached_comments": [], + "leading_comments": "", + "trailing_comments": "" }, "type_mods": [] }, @@ -111,9 +111,9 @@ "start_column": 10, "end_line": 0, "end_column": 0, - "LeadingDetachedComments": [], - "LeadingComments": "", - "TrailingComments": "" + "leading_detached_comments": [], + "leading_comments": "", + "trailing_comments": "" }, "type_mods": [] }, @@ -152,9 +152,9 @@ "start_column": 10, "end_line": 0, "end_column": 0, - "LeadingDetachedComments": [], - "LeadingComments": "", - "TrailingComments": "" + "leading_detached_comments": [], + "leading_comments": "", + "trailing_comments": "" }, "type_mods": [] } @@ -193,9 +193,9 @@ "start_column": 0, "end_line": 0, "end_column": 0, - "LeadingDetachedComments": [], - "LeadingComments": "", - "TrailingComments": "" + "leading_detached_comments": [], + "leading_comments": "", + "trailing_comments": "" }, "is_partial": false, "where_clause": "" @@ -217,9 +217,9 @@ "start_column": 0, "end_line": 0, "end_column": 0, - "LeadingDetachedComments": [], - "LeadingComments": "", - "TrailingComments": "" + "leading_detached_comments": [], + "leading_comments": "", + "trailing_comments": "" }, "is_partial": false, "where_clause": "" @@ -234,10 +234,11 @@ "start_column": 0, "end_line": 0, "end_column": 0, - "LeadingDetachedComments": [], - "LeadingComments": "", - "TrailingComments": "" - } + "leading_detached_comments": [], + "leading_comments": "", + "trailing_comments": "" + }, + "excluded_columns": [] } ], "enums": [], @@ -1163,7 +1164,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -1496,7 +1498,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -1989,7 +1992,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -2386,7 +2390,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -2719,7 +2724,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -3756,7 +3762,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -4089,7 +4096,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -4678,7 +4686,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -4979,7 +4988,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -5120,7 +5130,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -5421,7 +5432,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -5818,7 +5830,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -7079,7 +7092,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -7636,7 +7650,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -7713,7 +7728,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -8750,7 +8766,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -9211,7 +9228,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -9416,7 +9434,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -10133,7 +10152,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -10434,7 +10454,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -10799,7 +10820,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -11228,7 +11250,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -11561,7 +11584,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -11894,7 +11918,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -12323,7 +12348,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -12784,7 +12810,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -13021,7 +13048,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -13450,7 +13478,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -13911,7 +13940,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -14212,7 +14242,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -14321,7 +14352,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -14622,7 +14654,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -14795,7 +14828,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -15672,7 +15706,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -15845,7 +15880,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -16178,7 +16214,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -16543,7 +16580,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -17036,7 +17074,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -17337,7 +17376,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -17638,7 +17678,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -18163,7 +18204,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -18400,7 +18442,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -18733,7 +18776,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -19226,7 +19270,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -19911,7 +19956,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -20276,7 +20322,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -20577,7 +20624,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -21038,7 +21086,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -21307,7 +21356,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -21768,7 +21818,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -22005,7 +22056,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -22178,7 +22230,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -23343,7 +23396,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -23836,7 +23890,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -24137,7 +24192,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -24502,7 +24558,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -24675,7 +24732,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -25104,7 +25162,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -25373,7 +25432,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -25514,7 +25574,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -26007,7 +26068,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -26468,7 +26530,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -26897,7 +26960,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -27038,7 +27102,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -27403,7 +27468,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -27672,7 +27738,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -28133,7 +28200,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -28498,7 +28566,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -29055,7 +29124,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -29356,7 +29426,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -29785,7 +29856,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -30086,7 +30158,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -30227,7 +30300,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -30560,7 +30634,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -31277,7 +31352,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -31546,7 +31622,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -32295,7 +32372,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -32532,7 +32610,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -32897,7 +32976,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -33806,7 +33886,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -34043,7 +34124,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -34184,7 +34266,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -34581,7 +34664,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -34786,7 +34870,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -35183,7 +35268,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -35516,7 +35602,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -36041,7 +36128,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -36406,7 +36494,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -36739,7 +36828,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -37392,7 +37482,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -37725,7 +37816,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -38026,7 +38118,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -38295,7 +38388,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -38596,7 +38690,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -38769,7 +38864,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -39038,7 +39134,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -39787,7 +39884,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -39992,7 +40090,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -40261,7 +40360,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -41010,7 +41110,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -41311,7 +41412,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -41804,7 +41906,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -42169,7 +42272,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -42534,7 +42638,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -42739,7 +42844,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -43104,7 +43210,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -43341,7 +43448,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -43514,7 +43622,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -43879,7 +43988,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -44116,7 +44226,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -44289,7 +44400,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -44654,7 +44766,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -44891,7 +45004,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -45064,7 +45178,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -45429,7 +45544,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -46626,7 +46742,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -47119,7 +47236,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -47516,7 +47634,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -47977,7 +48096,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -48470,7 +48590,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -49027,7 +49148,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -49680,7 +49802,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -50013,7 +50136,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -50282,7 +50406,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -50647,7 +50772,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -50756,7 +50882,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -50897,7 +51024,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -51262,7 +51390,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -52075,7 +52204,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -52440,7 +52570,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -52773,7 +52904,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -53170,7 +53302,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -53631,7 +53764,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -53996,7 +54130,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -55225,7 +55360,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -55526,7 +55662,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -55859,7 +55996,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -56064,7 +56202,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -56205,7 +56344,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] } ], "enums": [], @@ -56451,7 +56591,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -56752,7 +56893,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -56893,7 +57035,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -57130,7 +57273,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -57367,7 +57511,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -57476,7 +57621,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -57585,7 +57731,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -58590,7 +58737,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -58859,7 +59007,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -59064,7 +59213,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -59205,7 +59355,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -59410,7 +59561,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -59551,7 +59703,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -59724,7 +59877,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -59961,7 +60115,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -60166,7 +60321,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -60435,7 +60591,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -60672,7 +60829,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -62093,7 +62251,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -62330,7 +62489,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -62535,7 +62695,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -62708,7 +62869,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -62977,7 +63139,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -63182,7 +63345,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -64059,7 +64223,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -65000,7 +65165,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -65045,7 +65211,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -65186,7 +65353,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -65359,7 +65527,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -65500,7 +65669,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -65737,7 +65907,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -65910,7 +66081,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -66083,7 +66255,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -66128,7 +66301,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -66429,7 +66603,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -67466,7 +67641,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -67767,7 +67943,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -68036,7 +68213,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -68369,7 +68547,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -68638,7 +68817,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -68875,7 +69055,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -69144,7 +69325,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -69477,7 +69659,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -69810,7 +69993,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -70015,7 +70199,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -70316,7 +70501,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -70617,7 +70803,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -73254,7 +73441,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -73491,7 +73679,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -73888,7 +74077,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -74317,7 +74507,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -74682,7 +74873,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -75047,7 +75239,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -75380,7 +75573,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -75745,7 +75939,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -76014,7 +76209,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -76411,7 +76607,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -76680,7 +76877,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -76917,7 +77115,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -77474,7 +77673,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -77711,7 +77911,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -77980,7 +78181,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -78921,7 +79123,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -79094,7 +79297,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -79203,7 +79407,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -79440,7 +79645,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -79645,7 +79851,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -79850,7 +80057,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] }, { "rel": { @@ -80183,7 +80391,8 @@ "comment": "", "indexes": [], "constraints": null, - "source_location": null + "source_location": null, + "excluded_columns": [] } ], "enums": [], @@ -80334,7 +80543,8 @@ ], "comments": [], "filename": "query.sql", - "insert_into_table": null + "insert_into_table": null, + "excluded_columns": [] }, { "text": "SELECT id, name, bio FROM authors\nORDER BY name", @@ -80441,7 +80651,8 @@ "params": [], "comments": [], "filename": "query.sql", - "insert_into_table": null + "insert_into_table": null, + "excluded_columns": [] }, { "text": "INSERT INTO authors (\n name, bio\n) VALUES (\n $1, $2\n)\nRETURNING id, name, bio", @@ -80623,7 +80834,8 @@ "catalog": "", "schema": "", "name": "authors" - } + }, + "excluded_columns": [] }, { "text": "DELETE FROM authors\nWHERE id = $1", @@ -80669,7 +80881,8 @@ ], "comments": [], "filename": "query.sql", - "insert_into_table": null + "insert_into_table": null, + "excluded_columns": [] } ], "sqlc_version": "v1.30.0", diff --git a/internal/engine/postgresql/parse_wasi.go b/internal/engine/postgresql/parse_wasi.go index dacb496f6..4535db9a2 100644 --- a/internal/engine/postgresql/parse_wasi.go +++ b/internal/engine/postgresql/parse_wasi.go @@ -9,3 +9,4 @@ import ( var Parse = nodes.Parse var ParseScan = nodes.Scan var Fingerprint = nodes.Fingerprint +var Deparse = nodes.Deparse diff --git a/internal/plugin/codegen.pb.go b/internal/plugin/codegen.pb.go index 2830e241a..ebae49292 100644 --- a/internal/plugin/codegen.pb.go +++ b/internal/plugin/codegen.pb.go @@ -23,28 +23,28 @@ const ( type SortByDir int32 const ( - SortByDir_SORT_BY_DIR_UNDEFINED SortByDir = 0 - SortByDir_SORT_BY_DIR_DEFAULT SortByDir = 1 - SortByDir_SORT_BY_DIR_ASC SortByDir = 2 - SortByDir_SORT_BY_DIR_DESC SortByDir = 3 - SortByDir_SORT_BY_DIR_USING SortByDir = 4 + SortByDir_SORT_BY_DIR_UNSPECIFIED SortByDir = 0 + SortByDir_SORT_BY_DIR_DEFAULT SortByDir = 1 + SortByDir_SORT_BY_DIR_ASC SortByDir = 2 + SortByDir_SORT_BY_DIR_DESC SortByDir = 3 + SortByDir_SORT_BY_DIR_USING SortByDir = 4 ) // Enum value maps for SortByDir. var ( SortByDir_name = map[int32]string{ - 0: "SORT_BY_DIR_UNDEFINED", + 0: "SORT_BY_DIR_UNSPECIFIED", 1: "SORT_BY_DIR_DEFAULT", 2: "SORT_BY_DIR_ASC", 3: "SORT_BY_DIR_DESC", 4: "SORT_BY_DIR_USING", } SortByDir_value = map[string]int32{ - "SORT_BY_DIR_UNDEFINED": 0, - "SORT_BY_DIR_DEFAULT": 1, - "SORT_BY_DIR_ASC": 2, - "SORT_BY_DIR_DESC": 3, - "SORT_BY_DIR_USING": 4, + "SORT_BY_DIR_UNSPECIFIED": 0, + "SORT_BY_DIR_DEFAULT": 1, + "SORT_BY_DIR_ASC": 2, + "SORT_BY_DIR_DESC": 3, + "SORT_BY_DIR_USING": 4, } ) @@ -78,25 +78,25 @@ func (SortByDir) EnumDescriptor() ([]byte, []int) { type SortByNulls int32 const ( - SortByNulls_SORT_BY_NULLS_UNDEFINED SortByNulls = 0 - SortByNulls_SORT_BY_NULLS_DEFAULT SortByNulls = 1 - SortByNulls_SORT_BY_NULLS_FIRST SortByNulls = 2 - SortByNulls_SORT_BY_NULLS_LAST SortByNulls = 3 + SortByNulls_SORT_BY_NULLS_UNSPECIFIED SortByNulls = 0 + SortByNulls_SORT_BY_NULLS_DEFAULT SortByNulls = 1 + SortByNulls_SORT_BY_NULLS_FIRST SortByNulls = 2 + SortByNulls_SORT_BY_NULLS_LAST SortByNulls = 3 ) // Enum value maps for SortByNulls. var ( SortByNulls_name = map[int32]string{ - 0: "SORT_BY_NULLS_UNDEFINED", + 0: "SORT_BY_NULLS_UNSPECIFIED", 1: "SORT_BY_NULLS_DEFAULT", 2: "SORT_BY_NULLS_FIRST", 3: "SORT_BY_NULLS_LAST", } SortByNulls_value = map[string]int32{ - "SORT_BY_NULLS_UNDEFINED": 0, - "SORT_BY_NULLS_DEFAULT": 1, - "SORT_BY_NULLS_FIRST": 2, - "SORT_BY_NULLS_LAST": 3, + "SORT_BY_NULLS_UNSPECIFIED": 0, + "SORT_BY_NULLS_DEFAULT": 1, + "SORT_BY_NULLS_FIRST": 2, + "SORT_BY_NULLS_LAST": 3, } ) @@ -938,14 +938,14 @@ func (x *IndexElem) GetOrdering() SortByDir { if x != nil { return x.Ordering } - return SortByDir_SORT_BY_DIR_UNDEFINED + return SortByDir_SORT_BY_DIR_UNSPECIFIED } func (x *IndexElem) GetNullsOrdering() SortByNulls { if x != nil { return x.NullsOrdering } - return SortByNulls_SORT_BY_NULLS_UNDEFINED + return SortByNulls_SORT_BY_NULLS_UNSPECIFIED } type Identifier struct { @@ -1347,9 +1347,9 @@ type SourceLocation struct { StartColumn int32 `protobuf:"varint,3,opt,name=start_column,json=startColumn,proto3" json:"start_column,omitempty"` EndLine int32 `protobuf:"varint,4,opt,name=end_line,json=endLine,proto3" json:"end_line,omitempty"` EndColumn int32 `protobuf:"varint,5,opt,name=end_column,json=endColumn,proto3" json:"end_column,omitempty"` - LeadingDetachedComments []string `protobuf:"bytes,6,rep,name=LeadingDetachedComments,proto3" json:"LeadingDetachedComments,omitempty"` - LeadingComments string `protobuf:"bytes,7,opt,name=LeadingComments,proto3" json:"LeadingComments,omitempty"` - TrailingComments string `protobuf:"bytes,8,opt,name=TrailingComments,proto3" json:"TrailingComments,omitempty"` + LeadingDetachedComments []string `protobuf:"bytes,6,rep,name=leading_detached_comments,json=leadingDetachedComments,proto3" json:"leading_detached_comments,omitempty"` + LeadingComments string `protobuf:"bytes,7,opt,name=leading_comments,json=leadingComments,proto3" json:"leading_comments,omitempty"` + TrailingComments string `protobuf:"bytes,8,opt,name=trailing_comments,json=trailingComments,proto3" json:"trailing_comments,omitempty"` } func (x *SourceLocation) Reset() { @@ -2039,7 +2039,7 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 0x65, 0x6c, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, - 0x22, 0xb8, 0x02, 0x0a, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, + 0x22, 0xbc, 0x02, 0x0a, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, @@ -2049,91 +2049,92 @@ var file_plugin_codegen_proto_rawDesc = []byte{ 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x09, 0x65, 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x38, 0x0a, 0x17, 0x4c, - 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x43, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x17, 0x4c, 0x65, - 0x61, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x43, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x4c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, - 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, - 0x4c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, - 0x2a, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x54, 0x72, 0x61, 0x69, 0x6c, - 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xd0, 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, + 0x52, 0x09, 0x65, 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x3a, 0x0a, 0x19, 0x6c, + 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x5f, + 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x17, + 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x43, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x6c, 0x65, 0x61, 0x64, 0x69, + 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, + 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, + 0xd0, 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, 0x12, 0x3a, 0x0a, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, + 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x09, 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, 0x12, 0x3a, 0x0a, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x5f, 0x63, - 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x10, 0x65, 0x78, - 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 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, 0x87, 0x02, 0x0a, 0x0f, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 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, 0x12, 0x26, 0x0a, - 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x36, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 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, 0x2a, 0x81, 0x01, - 0x0a, 0x09, 0x53, 0x6f, 0x72, 0x74, 0x42, 0x79, 0x44, 0x69, 0x72, 0x12, 0x19, 0x0a, 0x15, 0x53, - 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x46, - 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, - 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x01, 0x12, - 0x13, 0x0a, 0x0f, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x41, - 0x53, 0x43, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, - 0x44, 0x49, 0x52, 0x5f, 0x44, 0x45, 0x53, 0x43, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x4f, - 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x55, 0x53, 0x49, 0x4e, 0x47, 0x10, - 0x04, 0x2a, 0x76, 0x0a, 0x0b, 0x53, 0x6f, 0x72, 0x74, 0x42, 0x79, 0x4e, 0x75, 0x6c, 0x6c, 0x73, - 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, - 0x53, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, - 0x15, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x53, 0x5f, 0x44, - 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x4f, 0x52, 0x54, - 0x5f, 0x42, 0x59, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x53, 0x5f, 0x46, 0x49, 0x52, 0x53, 0x54, 0x10, - 0x02, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x4e, 0x55, 0x4c, - 0x4c, 0x53, 0x5f, 0x4c, 0x41, 0x53, 0x54, 0x10, 0x03, 0x32, 0x4f, 0x0a, 0x0e, 0x43, 0x6f, 0x64, - 0x65, 0x67, 0x65, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x08, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x18, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, + 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x73, 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, + 0x87, 0x02, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 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, 0x12, 0x26, 0x0a, 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x36, 0x0a, 0x10, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 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, 0x2a, 0x83, 0x01, 0x0a, 0x09, 0x53, 0x6f, 0x72, 0x74, 0x42, 0x79, 0x44, 0x69, 0x72, 0x12, + 0x1b, 0x0a, 0x17, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, + 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x44, 0x45, 0x46, 0x41, + 0x55, 0x4c, 0x54, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, + 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x41, 0x53, 0x43, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x4f, + 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, 0x44, 0x45, 0x53, 0x43, 0x10, 0x03, + 0x12, 0x15, 0x0a, 0x11, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x44, 0x49, 0x52, 0x5f, + 0x55, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x2a, 0x78, 0x0a, 0x0b, 0x53, 0x6f, 0x72, 0x74, 0x42, + 0x79, 0x4e, 0x75, 0x6c, 0x6c, 0x73, 0x12, 0x1d, 0x0a, 0x19, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, + 0x59, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, + 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x53, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x01, + 0x12, 0x17, 0x0a, 0x13, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, + 0x53, 0x5f, 0x46, 0x49, 0x52, 0x53, 0x54, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x4f, 0x52, + 0x54, 0x5f, 0x42, 0x59, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x53, 0x5f, 0x4c, 0x41, 0x53, 0x54, 0x10, + 0x03, 0x32, 0x4f, 0x0a, 0x0e, 0x43, 0x6f, 0x64, 0x65, 0x67, 0x65, 0x6e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x08, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x12, + 0x17, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 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 ( diff --git a/protos/plugin/codegen.proto b/protos/plugin/codegen.proto index 1181a807e..4df1a5ccd 100644 --- a/protos/plugin/codegen.proto +++ b/protos/plugin/codegen.proto @@ -104,7 +104,7 @@ message IndexElem { } enum SortByDir { - SORT_BY_DIR_UNDEFINED = 0; + SORT_BY_DIR_UNSPECIFIED = 0; SORT_BY_DIR_DEFAULT = 1; SORT_BY_DIR_ASC = 2; SORT_BY_DIR_DESC = 3; @@ -112,7 +112,7 @@ enum SortByDir { } enum SortByNulls { - SORT_BY_NULLS_UNDEFINED = 0; + SORT_BY_NULLS_UNSPECIFIED = 0; SORT_BY_NULLS_DEFAULT = 1; SORT_BY_NULLS_FIRST = 2; SORT_BY_NULLS_LAST = 3; @@ -169,9 +169,9 @@ message SourceLocation { int32 end_line = 4; int32 end_column = 5; - repeated string LeadingDetachedComments = 6; - string LeadingComments = 7; - string TrailingComments = 8; + repeated string leading_detached_comments = 6; + string leading_comments = 7; + string trailing_comments = 8; } message Query { From c6bccc448486919fdb3ad5ee4ef8e8d0a23554e2 Mon Sep 17 00:00:00 2001 From: Masahiro Sano Date: Wed, 10 Dec 2025 17:21:56 +0900 Subject: [PATCH 3/3] fix: Normalize JSON paths to match CI environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update path normalization to use /sqlc/sqlc/ prefix to match CI environment where the repo is cloned into /home/runner/work/sqlc/sqlc/. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/endtoend/endtoend_test.go | 15 ++++++++++++--- .../testdata/codegen_json/gen/codegen.json | 14 +++++++------- .../process_plugin_sqlc_gen_json/gen/codegen.json | 12 ++++++------ 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/internal/endtoend/endtoend_test.go b/internal/endtoend/endtoend_test.go index 81b71967c..40338cc01 100644 --- a/internal/endtoend/endtoend_test.go +++ b/internal/endtoend/endtoend_test.go @@ -37,7 +37,8 @@ func stderrTransformer() cmp.Option { // normalizeJSONPaths normalizes absolute file paths in JSON content to make tests // environment-independent. It replaces paths like "/home/user/.../sqlc/internal/..." -// with "/sqlc/internal/..." by finding the "sqlc" directory in the path. +// with "/sqlc/sqlc/internal/..." to match CI environment (where the repo is cloned +// into /home/runner/work/sqlc/sqlc/). func normalizeJSONPaths(content string) string { // Match JSON string values containing absolute paths with "sqlc" in them // Pattern: "filename": "/path/to/sqlc/..." @@ -49,12 +50,20 @@ func normalizeJSONPaths(content string) string { return match } fullPath := submatch[1] - // Find "sqlc" in the path and keep everything from there + // Check if already normalized to /sqlc/sqlc/ + if strings.Contains(fullPath, "/sqlc/sqlc/") { + idx := strings.Index(fullPath, "/sqlc/sqlc/") + normalizedPath := fullPath[idx:] + return `"filename": "` + normalizedPath + `"` + } + // Find /sqlc/ and normalize to /sqlc/sqlc/ to match CI environment idx := strings.Index(fullPath, "/sqlc/") if idx == -1 { return match } - normalizedPath := fullPath[idx:] + // Extract the path after /sqlc/ and prepend /sqlc/sqlc/ + rest := fullPath[idx+len("/sqlc/"):] + normalizedPath := "/sqlc/sqlc/" + rest return `"filename": "` + normalizedPath + `"` }) } diff --git a/internal/endtoend/testdata/codegen_json/gen/codegen.json b/internal/endtoend/testdata/codegen_json/gen/codegen.json index 515d2d5bc..5e66a4a36 100644 --- a/internal/endtoend/testdata/codegen_json/gen/codegen.json +++ b/internal/endtoend/testdata/codegen_json/gen/codegen.json @@ -63,7 +63,7 @@ "unsigned": false, "array_dims": 0, "source_location": { - "filename": "/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", + "filename": "/sqlc/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", "start_line": 2, "start_column": 10, "end_line": 0, @@ -104,7 +104,7 @@ "unsigned": false, "array_dims": 0, "source_location": { - "filename": "/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", + "filename": "/sqlc/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", "start_line": 3, "start_column": 10, "end_line": 0, @@ -145,7 +145,7 @@ "unsigned": false, "array_dims": 0, "source_location": { - "filename": "/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", + "filename": "/sqlc/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", "start_line": 4, "start_column": 10, "end_line": 0, @@ -179,7 +179,7 @@ "foreign_keys": [] }, "source_location": { - "filename": "/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", + "filename": "/sqlc/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", "start_line": 1, "start_column": 0, "end_line": 0, @@ -203,7 +203,7 @@ { "value": "online", "source_location": { - "filename": "/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", + "filename": "/sqlc/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", "start_line": 9, "start_column": 10, "end_line": 0, @@ -216,7 +216,7 @@ { "value": "offline", "source_location": { - "filename": "/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", + "filename": "/sqlc/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", "start_line": 10, "start_column": 10, "end_line": 0, @@ -228,7 +228,7 @@ } ], "source_location": { - "filename": "/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", + "filename": "/sqlc/sqlc/internal/endtoend/testdata/codegen_json/postgresql/schema.sql", "start_line": 8, "start_column": 0, "end_line": 0, diff --git a/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json b/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json index e1d46f49c..508138d69 100644 --- a/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json +++ b/internal/endtoend/testdata/process_plugin_sqlc_gen_json/gen/codegen.json @@ -65,7 +65,7 @@ "unsigned": false, "array_dims": 0, "source_location": { - "filename": "/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", + "filename": "/sqlc/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", "start_line": 1, "start_column": 10, "end_line": 0, @@ -106,7 +106,7 @@ "unsigned": false, "array_dims": 0, "source_location": { - "filename": "/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", + "filename": "/sqlc/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", "start_line": 2, "start_column": 10, "end_line": 0, @@ -147,7 +147,7 @@ "unsigned": false, "array_dims": 0, "source_location": { - "filename": "/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", + "filename": "/sqlc/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", "start_line": 3, "start_column": 10, "end_line": 0, @@ -188,7 +188,7 @@ "is_unique": true, "is_primary": false, "source_location": { - "filename": "/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", + "filename": "/sqlc/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", "start_line": 6, "start_column": 0, "end_line": 0, @@ -212,7 +212,7 @@ "is_unique": false, "is_primary": false, "source_location": { - "filename": "/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", + "filename": "/sqlc/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", "start_line": 8, "start_column": 0, "end_line": 0, @@ -229,7 +229,7 @@ "foreign_keys": [] }, "source_location": { - "filename": "/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", + "filename": "/sqlc/sqlc/internal/endtoend/testdata/process_plugin_sqlc_gen_json/schema.sql", "start_line": 0, "start_column": 0, "end_line": 0,