Parameterized from_string tracks output params#451
Open
villagestevers wants to merge 1 commit intomainfrom
Open
Parameterized from_string tracks output params#451villagestevers wants to merge 1 commit intomainfrom
villagestevers wants to merge 1 commit intomainfrom
Conversation
Also move to using CustomResult for from_string. A future change will call this when a constant string is used. Updates internal types, external to follow.
| size_t byte_size = static_cast<size_t>(p.dimension) * p.bytes_per_elem; | ||
| if (buf.size() < byte_size) return true; | ||
|
|
||
| // |
| if (*s == ',') s++; | ||
| } | ||
| if (*s != ']') { | ||
| out.warning("tvector_from_string: missing ']'"); |
Member
There was a problem hiding this comment.
Do we have a test that these warnings/errors work correctly? If so, this is a real step for the better!
| // ============================================================================= | ||
|
|
||
| // Encode: string -> binary. false=success, true=error. SIZE_MAX length = NULL. | ||
| using TypeEncodeFunc = bool (*)(std::string_view from, Span<unsigned char> buf, |
Member
There was a problem hiding this comment.
You should keep the old signatures around and handle them, until you migrate vsql-cube and vsql-vector
| using TypeEncodeWithParamsFunc = bool (*)(const P &, std::string_view from, | ||
| Span<unsigned char> buf, | ||
| size_t *length); | ||
| using TypeEncodeWithParamsFunc = void (*)(MaybeParams<P> &, |
Member
There was a problem hiding this comment.
I was thinking that CustomResultWith
would be the thing that would have the MaybeParams. I guess I was thinking that there would be some kind of symmetry with other functions that couldn't return their type params. But now that I think about it, that doesn't make much sense. If we don't want them to use the out.params(), maybe we should only support the CustomResult?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also move to using CustomResult for from_string.
A future change will call this when a constant string is used.
Updates internal types, external to follow.
Updates #449