feat(marshal): smartUnmarshalRaw1 to handle raw query single return result including THROW statement errors #120
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.
current SmartUnmarshal only handles array return results, doesn't handle other return types such as
create only user
which returns an object.the new SmartUnmarshalRaw1 only handles raw query, and only handles single return result: [map[result:true status:OK time:4.219606ms]]
This is required because of custom functions
DEFINE FUNCTION fn::xxx
andBEGIN;...COMMIT;
block doesn't return arrays, and only returns single result.it also handles
THROW
statement errorsBEGIN; THROW 'blocked'; COMMIT;
: [map[result:An error occurred: blocked status:ERR time:4.219606ms]]this function should cover 99% of people's needs
tested against surrealdb v1.0.0