SQLite Forum

Querying all compile options used

Querying all compile options used

(1) By anonymous on 2020-09-15 11:06:15 [link] [source]

How do I query all the options used in the SQLite version I am using?

I am looking for something like

select sqlite_compileoptions .?.?

(2) By Richard Hipp (drh) on 2020-09-15 11:18:47 in reply to 1 [link] [source]

SELECT * FROM pragma_compile_options;

(3) By anonymous on 2020-09-15 11:23:25 in reply to 2 [link] [source]

Thank you.

Are there any compile options that are used but in a disabled state & which could be enabled from the CLI? If yes, what would be the syntax?

(4) By Donald Griggs (dfgriggs) on 2020-09-15 14:07:31 in reply to 3 [source]

Maybe just me, but I'm not understanding the question very well.   I know there's, e.g. a compile option of


that would have no effect unless at some point someone has invoked:

PRAGMA journal_mode = WAL; 

Is that what you mean? Maybe you could elaborate on the problem that caused you to pose the question?


(5) By Larry Brasfield (LarryBrasfield) on 2020-09-15 14:56:00 in reply to 3 [link] [source]

See the pragma list. The form PRAGMA something_or_other = value; is how available runtime options are set. There are numerous compilation options, many of which result in such PRAGMAs being meaningful (or not.) If you wish to see the intersection of {pragma-settable options} and {compilation options that need runtime action to take effect}, those two links will provide the input sets. (I'm too lazy to perform that processing.)

(6) By Richard Damon (RichardDamon) on 2020-09-15 15:47:14 in reply to 3 [link] [source]

It is naturally impossible to change how the program was compiled by sending a command to it. So if some com[iler option caused something to be omitted, there is no way to magically add it by asking for it. (it MIGHT be possible to add some things back by loading an extension).

Many of the options set defaults for options, and you can then send commands to change what that option is set to, but in most cases, you can't change the default (some options line WAL mode are persistent, but that is different)