2026-05-20

Hello Database Rendering

This is the first placeholder article.

The request flow is intentionally small:

  1. Sinatra receives the request.
  2. Sinatra calls a PostgreSQL function.
  3. PostgreSQL returns a JSON payload with headers and an HTML body.
  4. Sinatra sends that payload as the HTTP response.
get "/articles/:slug" do
  payload = pg_response("select render_article($1)::text as response", [params[:slug]])
  send_pg_payload(payload)
end

This keeps the Ruby layer thin while still letting you use Ruby for nice tooling.