Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlstate not available in exceptions #5

Closed
anse1 opened this issue Nov 5, 2016 · 3 comments
Closed

sqlstate not available in exceptions #5

anse1 opened this issue Nov 5, 2016 · 3 comments

Comments

@anse1
Copy link

anse1 commented Nov 5, 2016

I'm about to switch sqlsmith from libpqxx to libpq since the former doesn't record the sqlstate in exceptions.

I looked at the libpqxx code, but I wasn't sure where to introduce it in the class hierarchy.
For example, the standard also defines an sqlstate for errors that appear on the client side, so ideally we'd synthesize these.

also reported here: http://pqxx.org/development/libpqxx/ticket/219

@jtv
Copy link
Owner

jtv commented Dec 23, 2016

Okay, okay, I'll change it!

What is the "the standard" that you're referring to? I'd like to have a look first. The SQL language-bindings recommendations?

@jtv
Copy link
Owner

jtv commented Dec 24, 2016

Ah, the standard for SQLSTATE I guess. It seems a little too much to introduce it for all client-side exceptions... For now I'm just adding it to sql_error.

@jtv
Copy link
Owner

jtv commented Dec 24, 2016

Okay — I just tagged 5.0.0, and added sql_error::sqlstate() in 5.0.1. Please let me know how it works for you.

Important to know that the field can be empty, in cases where no sqlstate is known. As you say we can extend this later by synthesising values, and perhaps moving the new information up the inheritance hierarchy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants