JSON1 extension / json_patch / no such function

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

JSON1 extension / json_patch / no such function

Robert M. Münch
Hi, I'm trying to use the json_patch function in a query and tried in SQLiteStudio and my own program and both times I get a "Error: Database no such function: json_patch"

The query I want to do is:

UPDATE json_products SET json_value = json_patch(json_value,'{"col-1":1000}')

json_extract works and json_value too. So I'm really wondering why json_patch is missing. I checked the sources, and the code is there.

I really don't have an idea what's up here.

--

Robert M. Münch, CEO
M: +41 79 65 11 49 6

Saphirion AG
smarter | better | faster

http://www.saphirion.com
http://www.nlpp.ch

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

signature.asc (544 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JSON1 extension / json_patch / no such function

David Empson
json_patch() was added to the json1 extension in SQLite 3.18.0, but the other functions were there in earlier versions as far back as SQLite 3.9.0. Looking at https://sqlitestudio.pl/index.rvt?act=changelog it appears the latest version of SQLiteStudio (3.1.1) is using SQLite 3.15.0, so that is consistent with it not supporting json_patch().

As for your own program, are you compiling the SQLite 3.18.0 (or later) amalgamation and linking it directly into your program, or are you using a version of SQLite which is supplied by your OS or a library, which might be an older version?

You can check which version of SQLite your program is using with:

SELECT sqlite_version()

> On 25/06/2017, at 8:21 PM, Robert M. Münch <[hidden email]> wrote:
>
> Hi, I'm trying to use the json_patch function in a query and tried in SQLiteStudio and my own program and both times I get a "Error: Database no such function: json_patch"
>
> The query I want to do is:
>
> UPDATE json_products SET json_value = json_patch(json_value,'{"col-1":1000}')
>
> json_extract works and json_value too. So I'm really wondering why json_patch is missing. I checked the sources, and the code is there.
>
> I really don't have an idea what's up here.


_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JSON1 extension / json_patch / no such function

Robert M. Münch
On 25 Jun 2017, at 10:36, David Empson wrote:

> json_patch() was added to the json1 extension in SQLite 3.18.0, but the other functions were there in earlier versions as far back as SQLite 3.9.0.

Hi, I see...

> Looking at https://sqlitestudio.pl/index.rvt?act=changelog it appears the latest version of SQLiteStudio (3.1.1) is using SQLite 3.15.0, so that is consistent with it not supporting json_patch().

Ok, thanks.

> As for your own program, are you compiling the SQLite 3.18.0 (or later) amalgamation and linking it directly into your program,

Yes, I do this. I'm using 3.19.3 now.

I found out that if you don't set SQLITE_ENABLE_JSON1 it seems some functions are available but not all... when setting SQLITE_ENABLE_JSON1 all are available. That's a bit strange IMO, but might be a problem on my end, not sure.


--

Robert M. Münch, CEO
M: +41 79 65 11 49 6

Saphirion AG
smarter | better | faster

http://www.saphirion.com
http://www.nlpp.ch

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

signature.asc (544 bytes) Download Attachment
Loading...