(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.
% mydb eval "SELECT json FROM $table WHERE json_extract(json, '\$.hash') =
\$hash"
% mydb eval "SELECT json FROM $table WHERE json_extract(json, '$.hash') =
$hash"
{{"a": "b", "hash": 244718899}}
I know, I _really_ don't want Tcl interpolating $hash directly in here, but
sqlite3's Tcl package
I did try the colon-style formatting as well, it didn't work. I didn't know
about [string map], but I tried it too, no luck:
% set map [dict create <> NotImportant]
<> NotImportant
% mydb eval [string map $map {SELECT json FROM <> WHERE
json_extract(json, '$.hash') = $hash}]
%
On Fri, Jun 9,
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
> On 6/9/17, Zach C. wrote:
> > 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,
On 6/9/17, Zach C. wrote:
> 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') =
On 6/9/17, Zach C. wrote:
> 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')
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') =
8 matches
Mail list logo