Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

No error raised about obvious typo in WHERE clause #4264

Open
@philon123

Description

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

        AltStyle によって変換されたページ (->オリジナル) /