NAME

mysql2json - convert mysql -B output to JSON object streams

VERSION

version 0.001

SYNOPSIS

  mysql -B -u user -password -h 10.0.0.5 database \
    -e 'select crontab_id, task_id from crontab' | \
		mysql2json | jsort -k task_id -rn | head -5

DESCRIPTION

mysql2json(1) reads mysql(1) batch output and writes JSON objects, one per line, corresponding to each database row.

The SYNOPSIS example produces something like this:

{"crontab_id":"102","task_id":"701"}
{"crontab_id":"101","task_id":"700"}
{"crontab_id":"100","task_id":"650"}
{"crontab_id":"8","task_id":"599"}
{"crontab_id":"14","task_id":"38"}

SEE ALSO

You may read this utility's implementation in its entirety at

perldoc -m mysql2json

App::PipeFilter::MysqlToJson implements this utility.

App::PipeFilter has top-level documentation including a table of contents for all the libraries and utilities included in the project.

BUGS

https://rt.cpan.org/Public/Dist/Display.html?Name=App-PipeFilter

REPOSITORY

https://github.com/rcaputo/app-pipefilter

COPYRIGHT AND LICENSE

mysql2json is Copyright 2011 by Rocco Caputo. All rights are reserved. mysql2json is released under the same terms as Perl itself.