[Interest] Use SQLite math functions (-DSQLITE_ENABLE_MATH_FUNCTIONS) like sin and cos?

Till Oliver Knoll till.oliver.knoll at gmail.com
Wed Oct 26 16:29:15 CEST 2022


Am 25.10.22 um 21:49 schrieb Thiago Macieira:
> On Monday, 24 October 2022 10:58:56 PDT Till Oliver Knoll wrote:
>> What is the least complicated way to enable the math functions that come
>> with SQLite, when it is compiled with the -DSQLITE_ENABLE_MATH_FUNCTIONS
>> switch?
> Solution #1: compile Qt with -system-sqlite (and provide said system sqlite).

Recompiling Qt is something that I try to avoid for now - especially 
given that I have "github actions" that make it very easy to install a 
given "stock binary Qt release" on the desired integration platform 
(that I currently only use for "code analysis", but not actually 
building any binaries - "nightly builds" - meant for distribution).

Or in other words: I am trying to keep my "required build setup" as 
simple as possible.

So compiling the "SQLite amalgation" sources (sqlite3.h, sqlite3.c) 
together with my app and use the *sqlite3_create_function* to add the 
desired "sin, cos and pow" etc. functions seems to be "the lesser evil" 
- albeit also way more fragile (keyword: "SQLite versions need to 
match") than properly recompiling Qt / the Qt SQLite plugin with my own 
desired flags.

> This applies to ANY use of SQLite, whether you need the math functions or not.

I am not quite sure whether I understand this statement: what exactly 
does apply to "any use of SQLite"? For instance I can perfectly use the 
provided stock binary Qt SQLite plugin on all platforms (for me: 
Windows, macOS, Linux), without having to recompile any Qt related 
source code - for as long as I am not using math functions, of course. 
So why exactly do you say "whether you need the math functions or not"?

Best,

   Oliver

P.S. On a personal note: Hello Thiago! If there is something "more 
constant than constexpr in C++", then it is Thiago replying to all sorts 
of (broad) topics here on the list (you probably don't remember me, and 
that's okay - it's been a while since I have been actively participated 
on this list ;))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20221026/6f802f3c/attachment.htm>


More information about the Interest mailing list