-
Notifications
You must be signed in to change notification settings - Fork 27
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
AqlQuery with bind_vars #29
Comments
Hello!! Thank you for your post ! Yeah it seems we have something weird there. Let ' me write an example with a PR and I come back to you, sounds good for you ? |
Well, yes, and thanks for the answer! But I think I figured it out:
So convert the struct to a serde_json::value::Value, not a string! Now it works.
|
Hoo mate thank you 👍 I had the same issue as you actually. Thank you for your response. I PR an example so people know where to look in the future ! |
Do you still have this issue by the way ?
|
You could assign the user struct directly by using
Oh I found the doc doesn't contain discription on how to use |
Yes, I agree, try_bind works exactly as I expected. Many thanks! |
Hi
How is one supposed to be using bind_vars? Using the web-query-builder from ArangoDB, I'm used to being able to create queries as follows:
INSERT @user INTO @@collection
withuser: { "name": "Test" }
and@collection: "users"
.Assuming I tried the same with the query builder, I tried:
However, that fails, as the query generated escapes the double quotes in the JSON that I generated. Resulting in this:
{"query":"INSERT @client INTO @@collection LET result = NEW RETURN result","bindVars":{"client":"{\"name\":\"Tester\"}","@collection":"fs_clients" }
instead of this
{"query":"INSERT @client INTO @@collection LET result = NEW RETURN result","bindVars":{"client":"{"name":"Tester"}","@collection":"fs_clients" }
If I tried assigning the
user
struct directly however:I cannot compile, as:
^^^^^^^^ the trait 'std::convert::From<User>' is not implemented for 'serde_json::value::Value'
The text was updated successfully, but these errors were encountered: