mesibo
mesibo

Reputation: 4333

Small custom build of SQLite3

We are using sqlite3 in an application and we really need a super small build of sqlite3 by removing unnecessary functions. We are already using -Os flag.

Our application only uses a single table with couple of indexes and simple select, update, insert, delete queries. All the columns are either integer, text or blob.

I tried to generate custom build of sqlite3.c from canonical source by using various SQLITE_OMIT_* flags below but seems to have only marginal impact on the binary size.

Any suggestions on other OMIT options. Also if any of the OMIT options has any side effects for the limited use I mentioned above.

-DSQLITE_OMIT_ALTERTABLE 
-DSQLITE_OMIT_ANALYZE 
-DSQLITE_OMIT_ATTACH 
-DSQLITE_OMIT_AUTHORIZATION 
-DSQLITE_OMIT_BUILTIN_TEST 
-DSQLITE_OMIT_CAST 
-DSQLITE_OMIT_CHECK 
-DSQLITE_OMIT_COMPILEOPTION_DIAGS 
-DSQLITE_OMIT_COMPLETE 
-DSQLITE_OMIT_COMPOUND_SELECT 
-DSQLITE_OMIT_CTE 
-DSQLITE_OMIT_DATETIME_FUNCS 
-DSQLITE_OMIT_DECLTYPE 
-DSQLITE_OMIT_DEPRECATED 
-DSQLITE_OMIT_EXPLAIN 
-DSQLITE_OMIT_FLAG_PRAGMAS 
-DSQLITE_OMIT_FLOATING_POINT 
-DSQLITE_OMIT_FOREIGN_KEY
-DSQLITE_OMIT_UTF16

Upvotes: 0

Views: 230

Answers (1)

CL.
CL.

Reputation: 180230

You can use all the SQLITE_OMIT_xxx options because you did not mention using any of those features.

Don't use SQLITE_OMIT_WSD, which does not actually remove code and would make the library bigger.

Using SQLITE_OMIT_AUTOINIT would not make sense.

If you forgot to mention that the data is stored on disk, you should avoid SQLITE_OMIT_DISKIO.

Upvotes: 1

Related Questions