Let's imagine that you've got information for accessing several different databases you have to work with on a regular basis. Servers (e.g. mysql, pgsql, etc.), hostnames, ports, usernames, password files, database names, etc.
Let's also imagine that there are several programs you use on these databases regularly. If you use MySQL, this might include the mysql
CLI client, the mysqldump
utility, and liquibase
for versioning.
Manually typing these commands together with this database information is tedious. Managing shorthand shell functions for the same purpose also seems suboptimal.
What I want is a wrapper utility of sorts to which I can specify the program I want to run and the name of (or potentially a shorthand alias for) the database I want to run it on, and have it pull all other information from a configuration file I create to derive and run the resulting CLI command.
Here's a hypothetical example of such a file: