-
Notifications
You must be signed in to change notification settings - Fork 31
Prepare statement again when it is lost #126
Conversation
run(args, connection) | ||
f = run(args, connection) | ||
f.fallback do |e| | ||
raise e unless e.is_a?(Cql::QueryError) && e.code == 0x2500 # unprepared |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a comment, use a constant for the error code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seemed like a convention to use comments, see https://github.com/iconara/cql-rb/blob/master/lib/cql/protocol/responses/detailed_error_response.rb#L16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes even I do bad things
If an ALTER TABLE is performed the prepared statements are lost. In this case the statement should be prepared again.
cd1e9f4
to
4317c04
Compare
Added constants for all error codes. |
One final request: put the |
The |
Good point. It doesn't look like it's possible to make Yard understand that it should show the constants as public under |
I'll release this as v2.0.5 |
If an ALTER TABLE is performed the prepared statements are lost. In this case the statement should be prepared again.