SQLite Forum

.expert via api
What I tried today:

The [https://www.sqlite.org/src/dir?ci=trunk&name=ext/expert | page] about this extension contains all the necessary information if you want to compile and use this feature. Some minor points:
  *  sqlite3expert.c compiles into linkable code (no need for expert.c) and can be statically linked with an executable. If you want to use a dynamic library, export necessary functions (mentioned in the docs) and be ready for a large executable (containing all the SQLite inside). So it's not an extension in the sense how loadable extensions are used. I personally only tried the statically linked approach.
  *  Every successful call to sqlite3_expert_sql implicitly creates an auto-increment statement id that you should pass to sqlite3_expert_report in order to get the report (starting with 0)
  *  The extension provides other information as well. But in order to get index suggestion, call sqlite3_expert_report with EXPERT_REPORT_INDEXES constant. You will get a multi-line suggestion with one or more indexes or Null if there's no need for new indexes
  *  Don't forget to free error messages (if any) with sqlite3_free 

I was a little late to know of the .expert feature (see my naive suggestion at the 
[https://sqlite.org/forum/forumpost/952dbb45e8 | Simon's post]). But thanks to the discussion, a new tool is added to the palette.