3 ms·
There is about 94 kSLOC of C code in Fossil at the moment, not counting SQLite itself, according to SLOCCount. SQLite more than doubles that line count. By tha
by wyoung2 10y ago
There is about 94 kSLOC of C code in Fossil at the moment, not counting SQLite itself, according to SLOCCount. SQLite more than doubles that line count.
By that measure alone, about half of Fossil is "SQL", in the sense that more than half of the code merely manages the various DBs.
(A Fossil workspace consists of three SQLite DBs: the actual repo DB plus two machine-specific DBs, one local to the project and one global to the user login.)
There is a whole lot of embedded SQL among that C code. Simply counting the number of lines containing the 5 most common SQL statements:
SELECT: 2069
INSERT: 583
DELETE: 492
UPDATE: 410
REPLACE: 122
That doesn't mean the total number of embedded SQL statements is the total of those 5 numbers, as some of that will be compound statements using two or more of the above keywords. Fossil uses some of the most complex SQL I've ever seen outside of http://thedailywtf.com/ http://thedailywtf.com/
So, while Fossil does rely very heavily on SQL, I wouldn't say it is "written in SQL." It merely delegates as much as is sensible to SQL, in the same way that a fair bit of the Fossil web user interface uses Javascript rather than call back to the Fossil binary on the server via POST and such to fetch an updated page.