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 I join another table using LEFT OUTER JOIN, the referenced colums are not treated as potential NULL.
For example, int32 is used instead of sql.NullInt32
Relevant log output
No response
Database schema
CREATETABLEauthors
(
id INT(10) NOT NULL,
name VARCHAR(255) NOT NULL,
parent_id INT(10),
PRIMARY KEY (id)
);
CREATETABLEparents
(
id INT(10) NOT NULL,
name VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
);
SQL queries
-- name: AllAuthors :manySELECTauthors.id,
authors.name,
parents.idas alias_id,
parents.nameas alias_name
FROM authors LEFT OUTER JOIN parents ON (authors.parent_id=parents.id);
@timstudd, thank you. This fix already enabled me to get rid of a bunch of COALESCE statements.
Unfortunately, it still doesn't work with LEFT OUTER JOINs with the same table. It might be related to #1237.
Version
1.10.0
What happened?
When I join another table using
LEFT OUTER JOIN
, the referenced colums are not treated as potentialNULL
.For example,
int32
is used instead ofsql.NullInt32
Relevant log output
No response
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/ce7fec524f816ea7f485c8d9b83c60a0e36c7de065db7d23150d7271ce59bd90
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: