Abusing DuckDB-WASM by making SQL draw 3D graphics (Sort Of)
Published on: 2025-08-16 04:35:47
Abusing DuckDB-WASM by making SQL draw 3D graphics (Sort Of)
Sun Apr 20 2025 • duckdbsqlwasmdoom Back
Building a SQL-Powered Doom Clone in the Browser
I had this slightly crazy idea: Could I ditch most of the conventional JavaScript game loop and rendering logic and build a 3D game engine where SQL queries did the heavy lifting? Naturally, I decided to try building a primitive, text-based Doom clone to see how far I could push it using DuckDB-WASM.
Spoiler: It kind of works, it was often painful, but I learned a ton about the surprising power (and quirks) of running an analytical database engine in the browser for tasks it was definitely not designed for.
The Setup: SQL Isn't Just for SELECT * Anymore
Forget managing game state in JavaScript objects or drawing pixels with Canvas/WebGL. My approach looked like this:
The Database is the World: The 16x16 map, player coordinates ( x , y , dir ), enemy/bullet positions, game settings – everything lives in DuckDB tables, right there i
... Read full article.