Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parsing of configuration file fails (sqlc.yaml) #3492

Open
calbch opened this issue Jul 19, 2024 · 0 comments
Open

parsing of configuration file fails (sqlc.yaml) #3492

calbch opened this issue Jul 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@calbch
Copy link

calbch commented Jul 19, 2024

Version

1.26.0

What happened?

I tried to switch to use the enhanced analysis in order to be able to use multiple CTE's. In following the docs I added the servers config to the sqlc.yaml. I then encountered

error parsing sqlc.yaml: yaml: unmarshal errors:
  line 2: field servers not found in type config.Config

In order to make sure that it is not a problem with my local setup I tried to use
docker run --rm -v $(pwd):/src -w /src sqlc/sqlc generate with the config provided in the docs

version: '2'
servers:
- engine: postgresql
  uri: ${DATABASE_URI}
sql:
- schema: schema.sql
  queries: query.sql
  engine: postgresql
  database:
    managed: true

The error message is still the same.

Relevant log output

docker run --rm -v $(pwd):/src -w /src sqlc/sqlc generate
error parsing sqlc.yaml: yaml: unmarshal errors:
  line 2: field servers not found in type config.Config

Database schema

Not necessarily important here, since the parsing of the config fails.

SQL queries

No response

Configuration

initial


version: '2'
servers:
- engine: postgresql
  uri: ${DATABASE_URL}
sql:
  - engine: postgresql
    queries: "/db/query/"
    schema: "/db/schema/"
    database:
      managed: true
    gen:
      go:
        package: "db"
        out: "db"
        sql_package: "pgx/v5"
        rename:
          lower: "Name" # rename the struct field for user name insertion
        overrides:
          - column: "lenges.schedule"
            go_type:
              import: "lenge-backend/lenge/model"
              type: "Schedule"

to verify:

version: '2'
servers:
- engine: postgresql
  uri: ${DATABASE_URI}
sql:
- schema: schema.sql
  queries: query.sql
  engine: postgresql
  database:
    managed: true

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

@calbch calbch added bug Something isn't working triage New issues that hasn't been reviewed labels Jul 19, 2024
@kyleconroy kyleconroy removed the triage New issues that hasn't been reviewed label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants