client: add BeginInsert(const Query&) overload#518
Conversation
0f33a4c to
2b434f0
Compare
Add public overload to support fully configured Query (with settings, params, query_id, callbacks) for streaming inserts. Removed the legacy string overloads for BeginInsert (they were thin wrappers); string literals now resolve via the Query overload (implicit ctor, which is kept non-explicit for convenience). Includes the internal fix to pass the full Query to SendQuery (instead of GetText()) so that query_id etc. are preserved when using the rich form. This was the original local patch; exercised by bindings using settings on insert/writeStart.
2b434f0 to
d3984cf
Compare
Making the Query ctors explicit broke every call site that passes string literals to Execute(), Select(), BeginInsert(), etc. The BeginInsert(const Query&) overload still accepts string literals via the implicit conversion, matching the PR intent.
| /// Use BeginInsert(const Query&) for settings, query_id, callbacks etc. | ||
| Block BeginInsert(const Query& query); |
There was a problem hiding this comment.
Why should we take away a part of existing API on which people probably relay? Can BeginInsert(const Query& query) be an addition to the exiting functions?
|
The main reason To avoid this issue, the decision was made not to expose the If you can explain why you need it, we might try to find another solution to it. |
Restore BeginInsert(const std::string&, const std::string&) alongside the new BeginInsert(const Query&). Single-string callers already convert to Query implicitly, but the two-arg (query, query_id) form has no implicit conversion, so dropping it was a source break. It differs in arity from the Query overload, so there is no ambiguity.
|
The driver is per-insert settings, not the handlers. In my binding every streaming insert attaches On the handlers: If exposing the full |
I'm not sure that's entirely true. The first thing that comes to mind is a server exception. If we go down this route, could we throw an exception stating that |
Add Block BeginInsert(const Query& query).
The Impl already supported a fully-configured Query (settings, params, query_id, OnData, etc.). The public surface only exposed the string forms.
This lets callers do proper streaming inserts with the full Query feature set (symmetric to the Query forms already available for Select/Execute).