<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>sql on krtffl.dev</title>
    <link>https://krtffl.dev/tags/sql/</link>
    <description>Recent content in sql on krtffl.dev</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>© [krtffl](https://krtffl.dev)</copyright>
    <lastBuildDate>Mon, 15 Dec 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://krtffl.dev/tags/sql/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>the elo race that silently ate 79% of every vote</title>
      <link>https://krtffl.dev/posts/elo-lost-update-postgres/</link>
      <pubDate>Mon, 15 Dec 2025 00:00:00 +0000</pubDate>
      
      <guid>https://krtffl.dev/posts/elo-lost-update-postgres/</guid>
      <description>&lt;p&gt;it&amp;rsquo;s the kind of bug that lets you sleep fine for weeks.&lt;/p&gt;
&lt;p&gt;i&amp;rsquo;d built a little nougat-ranking toy — you get shown two flavours, you pick the one you&amp;rsquo;d rather eat, and an ELO rating quietly updates in the background so a leaderboard falls out of thousands of these pairwise duels. side project, single box, htmx and go and postgres, held together with &lt;code&gt;database/sql&lt;/code&gt; and good intentions. it worked. people voted. the leaderboard moved. every vote came back with a fresh pairing and a &lt;code&gt;200&lt;/code&gt;. green across the board.&lt;/p&gt;
&lt;p&gt;then, before pushing it anywhere with real traffic, i did a proper hardening pass: stand up a throwaway postgres, seed it with a plausible &lt;em&gt;went-viral&lt;/em&gt; amount of data, and hammer every endpoint like someone who wants to break it. the very first thing i measured told me that roughly &lt;strong&gt;four out of every five votes had been quietly doing almost nothing&lt;/strong&gt; the whole time.&lt;/p&gt;
&lt;p&gt;not erroring. not failing. the vote was recorded. the rating just didn&amp;rsquo;t move the way it was supposed to.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>sqlc &#43; pgx over an orm: type-safe sql that fails at compile time</title>
      <link>https://krtffl.dev/posts/sqlc-vs-orm-in-go/</link>
      <pubDate>Mon, 24 Nov 2025 00:00:00 +0000</pubDate>
      
      <guid>https://krtffl.dev/posts/sqlc-vs-orm-in-go/</guid>
      <description>&lt;p&gt;the endpoint was slow and i couldn&amp;rsquo;t tell you which query to blame, because i hadn&amp;rsquo;t written any. that&amp;rsquo;s the deal you sign with a reflection-based orm: you describe some structs, you call &lt;code&gt;db.Preload(&amp;quot;Photos&amp;quot;).Find(&amp;amp;pets)&lt;/code&gt;, and somewhere behind the curtain the library assembles sql you never see, fires off a number of round trips you never counted, and hands you back objects. when it&amp;rsquo;s fast, it&amp;rsquo;s lovely. when it&amp;rsquo;s slow, you&amp;rsquo;re debugging a library&amp;rsquo;s imagination.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
