0.1.3 • Published 6 years ago
mraj v0.1.3
MRAJ -- MySQL Results As JSON
M R A J
y e s S
S s O
Q u N
L l
t
sRun a sql query and print the results to stdout as JSON.
A username, hostname, and password are required and can be passed either as
command line arguments (-u, -h, and -p, respectively), or read from a
config file.
This tool will look for a file named .env in the current working directory and
read the values from it.
Example .env
username = zach
password = p@$$w0rd
host = db.example.comThe query must be supplied with the -e (or --query) option.
In addition, the indentation level of the resulting JSON can be specified with
-i or --indent (0 will do no indentation).
Examples
mraj -e 'SELECT * FROM blog_db.posts' -u blog_user -h db.blog.com -p 'p@$$w0rd'# assuming a .env file is present
mraj -e 'SELECT * FROM blog_db.posts'