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

Missing columns not being detected #3355

Open
strackfeldt opened this issue Apr 28, 2024 · 0 comments
Open

Missing columns not being detected #3355

strackfeldt opened this issue Apr 28, 2024 · 0 comments
Labels
bug Something isn't working triage New issues that hasn't been reviewed

Comments

@strackfeldt
Copy link

Version

1.26.0

What happened?

Hi, missing columns not being detected when not using parameters

Relevant log output

none

Database schema

create table a (
	id BIGSERIAL primary key
);

create table b (
	id BIGSERIAL primary key
);

SQL queries

-- name: Test :one
select
	*
from
	a
where
	does_not_exist = 'does_not_exist';

-- name: Test2 :one
select
	a.*
from
	a
	join b on a.does_not_exist = b.does_not_exist;

-- -- name: Test3 :one <- THIS GETS DETECTED
-- select
--	*
-- from
--	a
-- where
--	does_not_exist = $1;

Configuration

{
  "version": "2",
  "sql": [{
    "schema": "schema.sql",
    "queries": "query.sql",
    "engine": "postgresql",
    "gen": {
      "go": {
        "out": "db"
      }
    }
  }]
}

Playground URL

https://play.sqlc.dev/p/3c9631eb7dc7e42a6a8c8fa81ee16f51869089c4fbd0f4ae2304d5e801dda5b9

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@strackfeldt strackfeldt added bug Something isn't working triage New issues that hasn't been reviewed labels Apr 28, 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 triage New issues that hasn't been reviewed
Projects
None yet
Development

No branches or pull requests

1 participant