pugsql icon indicating copy to clipboard operation
pugsql copied to clipboard

improve errors when misapplying `:one`, `:many`, etc to queries that don't return anything

Open mcfunley opened this issue 5 years ago • 1 comments

We can probably give a pugsql-specific error when this happens. Currently you get something like:

sqlalchemy.exc.ResourceClosedError: This result object does not return rows. It has been closed automatically.

(Might be driver-specific, not sure)

mcfunley avatar Jul 15 '19 19:07 mcfunley

Definitely driver-specific. I got this error because I used the :insert return type with cx_Oracle, which doesn't return anything for inserts. Some documentation about all this would be nice, too. I would be happy to work on it, but I might need a little guidance.

Thanks for a great package, BTW!

nihiliad avatar May 06 '20 19:05 nihiliad