The specs2 unit tests falsely expects all columns to be nullable if the query uses a view. The root cause seems to be incorrect metadata from PostgreSQL. PostgreSQL reports all view columns as nullable even for trivial views:
create table test (id int not null);
create view test_view as select * from test;
\d test
Table "public.test"
Column | Type | Modifiers
--------+---------+-----------
id | integer | not null
viskar=> \d test_view
View "public.test_view"
Column | Type | Modifiers
--------+---------+-----------
id | integer |
Related StackOverflow question: https://stackoverflow.com/questions/17301323/why-are-my-views-columns-nullable
Maybe a simple solution would be to be able to manually disable the null check for a query but keeping the other type mapping validation features enabled?
The specs2 unit tests falsely expects all columns to be nullable if the query uses a view. The root cause seems to be incorrect metadata from PostgreSQL. PostgreSQL reports all view columns as nullable even for trivial views:
Related StackOverflow question: https://stackoverflow.com/questions/17301323/why-are-my-views-columns-nullable
Maybe a simple solution would be to be able to manually disable the null check for a query but keeping the other type mapping validation features enabled?