A web server where SQLite is the source of truth. Because who needs a real programming language when you have SQL? 😏
- Routes? They're just rows in a table
- Templates? Stored in SQLite
- Static files? BLOBs, obviously
- Logic? Pure SQL, baby
- Frontend? Generated from tables
- The actual server? A 50-line Go shim that's just there to make HTTP requests look less suspicious
The server is actually the database file itself. No, really. It's a shell script glued to a SQLite database. When you run it:
./sqlserve.dbIt:
- Extracts itself (very meta)
- Runs the database as a server
- Makes your coworkers question their life choices
- Have Go and SQLite installed (or don't, we're not your parents)
- Run:
./build.sh
- Run the server:
./sqlserve.db
- HTTP request comes in
- Go asks SQLite: "What do?"
- SQLite says: "Run this SQL"
- Go runs SQL
- Magic happens
Want a new route? Just add a row:
INSERT INTO routes (path, method, handler_function)
VALUES ('/about', 'GET', 'handle_about');Then write the handler in SQL:
INSERT INTO functions (name, sql_code)
VALUES ('handle_about', 'SELECT content FROM templates WHERE name = ''about'';');- Because we can
- Because it makes people uncomfortable
- Because SQL is technically Turing complete
- Because Uncle Bob will probably hate it
- Because I do whatever I want
MIT (because we're not monsters)