mysql CLI client
Wanted to share an anecdote on how AI tooling has upgraded my abilities.
I work with some internal MySQL databases. Having useful CLI utilities is critical. Looking around, I was surprised to find that there wasn’t much out there.
Obviously, there is the mysql command line SQL shell that sometimes comes with the MySQL distribution.
I had difficulty following the best practices for authentication - which .my.cnf file, how to secure it because it was in plain text, learning even more tooling like mysql_config_editor.
I also require working in both Linux and Windows.
The shortcomings of the standard mysql utility are not necessarily relevant here.
What is important is that I found a need where all I wanted was a simple CLI utility that:
- Explicitly worked in UTF-8 by default
- Handled JSON as the native format for data in and data out
- Simplified auth through environment variables like many modern CLIs
- Made inserting, upserting from JSON extremely simple
- Single file binary (used golang for this)
So turned it over to the AI agents, and from 10:00 AM to 4:00 PM on one workday, I had exactly the CLI I wanted (see commits here).1
This is the kind of personal tooling that I just wouldn’t have been able to dedicate time to in the past. But for CLIs like this where the problem statement is not difficult, implementation is straightforward, the original time would have been significantly filled with
- Looking up docs on
encoding/jsonanddatabase/sqlbecause I don’t have them memorized - Literally typing out the ~600 lines
All that time essentially disappears to zero.
I am reminded of this great post by Jamie Brandon, called “Speed matters”. What’s important to note is that this post was written in 2021, and includes the quote:
Being 10x faster also changes the kinds of projects that are worth doing.
For me, it’s the Unix philosophy supercharged.
Write programs that do one thing and do it well.
For the “doing it well”, the AIs can make me my perfect CLI tool that fits exactly my needs with a paragraph of prompt text.
Then it’s just up to me to dream up the possibilities with the combinatorics between those programs.