Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: sql editor written in perl

by perlfan (Vicar)
on Jun 21, 2022 at 08:51 UTC ( [id://11144891]=note: print w/replies, xml ) Need Help??


in reply to sql editor written in perl

I can echo the utility of dbish. But I can also describe (but not share) a utility that my $WORK uses internally. Our applications use YAML files to describe the different DB (mysql) servers to connect to on the different tiers - production, testing, development. We have a utility that is effectively a wrapper around mysql and mysqldump. It gets the authentication information from the same YAML file that the application(s) use on whatever box we're on.

In practice, we can do things at the commandline, like:

# send some SQL: $ ourutil dbname < some.sql $ cat some.sql | ourutil dbname $ echo "SELECT * ..." | ourutil dbname # dump out stuff $ ourutil -D dbname [table] -- [extra mysqldump options]
Similarly, we can easily get to the shell via,
$ ourutil dbname
And if we just want to print the command string with the auth information in + options it would have executed, we can do:
$ ourutil --cmd # for mysql, or $ ourutil -D --cmd # for mysqldump
I wish I could share the code, but the above interface should be readily implemented and customized to fit your existing environment. Update: just wanted to add, this utility I describe rarely changes and is extremely useful on a daily basis.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11144891]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-03-29 07:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found