Back

Build your own SQLite, Part 4: reading tables metadata

134 points8 daysblog.sylver.dev
C-programmer8 days ago

It's interesting to compare this series to the actual source code of sqlite. For example, sqlite uses a LALR parser generator: https://github.com/sqlite/sqlite/blob/master/src/parse.y#L19...

And queries itself to get the schema: https://github.com/sqlite/sqlite/blob/802b042f6ef89285bc0e72...

Lots of questions, but the main one is whether we have made any progress with these new toolchains and programming languages w/ respect to performance or robustness. And that may be unfair to ask of what is a genuinely useful tutorial.

sevender7 days ago

If you don’t know it already, you’ll probably be interested in limbo: https://github.com/tursodatabase/limbo

It’s much more ambitious/complete than the db presented in the tutorial.

If memory serves me correctly, it uses the same parser generator as SQLite, which may answer some your questions.

westurner7 days ago

Is translation necessary to port the complete SQLite test suite?

sqlite/sqlite//test: https://github.com/sqlite/sqlite/tree/master/test

tursodatabase/limbo//testing: https://github.com/tursodatabase/limbo/tree/main/testing

NoboruWataya7 days ago

I assume the point of these tutorials is not to show experts how to progress from the state of the art, but to show beginners how to get there. There are a few tutorials like this (build your own text editor, operating system, etc) and I think they are a great idea if done well.

UncleEntity7 days ago

The lemon parser generator is actually a delight to use if you're into that sort of thing. Paired with re2c you have a combination that rivals yacc/bison IMHO.

geodel8 days ago

Surprise, that author of blog and submitter here did not mention In Rust as part of title.

miloignis8 days ago

In 'Part: 1' the author says "Source code examples will be provided in Rust, but you are encouraged to follow along using your language of choice, as we won't be relying on many language-specific features or libraries."

It's meant to be a language-generic tutorial and explanation.

hexane3608 days ago

Signs we may be reaching the Plateau of Productivity

tadfisher8 days ago

Surprise, ragebait is being downvoted. Let's be more productive in our HN correspondence.

andrewflnr8 days ago

Are you saying downvoting is not the correct response to ragebait? Seems to me that's what it's for. If not, your phrasing is confusing.

jagged-chisel7 days ago

> Surprise, [your] ragebait [comment] is being downvoted.

This is how I believe it is meant to be read (aimed at the top comment.) And downvotes are exactly how they should be handled. I agree the ‘surprise’ muddles things a bit.