An ergonomic pattern for SQLx queries in Axum

Axum is the most popular web framework in Rust at the time of writing. In this post, I'll show an easy and ergonomic pattern for connecting to a database using SQLx and Axum.

This is a small response to a question on a reddit thread about how to structure SQLx queries in Axum. The pattern I'll show here is not the only way to do it, but it's one that I've found to be simple and effective.

TL;DR: Store the database pool in your application state, create a struct to hold your queries, and use the FromRef trait to simplify the interaction between your handlers and the database.

Read more  ↩︎

Thunderbolt 4 Dock Comparison

Recently, while searching for a Thunderbolt 4 Dock, I found myself in a sea of data, but with no detailed comparison table to help. Hence, I decided to create one myself.

Read more  ↩︎

AI Article Checklist

I remember the early 2000s, a time marked by heated discussions in Slashdot comments and perhaps even earlier on Usenet. The topic of interest? Articles presenting possible solutions to fight spam. Accompanying these articles, a popular checklist was often shared. Now, in the 2020s, we're seeing a similar phenomenon with articles questioning the usefulness of LLMs in software writing. So, I decided to dust off this old spam checklist and repurpose it to the modern age.

Your article critiquing using AI tools for software development is...

Read more  ↩︎

The Moon is made of Cheese

Lately, we've seen a significant rise in articles casting doubt on the utility of Large Language Models (LLMs) like ChatGPT for specific tasks. These articles tend to anchor their conclusions on isolated experiments, generally an inadequate and potentially misleading approach due to the intrinsic randomness characterizing the outputs of LLMs. Instead, it's crucial this evaluation doesn't rely on a solitary experiment. Multiple trials and a deep understanding of the probabilities involved in different outcomes can provide a much more accurate reflection of LLMs' overall performance.

Read more  ↩︎

ChatGPT Memes

I was curious about how ChatGPT would go with creating this era's main cultural output, memes after reading a comment by @jeisc on Hacker news:

Does anyone here really think that AI will produce a new "Jungle Book" by Kipling or a new "Mona Lisa" by Da Vinci or a new "Requiem" by Mozart" which could even have a remote possibility of becoming cultural icon and reference? And is that a goal or event that the spectators are waiting for? And if it occurs what would it infer about human cultural evolution?

Read more  ↩︎