Skip to content

Commit f4e076b

Browse files
committed
rm build result
1 parent 8badfc5 commit f4e076b

File tree

1 file changed

+0
-57
lines changed

1 file changed

+0
-57
lines changed

internal/compiler/compile.go

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@ import (
77
"io/ioutil"
88
"path/filepath"
99
"regexp"
10-
"sort"
1110
"strings"
1211

13-
"github.com/kyleconroy/sqlc/internal/codegen/golang"
1412
"github.com/kyleconroy/sqlc/internal/migrations"
1513
"github.com/kyleconroy/sqlc/internal/multierr"
16-
"github.com/kyleconroy/sqlc/internal/pg"
1714
"github.com/kyleconroy/sqlc/internal/sql/ast"
1815
"github.com/kyleconroy/sqlc/internal/sql/catalog"
1916
"github.com/kyleconroy/sqlc/internal/sql/sqlerr"
@@ -141,57 +138,3 @@ func parseQueries(p Parser, c *catalog.Catalog, queries []string) (*Result, erro
141138
Queries: q,
142139
}, nil
143140
}
144-
145-
// Deprecated.
146-
func buildResult(c *catalog.Catalog) (*BuildResult, error) {
147-
var structs []golang.Struct
148-
var enums []golang.Enum
149-
for _, schema := range c.Schemas {
150-
for _, table := range schema.Tables {
151-
s := golang.Struct{
152-
Table: pg.FQN{Schema: schema.Name, Rel: table.Rel.Name},
153-
Name: strings.Title(table.Rel.Name),
154-
Comment: table.Comment,
155-
}
156-
for _, col := range table.Columns {
157-
s.Fields = append(s.Fields, golang.Field{
158-
Name: structName(col.Name),
159-
Type: "string",
160-
Tags: map[string]string{"json:": col.Name},
161-
Comment: col.Comment,
162-
})
163-
}
164-
structs = append(structs, s)
165-
}
166-
for _, typ := range schema.Types {
167-
switch t := typ.(type) {
168-
case *catalog.Enum:
169-
var name string
170-
if schema.Name == c.DefaultSchema {
171-
name = t.Name
172-
} else {
173-
name = schema.Name + "_" + t.Name
174-
}
175-
e := golang.Enum{
176-
Name: structName(name),
177-
Comment: t.Comment,
178-
}
179-
for _, v := range t.Vals {
180-
e.Constants = append(e.Constants, golang.Constant{
181-
Name: e.Name + enumValueName(v),
182-
Value: v,
183-
Type: e.Name,
184-
})
185-
}
186-
enums = append(enums, e)
187-
}
188-
}
189-
}
190-
if len(structs) > 0 {
191-
sort.Slice(structs, func(i, j int) bool { return structs[i].Name < structs[j].Name })
192-
}
193-
if len(enums) > 0 {
194-
sort.Slice(enums, func(i, j int) bool { return enums[i].Name < enums[j].Name })
195-
}
196-
return &BuildResult{structs: structs, enums: enums}, nil
197-
}

0 commit comments

Comments
 (0)