ch records are dumped.
=item $format (default: 'sql')
Output format. Choices are B<'sql'> or B<'json'>.
=item $pretty (default: false)
Boolean value whether to print output prettily.
=item $bytes
package Data::Generator::FromDDL::Formatter;
use strict;
use warnings;
use Carp qw(croak);
use JSON ();
use Class::Accessor::Lite (
new => 1,
rw => [qw(format pretty bytes_per_sql)],
);
sub t
($self->format =~ /sql/i) {
'to_sql';
} elsif ($self->format =~ /json/i) {
'to_json';
} else {
croak("Unsupported format: " . $self->format . "\n");
$sqls;
}
sub to_json {
my ($self, $table, $fields, $rows) = @_;
my $json = do {
if ($self->pretty) {
JSON->new->pretty;
} else {
JSON->new;
}