SQLite Forum

SQLite3 shell doing math operation on parameter substitution
Login
What to do with JSON's key/value when supplying it to  **.parameter** .dot command?

If one would use proposed workaround by double quoting, then it looks like the only way to supply JSON is to escape all double quotes in original content, which is wrong and unacceptable from security point of view to attempt processing raw data.


All of below will fail
<strong>
```
.param set @j "'{"key":"value"}'"
.param set @j "\"{"key":"value"}\""
.param set @j '\'{"key":"value"}\''
.param set @j '\\'{"key":"value"}\\''
.param set @j '''{"key":"value"}'''
```
</strong>

This works:
<strong>
```
.param set @j ('{"key":"value"}')
```
</strong>

but this below doesn't again, because of space after comma:
<strong>
```
.param set @jjj ('{"key1":"value1", {"key2":"value2"}')
```
</strong>