Skip to content

Commit 048a64d

Browse files
authored
Apply suggestions from code review
1 parent 131d7bb commit 048a64d

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

internal/cmd/vet.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,6 @@ func (c *checker) DSN(dsn string) (string, error) {
465465
func (c *checker) checkSQL(ctx context.Context, s config.SQL) error {
466466
// TODO: Create a separate function for this logic so we can
467467
combo := config.Combine(*c.Conf, s)
468-
if c.Dir != "" {
469-
combo.Dir = c.Dir
470-
}
471468

472469
// TODO: This feels like a hack that will bite us later
473470
joined := make([]string, 0, len(s.Schema))

internal/compiler/engine.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ func NewCompiler(conf config.SQL, combo config.CombinedSettings, parserOpts opts
112112
}
113113
}
114114
default:
115-
return nil, fmt.Errorf("unknown engine: %s\n\nTo use a custom database engine, add it to the 'engines' section of sqlc.yaml:\n\n engines:\n - name: %s\n process:\n cmd: sqlc-engine-%s\n\nThen install the plugin: go install github.com/example/sqlc-engine-%s@latest",
116-
conf.Engine, conf.Engine, conf.Engine, conf.Engine)
115+
return nil, fmt.Errorf("unknown engine: %s", conf.Engine)
117116
}
118117
return c, nil
119118
}

internal/compiler/parse.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ func (c *Compiler) parseQuery(stmt ast.Node, src string, o opts.Parser) (*Query,
2727
return nil, err
2828
}
2929

30+
// rewrite queries to remove sqlc.* functions
31+
3032
raw, ok := stmt.(*ast.RawStmt)
3133
if !ok {
3234
return nil, errors.New("node is not a statement")

0 commit comments

Comments
 (0)