You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to generate code for MySQL where there is a union view in the schema definition sqlc panics. It seems it can't in process the parentheses around the select statements.
CREATETABLEauthors0 (
id intPRIMARY KEY,
name textNOT NULL,
bio text
);
CREATETABLEauthors1 (
id intPRIMARY KEY,
name textNOT NULL,
bio text
);
CREATE OR REPLACEVIEW `authors_union` AS
(SELECT*FROM`authors0`)
UNION
(SELECT*FROM`authors1`);
SQL queries
-- name: GetAuthor :oneSELECT*FROM authors0
WHERE id = ? LIMIT1;
-- name: ListAuthors :manySELECT*FROM authors0
ORDER BY name;
-- name: CreateAuthor :execINSERT INTO authors0 (
name, bio
) VALUES (
?, ?
);
-- name: DeleteAuthor :execDELETEFROM authors0
WHERE id = ?;
Version
1.28.0
What happened?
When trying to generate code for MySQL where there is a union view in the schema definition
sqlc
panics. It seems it can't in process the parentheses around the select statements.Relevant log output
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/0578ccf36af3a339036348855d6db6dd12be2a08ca84434521772c51640af60e
What operating system are you using?
macOS
What database engines are you using?
MySQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: