4 ms·
It’s always good for this kind of articles, to refer to source code. Provide links to the source code responsible of some of the implementation details
by freecodyx 4y ago
It’s always good for this kind of articles, to refer to source code. Provide links to the source code responsible of some of the implementation details
- eatonphil 4y agoYeah that would be awesome! I'd rephrase your comment as a suggestion rather than a demand though personally. :)
- benbjohnson 4y agoThat's a good idea. There's a careful balance though since once you start talking about specific functions in SQLite then the post becomes very low-level and starts to become less accessible. I'll try to integrate that more in the future though.
- eatonphil 4y agoYeah maybe it would force you to get too close to the code, I don't know SQLite well enough. When I do surveys of software I try to provide links to source (mostly just the relevant file or directory) so folks can verify for themselves. For example when looking into the parsers behind Postgres-compatible DBs [0] and parser techniques in a few major language implementations [1]. But both those posts are at a higher-level than what you're doing here. I'm sure you'll have good reason either way for this series. [0] https://datastation.multiprocess.io/blog/2022-02-08-the-world-of-postgresql-wire-compatibility.html https://datastation.multiprocess.io/blog/2022-02-08-the-worl... [1] https://notes.eatonphil.com/parser-generators-vs-handwritten-parsers-survey-2021.html https://notes.eatonphil.com/parser-generators-vs-handwritten...
- mandeepj 4y ago> https://github.com/sqlite/sqlite/blob/master/src/btreeInt.h https://github.com/sqlite/sqlite/blob/master/src/btreeInt.h Woah, Ben! I'm so glad the above link was shared above; thanks to the poster as well. There's a very good amount of in-depth knowledge shared via comments and a reference to Donald knuth's book
- benbjohnson 4y agoThere's a lot of goodies in the comments. I like this one about how POSIX locks are broken: https://github.com/sqlite/sqlite/blob/master/src/os_unix.c#L1026-L1114 https://github.com/sqlite/sqlite/blob/master/src/os_unix.c#L...
- mandeepj 4y agoThanks! Enough catalyst for me to read through all of SQLite source files
- samatman 4y agoGP's account page says From Morocco With Love, and I'm sure their Arabic and French are far beyond mine. This reads to me like an accidental slip into the imperative, breaking a sentence in two parts, and not adding a phrase such, "For example,". In fact, changing the period to a colon would defuse the imperative. It's subtle!
- photochemsyn 4y agoHere's a header file that basically mirrors some of what the article is talking about, the layout of pages and the btree and so on (~lines 100-200) https://github.com/sqlite/sqlite/blob/master/src/btreeInt.h https://github.com/sqlite/sqlite/blob/master/src/btreeInt.h The code for the btree functions is here and is a bit over my head TBH with all the locks and permissions and so on but it's a nice example of how to comment code I think: https://github.com/sqlite/sqlite/blob/master/src/btree.c https://github.com/sqlite/sqlite/blob/master/src/btree.c
- jvdvegt 4y agoThe SQLite documentation is pretty good as well: https://sqlite.org/fileformat.html https://sqlite.org/fileformat.html
- dunham 4y agoI'll second that. I was able to use that documentation to write javascript code that reads and queries a sqlite database. (Just as a learning exercise, I don't have a practical use for this.)