Start postgresql:
docker run --rm --name postgresql -e POSTGRES_PASSWORD=password -p 5432:5432 postgres
Connect to it in separate terminal:
docker exec -it postgresql psql -U postgres
And populate DB:
CREATE TABLE animal (id SERIAL PRIMARY KEY, name TEXT NOT NULL);
CREATE TABLE house (title TEXT NOT NULL, location TEXT NOT NULL, animal INTEGER REFERENCES animal);
INSERT INTO animal (name) VALUES ('dog');
And run our query which results into unexpected result given how line 31 is defined:
$ ./HaSQLNestedRecord.hs
Left (QueryError "SELECT animal.id, animal.name, house.title, house.location FROM animal LEFT JOIN house ON house.animal = animal.id WHERE animal.id = $1" ["1"] (ResultError (RowError 0 UnexpectedNull)))