2

The docs says, that The json1 extension is a loadable extension for sqlite3, and the loadable extensions need to be compiled as shared libraries (source).

I searched a lot and I don't know how to enable them. I found that

  • the compiled shared libraries might be provided by libsqlite3-mod-impexp
  • many article tells how to install libsqlite3-mod-impexp (just apt install actually), but none mentioned what's next, to enable the loadable extension, and use it.

Any detailed steps, and sample verification commands appreciated.

I need to use the json1 extension for sqlite3, i.e. using json in where clauses when invoking sqlite3 command from command line.

xpt
  • 1,197

1 Answers1

2

No, libsqlite3-mod-impexp is not necessary, thus no need to do apt install libsqlite3-mod-impexp:

$ sqlite3 
SQLite version 3.11.0 2016-02-15 17:29:24
Enter ".help" for usage hints.
Connected to a transient in-memory database.

sqlite> SELECT json_extract('{"a":2,"c":[4,5,{"f":7}]}', '$');
{"a":2,"c":[4,5,{"f":7}]}

$ dpkg -l | grep sqlite3
ii  libsqlite3-0:a 3.11.0-1ubun amd64        SQLite 3 shared library
ii  sqlite3        3.11.0-1ubun amd64        Command line interface for SQLite

xpt
  • 1,197