Skip to content

Unable to detect sqlc.yaml when running sqlc via Docker #1853

@SuriMarks

Description

@SuriMarks

Version

1.15.0

What happened?

I am trying to run sqlc from the official docker container, When I do, I get an error that the file sqlc.yaml does not exist (despite it being present), but preplexingly, if I add an sqlc.json file it complains that there are two files present (both the yaml and json). So clearly it can detect the files, but wont proceed when they are both there. I just need it to detect one and run with it.

In the log section I have put some terminal output which I believe illustrates the problem well, and also shows the docker command I am using.

Relevant log output

// confirming sqlc.yaml file exists
$ ls -l sqlc.yaml
-rw-r--r--. 1 username username 176 Sep 18 21:15 sqlc.yaml

// running the sqlc docker container produces a file not found error
$ ./sqlc-run.sh
error parsing sqlc.yaml: file does not exist

// adding an sqlc.json file causes an error for the existence of two config files
$ touch sqlc.json
$ ./sqlc-run.sh
error: both sqlc.json and sqlc.yaml files present

// this is the source of the script to run above
$ cat sqlc-run.sh 
#!/bin/bash

docker run --rm \
-v .:/src \
-w /src \
kjconroy/sqlc:1.15.0 \
generate

Database schema

No response

SQL queries

No response

Configuration

version: "2"
sql:
  - schema: "./db/schema/"
    queries: "./db/queries/"
    engine: "postgresql"
    strict_function_checks: true
    gen:
      go:
        out: "./db/sqlc"

Playground URL

No response

What operating system are you using?

Linux

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions