NAME

App::AltSQL::View

DESCRIPTION

This is an internal class used by App::AltSQL to capture the output of a DBI statement handler and express it to the user somehow. It does this mainly with Text::UnicodeBox::Table, and is currently MySQL specific.

render %args

Optionally pass 'no_pager' or 'one_row_per_column'. Will render the stored buffer by either printing it to the screen or piping it to a pager.

render_table

Given the table data that was extracted from the statement handler, compose a nicely formatted table for showing to the user.

render_one_row_column

Rather then using ASCII art to horizontally format each row, use one row of output per cell of data.

format_column_cell \%spec

Given the column specification, format the output for the user. This would be the header cell of the table. The specification may have the following keys, which match up with data found in the DBI statement handler.

name
type
precision
scale
nullable
is_blob
is_key
is_num
is_pri_key
is_auto_increment
length
max_length

format_cell $value, \%spec

Format the cell $value while knowing the column %spec (same data structure as above)

DEVELOPMENT

This module is being developed via a git repository publicly available at http://github.com/ewaters/altsql-shell. I encourage anyone who is interested to fork my code and contribute bug fixes or new features, or just have fun and be creative.

COPYRIGHT

Copyright (c) 2012 Eric Waters and Shutterstock Images (http://shutterstock.com). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

AUTHOR

Eric Waters <ewaters@gmail.com>