I'm using Manjaro Linux KDE and use the GUI package manager to install software most of the time. I have SQLite 3.39.2-2 installed and the SQLite Tcl extension. ICU 71.1-1 (International Components for Unicode) was installed as a dependecy of other software.
Is it possible to use ICU in SQLite run in Tcl scripts with these packages as they are now, or must SQLite be compiled with the SQLITE_ENABLE_ICU flag?
It appears that the enable_load_extension method must be turned on and the the SQL function load_extension can be used. However, there are a few warnings there about security and setting some PRAGMA statements.
Would you please explain the proper/secure method of doing so, if possible?
Thank you.
CodePudding user response:
Unless explicitly enabled, the ICU extension is not included in the SQLite build. In particular, the official stock binaries do not include the ICU functionality. The ICU extension, indeed, can be compiled as a loadable extension. Apart from possible security concerns regarding enabling loadable extensions, every time you need the ICU features, you would have to worry about loading the extension explicitly. Because you probably need to compile extension either way (there are no official binaries), it makes sense to just rebuild the entire library and include the ICU module in the core. I have an extended tutorial on compiling SQLite with ICU with the MSYS2/MinGW toolchain on Windows. While you may need to adjust the script to build SQLite on Linux, it might be helpful to get going.