-
Notifications
You must be signed in to change notification settings - Fork 30
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
CBOR support for parameters #175
Conversation
This commit adds the support for sending the paramters encapsulated as CBOR. The implementation makes use of the already available paramter conversion functionality, which prepares the parameters as string values. Consequently, except NULL values (and type), the values will be sent as strings and have the server do a final conversion to the signaled SQL type (which is actually also the case with JSON).
- for SQL_VARCHAR targets, the JSON parameter serialization adds the quotes, which need to be stripped before CBOR-packing the result. This commit also change the integer types of two vars, to avoid signed/unsigned comparision warnings.
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.
LGTM
driver/queries.c
Outdated
* but: (1) it's a simplified and tested implementation; (2) the overall | ||
* performance impact is negligible with this driver's currently intended | ||
* usage pattern (SELECTs only, fetching data volume far outweighing | ||
* query's); (3) the server will convert the received value according to the |
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.
nit: "querys" should not have an apostrophe
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.
Thanks, addressed.
- correct comment phrasing.
* CBOR support for parameters This commit adds the support for sending the paramters encapsulated as CBOR. The implementation makes use of the already available paramter conversion functionality, which prepares the parameters as string values. Consequently, except NULL values (and type), the values will be sent as strings and have the server do a final conversion to the signaled SQL type (which is actually also the case with JSON). * split CBOR param value encoding by meta type - for SQL_VARCHAR targets, the JSON parameter serialization adds the quotes, which need to be stripped before CBOR-packing the result. This commit also change the integer types of two vars, to avoid signed/unsigned comparision warnings. * address PR review note - correct comment phrasing. (cherry picked from commit 758b8e2)
This PR adds the support for sending the parameters encapsulated as
CBOR.
The implementation makes use of the already available parameter conversion
functionality, which prepares the parameter values as strings.
Consequently, except NULL values (and type), the values will be sent as
strings and have the server do a final conversion to the signaled SQL
type (which is actually also the case with JSON).