Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
711 views
in Technique[技术] by (71.8m points)

database - Sqlite on an embedded system

I have a database file that is generated on a PC using Sqlite. This file is then transferred to an ARM7 based embedded system without an operating system. The embedded system must access this database, but does not need to update it.

I have been trying to get sqlite3 small enough for the embedded system, but so far I cannot get the application size under 256 Kbytes (my limit).

Has anyone been able to get sqlite3 down to this size? Is there other software that I can use to read this database?

EDIT: I am trying to access the database using C. This would be done using the sqlite3_exec() function.

There are two tables. One table has an ID and text, the second an ID, link to ID of first table, text, and status value. The only access required is by ID or partial text on the first table, and by ID on the second table.

Perhaps there is some standalone code that can be used to access the database?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The smallest sqlite3 I came up with was 327 KBytes (for PowerPC), which was sufficient for the system so I stopped trying to make it smaller. This was the full sqlite3 CLI binary, the C APIs alone would have been somewhat smaller.

I had set SQLITE_OMIT_AUTHORIZATION, SQLITE_OMIT_EXPLAIN, SQLITE_OMIT_PROGRESS_CALLBACK, and SQLITE_OMIT_TCL_VARIABLE to trim the size of the binary, and used -Os to get it to that size.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...