8000 agg_ to view_agg_ · cortea-ai/sqlc-gen-python@1deeebc · GitHub
[go: up one dir, main page]

Skip to content

Commit 1deeebc

Browse files
committed
agg_ to view_agg_
1 parent 078c2fe commit 1deeebc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/gen.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ func columnsToStruct(conf Config, req *plugin.GenerateRequest, name string, colu
552552
IsNull: !c.NotNull,
553553
}
554554
f.EmbedFields = c.embed.fields
555-
} else if structs != nil && c.IsArray && strings.HasPrefix(c.GetTable().GetName(), "agg_") {
555+
} else if structs != nil && c.IsArray && strings.HasPrefix(c.GetTable().GetName(), "view_agg_") {
556556
for _, s := range structs {
557557
if s.Table.Name == c.OriginalName {
558558
f.Type = pyType{
@@ -670,7 +670,7 @@ func buildQueries(conf Config, req *plugin.GenerateRequest, structs []Struct) ([
670670
}
671671
if len(query.Columns) == 1 && query.Columns[0].EmbedTable == nil {
672672
c := query.Columns[0]
673-
if c.IsArray && strings.HasPrefix(c.GetTable().GetName(), "agg_") {
673+
if c.IsArray && strings.HasPrefix(c.GetTable().GetName(), "view_agg_") {
674674
return nil, fmt.Errorf("special agg fields serve no purpose when queried individually")
675675
}
676676
gq.Ret = QueryValue{

0 commit comments

Comments
 (0)
0