Re: [sqlite] 3.11.0: Tcl sqlite3 extension can't do variable interpolation _and_ json_extract

2017-06-11 Thread Zach C.
(To clarify, the '$.hash' as the second parameter of json_extract is specifying to extract the 'hash' attribute from the root of the JSON object stored in the json column, per https://sqlite.org/json1.html#compiling_the_json1_extension ) On Fri, Jun 9, 2017 at 9:04 PM, Zach C. <fxc...@gmail.

Re: [sqlite] 3.11.0: Tcl sqlite3 extension can't do variable interpolation _and_ json_extract

2017-06-11 Thread Zach C.
ash" % And setting a variable to the query doesn't like it either: % set query "SELECT json FROM $table WHERE json_extract(json, '\$.hash') = \$hash" SELECT json FROM NotImportant WHERE json_extract(json, '$.hash') = $hash % mydb eval $query % On Fri, Jun 9, 2017 at 10:45 AM, Rich

Re: [sqlite] 3.11.0: Tcl sqlite3 extension can't do variable interpolation _and_ json_extract

2017-06-11 Thread Zach C.
% On Fri, Jun 9, 2017 at 7:48 PM, Andreas Kupries <akupr...@shaw.ca> wrote: > > On 6/9/17, Zach C. <fxc...@gmail.com> wrote: > > > I was partially unclear with using a constant table name here; what I > > > actually need as well is the table name as effectiv

Re: [sqlite] 3.11.0: Tcl sqlite3 extension can't do variable interpolation _and_ json_extract

2017-06-11 Thread Zach C.
I was partially unclear with using a constant table name here; what I actually need as well is the table name as effectively a const that I control as well. So more like mydb eval {$SELECT json FROM $table WHERE json_extract(json, '$.hash') = $someId} The problem is this will cause $table to be

[sqlite] 3.11.0: Tcl sqlite3 extension can't do variable interpolation _and_ json_extract

2017-06-09 Thread Zach C.
I realize it's not the latest version, but I'm having an issue where the moment I want the sqlite3 extension to do variable interpolation, it will break json_extract() See this tclsh output: % mydb eval "SELECT json_extract(json, '$.hash') FROM NotImportant WHERE json_extract(json, '$.hash') =