SQLite Forum

Module pragma_function_list registers only after first usage
Login

Module pragma_function_list registers only after first usage

(1) By VĂ­ctor (wzrlpy) on 2021-08-28 22:25:42 [link] [source]

Hi,

If I check what modules named pragma% are available in shell, I see first only pragma_module_list, but after invoking the function pragma_function_list(), then I get two modules:

SQLite version 3.36.0 2021-06-18 18:36:39
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> select * from pragma_module_list() where name like 'pragma%';
pragma_module_list
sqlite> select * from pragma_function_list() where name like 'pragma%';
sqlite> select * from pragma_module_list() where name like 'pragma%';
pragma_module_list
pragma_function_list
sqlite> .quit

Should not the two modules be listed right away in the first invocation of pragma_module_list()?

(2) By Richard Hipp (drh) on 2021-08-28 23:27:14 in reply to 1 [source]

All of the pragma_* virtual tables are demand-loaded. They don't show up until they are used.