typhon-project / typhonql

Typhon Query Language
Eclipse Public License 2.0
4 stars 1 forks source link

[BUG]preparedupdate does not seem to work #87

Closed OrfenCLMS closed 4 years ago

OrfenCLMS commented 4 years ago

Describe the bug

Performing a preparedupdate statement results in an error, while the same query as insert works normally.

Query

{"command":"insert OBLG_GNL{OBLG_CGY_DSC:??OBLG_CGY_DSC}","parameterNames":["OBLG_CGY_DSC"],"boundRows":[["dagafdga"]]}

Model

Textual ML & DL models are attached.

alpha_model.txt alpha_dl.txt

Expected behavior

Expecting the query to go work correctly as it does under the insert format.

REST API

If the bug happens when calling the REST API:

Additional context

Stack trace of QL included StackTrace2.txt

DavyLandman commented 4 years ago

It's due to not encoding the parameter value: it should be "boundRows":[["\"dagafdga\""]] (not the escaped quotes)

This is due to the fact that most QL literals cannot be expressed in Json, so we decided to always have values be encoded as ql literals inside a string. So a number will be "420", and a date: "$2020-10-12$".