1
votes

I am writing some Sqlite queries and I would like to use some JSON functions

I have found these JSON functions as a Sqlite extension mentioned here:

Which says:

The json1 extension is a loadable extension

I read about a Loadable extension and eventually get to the SQL Load extension function

The load_extension(X,Y) function loads SQLite extensions out of the shared library file named X using the entry point Y.

I have tried

Select sqlite3_enable_load_extension();
Select sqlite3_load_extension(json1.c, 1);

select Json_array_length(StatData) From [Diary.CallVersion];

But this returns nothing. So what have I done wrong?

1

1 Answers

2
votes

sqlite3_enable_load_extension() is not an SQL function but a part of SQLite's C API.

In other words, you are allowed to load extensions only if the application in which the SQLite library is embedded has explicitly allowed this.