Open nigredo-tori opened 6 years ago
I made a silly mistake yesterday, defining something like this:
sql"DELETE FROM foo RETURNING lo_unlink(bar)".update
Basically, I used RETURNING clause to run an effect for each row being deleted, and declared this as an Update0, intending to ignore the results.
RETURNING
Update0
The problem is, Doobie analysis checker didn't catch this, resulting in a runtime exception when executing the Update0:
org.postgresql.util.PSQLException: A result was returned when none was expected.
I'd like for the checker to properly diagnose this problem in the future.
Good idea. The difference between update and query is basically whether you expect a resultset or not. We can certainly check this.
update
query
I made a silly mistake yesterday, defining something like this:
Basically, I used
RETURNING
clause to run an effect for each row being deleted, and declared this as anUpdate0
, intending to ignore the results.The problem is, Doobie analysis checker didn't catch this, resulting in a runtime exception when executing the
Update0
:I'd like for the checker to properly diagnose this problem in the future.