Last week I took some time off from my job, so I had more free time than usual to spend on programming—about 20 hours.
Personal Website 🌐
🚀 I built a major new feature: the ability to see what has changed in the database. I’ve wanted this for a long time and finally got it… but at what cost? Initially, I thought about saving an SQL dump for every table into Git. However, that approach turned out to be inconvenient because the long SQL strings were unreadable. In the end, I decided to save the database rows as YAML files. Each table gets its own folder. Since YAML supports multiline text, my posts are easy to read in this format.
🔎 To view the change history in a browser, I added a GitWeb container. I had to rebuild the Docker Image for the ARM architecture; otherwise, GitWeb was unbearably slow, and a single page load took an entire minute. The repository lives on my Orange Pi. Commits are automated via a schedule: every Sunday at midnight.
⏳ This task took quite a bit of time because I put a lot of effort into the initial SQL format before eventually deciding to switch to YAML and scrap the SQL version. However, I can now track what changed in my database from week to week.
🦫 While working on this task, I felt like I was reinventing a small ORM framework within my project. Would it be useful to use an off-the-shelf ORM framework instead? I’ve heard there is GORM for Go. I need to think about that. For now, there is no immediate need to switch to an ORM_framework because I already have all the features I currently need.