Skip to content

No error raised about obvious typo in WHERE clause #4264

@philon123

Description

@philon123

Version

1.30.0

What happened?

This query should fail, since column is_deleted doesn't exist (should bedeleted). But it compiles just fine and only errors when being called! Additional problem: The generated query.sql.go doesn't even select the users name, leading to broken SQL and empty user object:

const getUsers = `-- name: GetUsers :many
select  from user where is_deleted = false
`

type GetUsersRow struct {
}

Relevant log output

no logs, which is the problem :)

Database schema

create table "user" ("name" text not null, deleted bool not null);

SQL queries

-- name: GetUsers :many
select * from user where is_deleted = false;

Configuration

version: 2
sql:
  - schema: schema.sql
    queries: query.sql
    engine: postgresql
    gen:
      go:
        package: sqlc
        out: ./

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions