Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minimize SQLite library size

Tags:

sqlite

I assume this is the same for sqlite3.dll or sqlite3.lib, but if not, I am interested in sqlite3.o (mingw32).

How can I minimize the size of the library (compiling with -O3, since speed is my top concern, so different compiler optimizations is not an option)?
If I know there are parts of SQL I don't need in my program (like JOIN or ATTACH or triggers), can I remove support for them (this is for an embedded system and every byte counts, or at least every 100 bytes or so)?
What pre-processor options can I set to remove things like FTS or R-Tree support which I do not need? Do I set them at the command line or in the file?
Are there any other things easily removable that I might not need and might not even know they exist in order to remove them?
How about some of the C API? Most of it I never use.

like image 886
Baruch Avatar asked Mar 06 '26 14:03

Baruch


1 Answers

Please look here. There's a chapter "Options to omit features". You'll find for example SQLITE_OMIT_ATTACH there.

But please note the warning there. It says

the SQLITE_OMIT_* compile-time options are usually untested and are almost certainly untested in combination. Any or all of these options may be removed from the code in future releases and without warning. For any particular release, some of these options may cause compile-time or run-time failures, particularly when used in combination with other options.

like image 173
Karl von Moor Avatar answered Mar 09 '26 03:03

Karl von Moor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!