added new memeber SqlState to PostgreSQLException and made use of it.#4099
added new memeber SqlState to PostgreSQLException and made use of it.#4099aleks-f merged 3 commits intopocoproject:develfrom
Conversation
…in StatementExecutor
|
@omerbrandis can you please write a test case for this? |
|
Dear alexks-f. Can you please provide some instruction (or a reference to documentation about ) as to where/how to add a test for this thanks, |
|
@omerbrandis tests are here |
|
Hello @aleks-f I suggest the following test : } can you have a look, tell me if it seems sufficient or otherwise. thanks, |
|
Hello @aleks-f I've tested the new test on my machine. if there's anything else I should do , plz let me know. |
|
|
||
|
|
||
| private: | ||
| char _SqlState[6]; |
There was a problem hiding this comment.
naming convention - this is not how we name member variables
| /// throwing it again. | ||
|
|
||
| const char* SqlState() const noexcept; | ||
| /// Returns the SqlState |
There was a problem hiding this comment.
tabs, not spaces for indentation
|
|
||
| try | ||
| { | ||
| *_pSession << "syntax error", now; |
…stgreSQLException regarding null termination of _sqlState data member
|
Hello @aleks-f I've pushed new version. Sorry for the naming issues, I also fixed a bug that did not appear previously. hope that's everything, thanks, |
…#4099) * added new memeber SqlState to PostgreSQLException and made use of it in StatementExecutor * Added test case testSqlState * fixed nameing convention errors. fixed bug in PostgreSQLException::PostgreSQLException regarding null termination of _sqlState data member
…#4099) * added new memeber SqlState to PostgreSQLException and made use of it in StatementExecutor * Added test case testSqlState * fixed nameing convention errors. fixed bug in PostgreSQLException::PostgreSQLException regarding null termination of _sqlState data member
added support for SqlState in data::poco::postgresql.
tested locally against postgresql 15.3.
was not able to find a suitable "location" for adding a "test" to the repo.
tried to make it as simple as I could:
added a data member _SqlState to PostgreSQLException,
added a getter SqlState(),
added ctor PostgreSQLException(const std::string& aMessage,const char * pAnSqlState);
added ctor StatementException::StatementException(const std::string& aMessage,const char pAnSqlState*);
modified StatementExecutor::prepare & StatementExecutor::execute(),
to make use of the new ctor for StatementException, such that the SqlState will be made available to the catcher of the exception.
:-)