You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Strings are not escaped when converting Java TypeQL to a query string, despite requiring escape characters in order for the query string to be valid.
It also appears that the required escape characters are inserted, rather than being removed during parsing of the query, and that this was an oversight during a bugfix for asymmetrical escaping behaviour in an older version of TypeQLpre 1.0).
The behaviour is not standard, can cause users to accidentally break their queries (when programmatically generating them) and prevents users from inserting any string.
Environment
OS (where TypeQL server runs): any
TypeQL version (and platform): any
TypeQL client: any (most notable in client-java)
Other environment details:
Reproducible Steps
Steps to create the smallest reproducible scenario:
1.
// Gives us an invalid TypeQL query
System.out.println(TypeQL.insert(TypeQL.var("x").isa("person").has("name", "b\"o\"b")).toString());
Expected Output
insert $x isa person, has name "b\"o\"b";
Actual Output
insert $x isa person, has name "b"o"b";
The text was updated successfully, but these errors were encountered:
## Usage and product changes
User-defined functions and structs:
```typeql
fun mean_salary($c: company) -> double? :
match
(company: $c, employee: $_) isa employment, has salary $s;
return mean($s);
```
```typeql
struct dated_coordinate:
longitude value double,
latitude value double,
date value datetime;
```
Query pipelines:
```
with fun costliest_printer($employee: employee) -> printer? :
match
($printer, $employee) isa print_permission;
$printer has cost_per_page $cost;
sort $cost desc;
return first($printer);
match
$printer isa printer, has office_number $n, has newly_installed true;
$employee isa employee, has office_number $n;
put ($employee, $printer) isa print_permission;
match
$high_cost_printer = costliest_printer($employee), has printer_name $name;
not { $printer is $high_cost_printer; };
$employee has contact $address;
insert
$notice isa queued_email, has recipient $address,
has content "Do you still need the printer " + $name + "?";
```
New undefine syntax allows user to be more precise as to what is being
undefined:
```typeql
undefine
owns age from person;
@regex from first-name;
as name from person owns first-name;
```
New, more concise delete syntax:
```typeql
match $p isa person, has name $n;
delete $n of $p;
```
Implement JSON-like string unescaping (closes#106).
See [The TypeDB 3.0 Roadmap](<https://typedb.com/blog/typedb-3-roadmap>)
for more details!
Description
Strings are not escaped when converting Java TypeQL to a query string, despite requiring escape characters in order for the query string to be valid.
It also appears that the required escape characters are inserted, rather than being removed during parsing of the query, and that this was an oversight during a bugfix for asymmetrical escaping behaviour in an older version of TypeQLpre 1.0).
The behaviour is not standard, can cause users to accidentally break their queries (when programmatically generating them) and prevents users from inserting any string.
Environment
Reproducible Steps
Steps to create the smallest reproducible scenario:
1.
Expected Output
Actual Output
The text was updated successfully, but these errors were encountered: