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
Cannot include escaped doublequote character in string #223
Comments
There is another issue with strings. I've tried avoiding the problem reported here by using raw string notation e.g. The following example will FAIL with reason
Just removing the I am guessing this might be because Rust uses The combination of the issue reported by @skyrod-vactai and this makes it impossible to store arbitrary strings in CozoDB. For example storing JSON, HTML, CSS, XML, SVG and any other source code that typically contains multiple instances of double, single quotes and the hash char. The following simpler example will also fail
|
I just reported this as a separate issue in #234 |
@aramallo @skyrod-vactai i figure out workaround - if i pass strings as params to a query it is works . so you could use variables binded to a query params - it is working well |
Do you mind posting an example here? Thanks a lot @Volland |
BTW the solution I posted works on the parser online playground (which I guess uses the latest version) but not when used inside coso, I need to check upgrading the parser lib version in cozo and doublecheck |
@aramallo sure |
Ah nice thanks @Volland !! |
According to the docs:
And from the tutorial:
JSON rules do allow
\"
and serde_json produces JSON with that sequence. But cozo doesn't accept it:I ran into this while trying to insert data. What I did was format the row data as JSON, and spliced that into a generic query that does a :put. If there's a better way to insert data let me know. I know you can import an entire JSON file but I want something I can call from my program (I'm using the cozo library in a rust program).
The text was updated successfully, but these errors were encountered: