Version
1.17.2
What happened?
sqlc generate fails in MySQL if there is a CASE statement as a SELECT field.
Relevant log output
sqlc generate failed.
# package db
query.sql:9:1: parse table name: unexpected node type: *ast.Integer
Database schema
CREATE TABLE users (
id int PRIMARY KEY,
name text NOT NULL,
bio text
);
SQL queries
-- name: UserExists :one
SELECT
CASE WHEN
EXISTS (
SELECT * FROM users WHERE id = '123'
)
THEN 1
ELSE 0
END AS result;
Configuration
No response
Playground URL
https://play.sqlc.dev/p/5aeef78626b3adaf91194dfd05854ca22d717e15114c01f8bb21d98826a39848
What operating system are you using?
No response
What database engines are you using?
MySQL
What type of code are you generating?
Go
Version
1.17.2
What happened?
sqlc generate fails in MySQL if there is a CASE statement as a SELECT field.
Relevant log output
Database schema
SQL queries
Configuration
No response
Playground URL
https://play.sqlc.dev/p/5aeef78626b3adaf91194dfd05854ca22d717e15114c01f8bb21d98826a39848
What operating system are you using?
No response
What database engines are you using?
MySQL
What type of code are you generating?
Go