-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
"ppx_pgsql's nullability heuristic has failed" for outer joins
For example if we have 2 tables:
CREATE TABLE authors (id serial PRIMARY KEY, name varchar(255) NOT NULL);
INSERT INTO authors (id, name) VALUES (1, 'John Doe');
CREATE TABLE books (id serial PRIMARY KEY, title varchar(255) NOT NULL, author int NOT NULL REFERENCES authors(id) ON DELETE CASCADE);
Following query will have type string * string
instead of string * (string option)
:
[%sqlf {|
SELECT
authors.name,
books.title
FROM authors
LEFT OUTER JOIN books ON books.author = authors.id
|}]
Because books.title is NOT NULL
, but author without any book will cause nullability heuristic has failed
May be there is a way to advice nullability for ppx_pgsql?
Metadata
Metadata
Assignees
Labels
No labels