MonetDB / pymonetdb

The Python API for MonetDB
https://www.monetdb.org/
Mozilla Public License 2.0
28 stars 20 forks source link

SQLSTATE error code removed from error messages #75

Closed yzchang closed 4 years ago

yzchang commented 4 years ago

This is related to #74. As a workaround, I try to check for the SQLSTATE error code to distinguish an SQL error from a connection error, since the SQL standard says that every SQL error should have an SQLSTATE error code.

Then I noticed that pymonetdb removes the SQLSTATE error code for several cases including COPY INTO. (see https://github.com/gijzelaerr/pymonetdb/blob/8e6830d005d0f25e7d4630423e40014057058919/pymonetdb/mapi.py#L46 and until line 74)

What's the retional behind the removal of those error codes? Is it possible to add them back?

gijzelaerr commented 4 years ago

The rationale behind removing them was that I assumed they were part of a low-level protocol. I will add them back.

yzchang commented 4 years ago

Haha, that would solve quite some problems, because in my use case, I basically don't mind if any SQL queries went wrong, but want to capture other errors to take further actions.

yzchang commented 4 years ago

When do you plan to reach the 1.4.0 milestone?

gijzelaerr commented 4 years ago

friday :)

yzchang commented 4 years ago

cool!

gijzelaerr commented 4 years ago

Fixed in master and 1.4.0