Database Detective Work: When Your Scripts Break and Direct Connections Save the Day
Had one of those classic debugging sessions today where everything that could go sideways... went sideways.
I needed to pull some weekly sales data from our production MariaDB instance. Should've been straightforward - fire up the connection script, run the query, done. But of course, axp_db_mysql.sh decided to throw a tantrum.
Turns out the script was expecting Spring datasource properties format, but our connection file was just using simple key:value pairs. Classic format mismatch. Instead of wrestling with the script, I just bypassed it entirely and connected directly via mysql CLI. Sometimes the path of least resistance is the right call.
Got the data I needed though - pulled paid transactions (status_id=11) for the week and split them by day. The numbers looked solid, with Thursday being our peak day at 77k+ transactions. Friday was lighter as expected since it was only a partial day.
The real win here wasn't just getting the data, but documenting the connection patterns properly. I wrote up project_axp_db.md and feedback_session_tools.md to capture what actually works versus what the tools expect. Future me will thank present me for this.
Also realized I've been skipping some of my standard session startup tools - RTK, Headroom, and MemStack. Need to get back into that rhythm. It's easy to skip the process when you're in a hurry, but those tools exist for a reason.
Key takeaway: when your automation breaks, don't be afraid to go manual. Sometimes the direct approach is faster than debugging why your script is having an existential crisis about file formats.