6 ms·
Good to know! Which of the omit directives do you usually use?
by tester457 3y ago
Good to know! Which of the omit directives do you usually use?
- JohnFen 3y agoIt has varied quite a lot depending on the exact application. The use case is so that you can embed SQLite directly in the executable rather than using an external server. You're almost certainly using the DBMS for a very specific thing, and it's usually clear what features your application will never use. So you omit them, not only in order to minimize size, but also to flag if the code accidentally uses something surprising on a later modification. What I've frequently done when approaching this in a new project is to omit the stuff that's obviously unneeded, then go though and start omitting everything else (that isn't obviously needed) one at a time, performing a regression test each time to learn if it needs to be put back. I think my most common directives have been SQLITE_OMIT_DECLTYPE, SQLITE_OMIT_DEPRECATED, and SQLITE_OMIT_SHARED_CACHE. But I've used much more than that. If you're optimizing to this degree, there are other directives that may be of interest to you as well. For instance, I'm often used SQLITE_THREADSAFE=0 when thread safety was a nonissue. See this page: https://www.sqlite.org/compile.html https://www.sqlite.org/compile.html Oh, I think it's also best practice to put all of the compile-time directives in a separate header file so they're all in one place and aren't cluttering up the rest of the code.
- tester457 3y agoThank you!