TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

SQLToy

103 pointsby akkartik8 months ago

7 comments

tekknolagi8 months ago
Yesterday I found this and ported it to Python: <a href="https:&#x2F;&#x2F;github.com&#x2F;tekknolagi&#x2F;db.py">https:&#x2F;&#x2F;github.com&#x2F;tekknolagi&#x2F;db.py</a><p>It&#x27;s ~150LOC but doesn&#x27;t have aggregates (yet)
评论 #41478234 未加载
wood_spirit8 months ago
It’s like a ray tracer: every programmer should write a toy sql engine!<p>A very long time ago I started writing a game in a weekend a for Ludum dare competition and ended up writing a toy sql engine of my own <a href="https:&#x2F;&#x2F;williame.github.io&#x2F;post&#x2F;59997353762.html" rel="nofollow">https:&#x2F;&#x2F;williame.github.io&#x2F;post&#x2F;59997353762.html</a><p>I still get the urge to make a proper one one day. With the sql features that I wish sql engines had. Hmmm. Need-sniping myself now… :)
评论 #41479695 未加载
评论 #41483297 未加载
barbegal8 months ago
Great toy but it&#x27;s a bit misleading not to touch on the query planner. All real SQL implementations will plan how to most efficiently run a query so the order of operations can be wildly different to expected based on the data and indexes available. This kind of tutorial makes it look like joins are very inefficient whereas a real database may make them highly efficient for a given query.
halostatue8 months ago
I had fun over the last day implementing this two ways in Elixir: <a href="https:&#x2F;&#x2F;github.com&#x2F;halostatue&#x2F;sqltoy_elixir">https:&#x2F;&#x2F;github.com&#x2F;halostatue&#x2F;sqltoy_elixir</a>.
curtisblaine8 months ago
I hoped this had a toy implementation of sql indices, but it looks like that&#x27;s not the case: it just sorts the whole table on the fly on an ORDER BY.
评论 #41481571 未加载
jrop8 months ago
I love projects like this that shed light on and demystify and otherwise mysterious process. Thanks for sharing!
评论 #41479008 未加载
dcreater8 months ago
Would be great if it was literally any other language other than js
评论 #41478370 未加载
评论 #41478150 未加载
评论 #41481956 未加载