Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix read file error
  • Loading branch information
kyleconroy committed Sep 21, 2023
commit e27afd343264b52d8b38d9ffcaf734c9a3f875ab
7 changes: 6 additions & 1 deletion internal/cmd/vet.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/sqlc-dev/sqlc/internal/quickdb"
pb "github.com/sqlc-dev/sqlc/internal/quickdb/v1"
"github.com/sqlc-dev/sqlc/internal/shfmt"
"github.com/sqlc-dev/sqlc/internal/sql/sqlpath"
"github.com/sqlc-dev/sqlc/internal/vet"
)

Expand Down Expand Up @@ -407,7 +408,11 @@ func (c *checker) fetchDatabaseUri(ctx context.Context, s config.SQL) (string, f
}

var migrations []string
for _, query := range s.Schema {
files, err := sqlpath.Glob(s.Schema)
if err != nil {
return "", cleanup, err
}
for _, query := range files {
contents, err := os.ReadFile(query)
if err != nil {
return "", cleanup, fmt.Errorf("read file: %w", err)
Expand Down