Skip to content

sqlc generate should emit a warning when using an unknown sql_package #3104

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

Closed
devonhk opened this issue Jan 4, 2024 · 0 comments · Fixed by #3241
Closed

sqlc generate should emit a warning when using an unknown sql_package #3104

devonhk opened this issue Jan 4, 2024 · 0 comments · Fixed by #3241
Labels
enhancement New feature or request 🔧 golang
Milestone

Comments

@devonhk
Copy link

devonhk commented Jan 4, 2024

What do you want to change?

I had a typo in my sqlc.json file:

{
  "version": "2",
  "sql": [{
    "schema": "schema/schema.sql",
    "queries": "queries.sql",
    "engine": "postgresql",
    "gen": {
      "go": {
        "out": "db",
        "sql_package": "pgx/5"
      }
    }
  }]
}

When I ran sqlc generate it happily generated code without any warnings.

I think the dev experience could be improved with a warning message along the lines of:
sql_package: pgx/5 is unknown. Defaulting to database/sql codegen...

What database engines need to be changed?

No response

What programming language backends need to be changed?

Go

@devonhk devonhk added enhancement New feature or request triage New issues that hasn't been reviewed labels Jan 4, 2024
@kyleconroy kyleconroy added 🔧 golang and removed triage New issues that hasn't been reviewed labels Mar 4, 2024
@kyleconroy kyleconroy added this to the 1.26.0 milestone Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 🔧 golang
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants