sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

"Error parsing sqlc.yaml" when generating files

Open andrwkoval opened this issue 2 years ago • 4 comments

Version

1.24.0

What happened?

Can't generate the files, because it seems it can't unmarshal the sqlc.yaml file.

Relevant log output

go run -mod=mod github.com/sqlc-dev/sqlc/cmd/sqlc generate
go: finding module for package github.com/sqlc-dev/sqlc/cmd/sqlc
error parsing sqlc.yaml: yaml: unmarshal errors:
  line 15: field output_querier_file_name not found in type opts.Options
exit status 1

Database schema

Not relevant.

SQL queries

Not relevant.

Configuration

Not a full configuration, just the problematic part

sql:
  - gen:
      go:
        output_db_file_name: "db.gen.go"
        output_models_file_name: "models.gen.go"
        output_querier_file_name: "querier.gen.go"
        output_files_suffix: ".gen.go"

Playground URL

No response

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

andrwkoval avatar Nov 23 '23 13:11 andrwkoval

Fixed by https://github.com/sqlc-dev/sqlc/pull/3006

kyleconroy avatar Nov 24 '23 19:11 kyleconroy

The fix has been merged, but going to keep this open until we do a release that contains the fix.

kyleconroy avatar Nov 24 '23 19:11 kyleconroy

Is there a workaround currently or a timeline about when the release with the fix will go out?

I tried rolling back my version but no dice.. 🤔

brew install [email protected]
Warning: No available formula with the name "[email protected]".
==> Searching for similarly named formulae and casks...
Error: No formulae or casks found for [email protected].

connor11528 avatar Dec 18 '23 15:12 connor11528

You should be able to rename

output_querier_file_name to output_queries_file_name

in your sqlc.yaml file until the update is released.

ericbock avatar Dec 18 '23 16:12 ericbock