• PostgreSQL and its annoying crosstab

    Today, I had to pivot (pun intended) from my usual tasks to help a colleague with a query. The task is deceptively simple: Collect metadata about all columns of a table in a single query. This was to be a function in PostgreSQL that would return a table with the following columns:

    Read on →

  • Magical Refs in React

    I learned React by looking at it. Yes, really. I inherited some React codebase since I was the only dev with JS knowledge on my team, and I had to figure out how to make it work. Since most change requests were small there was no need to reach out to the docs, and after implementing a couple of minor fixes the pieces started to fall into place. I’ve never seen class components since my first contact with React was with functional components.

    Read on →

  • TIL: PostgreSQL's copy command does run triggers

    I always assumed that the COPY command in PostgreSQL bypassed triggers. I didn’t know that, I just assumed it. It felt correct. My experience with copy is bulk importing data and that usually meant creating either temporary tables as staging area or importing into new tables. In any case, it seems I’ve never copied data into a tables with triggers.

    Read on →

  • TIL: React Memoization

    Today I learned more about React memoization. I was stuck optimizing a component that was re-rendering too often and after digging a bit, some things stuck out to me.

    Read on →