App-DBBrowser

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

        - Bugfix import and export options.
        - Sort schemas.
        - Tables-menu: don't separate system tables from the user tables if the schema is a system schema.

2.309    2023-01-06
        - Bugfix regex operator.
        - Update mysql/MariaDB system databases.

2.308    2023-01-03
        - Use Text::CSV_XS.
        - Bugfix/update option 'eol'.

2.307    2023-01-01
        - Removed unused option 'decimal_separator'.
        - Add option to config the CSV export.
        - Code refactoring.
        - Update documentation.

2.306    2022-12-23
        - Removed stringification of the output of 'group_concat'.

bin/db-browser  view on Meta::CPAN

=item

Automatically detects the separation character for CSV files.

=back

=back

=head3 CSV Options In a

Set C<sep_char>, C<quote_char>, C<escape_char>, C<eol> and C<comment_str>. If left empty, default values are used. For
details on these options, refer to L<Text::CSV_XS>.

=head3 CSV Options In b

Set C<allow_loose_escapes>, C<allow_loose_quotes>, C<allow_whitespace>, C<blank_is_undef>, C<binary>, C<decode_utf8>,
C<empty_is_undef> and C<skip_empty_rows>. For meanings of these options, refer to L<Text::CSV_XS>.

=head3 Settings 'split'

=over

bin/db-browser  view on Meta::CPAN

If enabled, the file extension C<csv> is automatically added to the file name.

=item Default File Name

If enabled, the table name will be used as the default file name.

=back

=head3 CSV Options Out a

Set C<sep_char>, C<quote_char>, C<escape_char>, C<eol> and C<undef_str>.

If left empty, default values are used except for C<eol>, which is then set to C<$/> (input record separator).

For the meaning of the different options, see L<Text::CSV_XS>.

=head3 CSV Options Out b

Set C<always_quote>, C<binary>, C<escape_null>, C<quote_binary>, C<quote_empty> and C<quote_space>.

For the meaning of the different options, see L<Text::CSV_XS>.

=head3 File Encoding Out

lib/App/DBBrowser/Options/Defaults.pm  view on Meta::CPAN

            field_sep     => ',',
            field_l_trim  => '\s+',
            field_r_trim  => '\s+',
        },
        csv_in => {
            auto_diag => 1,  # not an option, always 1

            sep_char    => ',',
            quote_char  => '"',
            escape_char => '"',
            eol         => '',
            comment_str => '',

            allow_loose_escapes => 0,
            allow_loose_quotes  => 0,
            allow_whitespace    => 0,
            blank_is_undef      => 1,
            binary              => 1,
            decode_utf8         => 1,
            empty_is_undef      => 0,
            skip_empty_rows     => 0,

lib/App/DBBrowser/Options/Defaults.pm  view on Meta::CPAN

            add_extension    => 0,
            default_filename => 0,
            file_encoding    => 'UTF-8',
        },
        csv_out => {
            auto_diag => 1,  # not an option, always 1

            sep_char    => ',',
            quote_char  => '"',
            escape_char => '"',
            eol         => '',
            undef_str   => '',

            always_quote => 0,
            binary       => 1,
            escape_null  => 1,
            quote_binary => 1,
            quote_empty  => 0,
            quote_space  => 1,
        },
        connect_data => {

lib/App/DBBrowser/Options/Menus.pm  view on Meta::CPAN

        my $sub_menu = [
            [ 'parse_mode_input_file', "- Use", [ 'Text::CSV', 'split', 'Template', 'Spreadsheet::Read' ] ],
        ];
        $sf->__settings_menu_wrap( $info, $lo, $section, $sub_menu, $prompt );
    }
    elsif ( $sub_group eq '_csv_in_char' ) {
        my $items = [
            { name => 'sep_char',    prompt => "sep_char   " },
            { name => 'quote_char',  prompt => "quote_char " },
            { name => 'escape_char', prompt => "escape_char" },
            { name => 'eol',         prompt => "eol        " },
            { name => 'comment_str', prompt => "comment_str" },
        ];
        my $prompt = 'Text::CSV_XS options a';
        $sf->__group_readline( $info, $lo, $section, $items, $prompt );
    }
    elsif ( $sub_group eq '_csv_in_options' ) {
        my $prompt = 'Text::CSV_XS options b';
        my $sub_menu = [
            [ 'allow_loose_escapes', "- allow_loose_escapes", [ $no, $yes ] ],
            [ 'allow_loose_quotes',  "- allow_loose_quotes",  [ $no, $yes ] ],

lib/App/DBBrowser/Options/Menus.pm  view on Meta::CPAN

            { name => 'file_encoding', prompt => "Encoding CSV file" },
        ];
        my $prompt = 'Data to CSV-files';
        $sf->__group_readline( $info, $lo, $section, $items, $prompt );
    }
    elsif ( $sub_group eq '_csv_out_char' ) {
        my $items = [
            { name => 'sep_char',    prompt => "sep_char   " },
            { name => 'quote_char',  prompt => "quote_char " },
            { name => 'escape_char', prompt => "escape_char" },
            { name => 'eol',         prompt => "eol        " },
            { name => 'undef_str',   prompt => "undef_str"   },
        ];
        my $prompt = 'Text::CSV_XS write options a';
        $sf->__group_readline( $info, $lo, $section, $items, $prompt );
    }
    elsif ( $sub_group eq '_csv_out_options' ) {
        my $prompt = 'Text::CSV_XS write options b';
        my $sub_menu = [
            [ 'always_quote', "- always_quote", [ $no, $yes ] ],
            [ 'binary',       "- binary",       [ $no, $yes ] ],

lib/App/DBBrowser/Table.pm  view on Meta::CPAN

    else {
        $open_mode = '>';
    }
    open my $fh, $open_mode, $file_fs or die "$file_fs: $!";
    require String::Unescape;
    my $options = {
        map { $_ => String::Unescape::unescape( $sf->{o}{csv_out}{$_} ) }
        grep { length $sf->{o}{csv_out}{$_} } # keep the default value if the option is set to ''
        keys %{$sf->{o}{csv_out}}
    };
    if ( ! length $options->{eol} ) {
        $options->{eol} = $/; # for `eol` use `$/` as the default value
    }
    require Text::CSV_XS;
    my $csv = Text::CSV_XS->new( $options ) or die Text::CSV_XS->error_diag();
    $csv->print( $fh, $_ ) for @$all_arrayref;
    close $fh;
    return 1;
}


sub __get_filename_fs {

xt/spelling.t  view on Meta::CPAN

SGR
SQ
Schemas
Subqueries
Substatements
Tabwidth
Trunc
csv
de
dir
eol
fract
isn't
mappable
preselected
preselection
repexp
schemas
sql
stackoverflow
submenu



( run in 1.576 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )