Skip to content

Boolean filter generation fails for SQLite #2424

Closed
@SoMuchForSubtlety

Description

@SoMuchForSubtlety

Version

1.18.0

What happened?

Boolean filter expressions don't seem to get processed correctly. I can get it to work by changing the query slightly, but then I lose type information.

Relevant log output

No response

Database schema

create table my_table
(
    invalid boolean,
    foo     varchar
);

SQL queries

-- name: GetData :many
select *
from my_table
where (cast(sqlc.arg(allow_invalid) as boolean) or not invalid);

Configuration

No response

Playground URL

https://play.sqlc.dev/p/80e82864f4994ee1812495bbdfa2bd351fdfa43f1a15968dc61d192e79b22e28

What operating system are you using?

Linux

What database engines are you using?

SQLite

What type of code are you generating?

Go

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions