
dbtool-cli: Automating Database Ops with Go
- Ibrahim Fiqhan
- Tooling , Automation
- January 15, 2026
Table of Contents
In the world of DevOps, “Toil” (manual, repetitive work) is the enemy. I found myself manually creating database users for developers and writing brittle shell scripts for backups that eventually filled up the disk space.
To solve this, I built dbtool-cli, a unified command-line interface written in Go (Golang) that treats database management as code.
The Problems Solved
- Developer Bottlenecks: Developers waiting for Ops to create database users/schemas.
- Storage Exhaustion: Standard cron jobs keeping backups indefinitely until the disk is full.
- Context Switching: Remembering the syntax differences between
CREATE USERin Postgres vs MariaDB.
Key Capabilities
β‘ Automated Provisioning (Productivity)
When a new project starts, dbtool-cli handles the setup in seconds. It abstracts the complexity of different database drivers:
- Modular Architecture: Designed with Go interfaces to support multiple drivers (PostgreSQL, MariaDB) seamlessly.
- Secure Defaults: Auto-generates users with strictly scoped privileges.
π‘οΈ Smart Backup & Retention (Health)
The tool implements a “Backup Health Check” logic directly in Go:
- Verification: Validates archive integrity before success confirmation.
- Retention Policy: Automatically applies rotation (e.g., “Keep 7 Daily, 4 Weekly”) to prevent storage exhaustion.
Technical Implementation
I chose Go (Golang) and the Cobra library for this project to ensure:
- Portability: Compiled into a single static binary that runs on Linux servers, macOS workstations, and Windows.
- Performance: High-speed execution compared to interpreted bash scripts.
- Maintainability: Strongly typed code that is easier to extend than complex shell scripts.
Impact & Results
- 30% Increase in Productivity: Developers can provision their own local environments instantly using the CLI.
- Zero Storage Incidents: Smart retention policies ensure disk usage remains constant and predictable.
- Standardized Workflows: Unified command syntax across all database types.

Ready to build your next project with me?
I’m ready to help you build, improve, and launch your next project β just drop a message and letβs get started.
Get Started Now
