crate / crate-python

Python DB API client library for CrateDB, using HTTP.
https://cratedb.com/docs/python/
Apache License 2.0
79 stars 30 forks source link

Improve exception handling: Properly raise `IntegrityError` exceptions #583

Closed amotl closed 11 months ago

amotl commented 11 months ago

About

When receiving DuplicateKeyException errors from CrateDB, SQLAlchemy should raise corresponding IntegrityError exceptions instead of ProgrammingError, because applications expect it this way.

Details

This patch evaluates the area preliminarily, mainly whether it will work by using CrateDB's own variants of the canonical DBAPI exceptions, and whether SQLAlchemy will honor that properly.

References

matriv commented 11 months ago

Apologies, accidentally I approved already, instead of only comment.

amotl commented 11 months ago

Thanks. I've just amended the patch to provide a corresponding test case.