Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to begin reading SQLite source code? [closed]

I want to understand how sqlite is implemented. And, want to read the source code( I have already downloaded the source). Which part of the code I should start looking at?

like image 672
jess Avatar asked Sep 27 '10 06:09

jess


People also ask

How do I start SQLite?

Start the sqlite3 program by typing "sqlite3" at the command prompt, optionally followed by the name the file that holds the SQLite database (or ZIP archive). If the named file does not exist, a new database file with the given name will be created automatically.

Where does SQLite store data?

The Android SDK provides dedicated APIs that allow developers to use SQLite databases in their applications. The SQLite files are generally stored on the internal storage under /data/data/<packageName>/databases.


1 Answers

The SQLite documentation page has a great section named SQLite Technical/Design Documentation with articles on the internals of SQLite. I think it's essential to read and understand those before you start reading the source code itself.

There are many gems there, but the most interesting for you is probably Architecture of SQLite, as its description says:

An architectural overview of the SQLite library, useful for those who want to hack the code.

That page contains a nice block diagram of SQLite's code:

alt text

And then explains where in the source to find the implementation of each such block.


Another great resource (linked from here) is the Oreilly mini-book ("Short Cut") named "Inside SQLite" which goes into the design and code of SQLite to explain how it works.

like image 129
Eli Bendersky Avatar answered Sep 21 '22 06:09

Eli Bendersky