Compare commits

...

3 Commits

4 changed files with 2 additions and 11 deletions

View File

@ -932,7 +932,6 @@ func (c *compilerContext) renderNestedWhere(ex *qcode.Exp, ti *DBTableInfo) erro
return err
}
//fmt.Println(">", ex)
io.WriteString(c.w, `)`)
}

View File

@ -5,7 +5,6 @@ import (
"strings"
"github.com/gobuffalo/flect"
"github.com/jackc/pgx/v4/pgxpool"
)
type DBSchema struct {
@ -51,8 +50,7 @@ type DBRel struct {
}
}
func NewDBSchema(db *pgxpool.Pool,
info *DBInfo, aliases map[string][]string) (*DBSchema, error) {
func NewDBSchema(info *DBInfo, aliases map[string][]string) (*DBSchema, error) {
schema := &DBSchema{
t: make(map[string]*DBTableInfo),

View File

@ -33,11 +33,7 @@ func argMap(ctx context.Context, vars []byte) func(w io.Writer, tag string) (int
return 0, errors.New("query requires variable $user_role")
}
fmt.Println("1>", tag)
fmt.Println("2>", string(vars))
fields := jsn.Get(vars, [][]byte{[]byte(tag)})
fmt.Println("2.1>", fields)
if len(fields) == 0 {
return 0, nil
@ -47,8 +43,6 @@ func argMap(ctx context.Context, vars []byte) func(w io.Writer, tag string) (int
fields[0].Value = v[1 : len(v)-1]
}
fmt.Println("3>", string(fields[0].Value))
return w.Write(escQuote(fields[0].Value))
}
}

View File

@ -25,7 +25,7 @@ func initCompilers(c *config) (*qcode.Compiler, *psql.Compiler, error) {
return nil, nil, err
}
schema, err = psql.NewDBSchema(db, di, c.getAliasMap())
schema, err = psql.NewDBSchema(di, c.getAliasMap())
if err != nil {
return nil, nil, err
}