App-DBBrowser

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

        - Update input filter info output.
        - Bugfix copy & paste: removed 'Spreadsheet::Read' from the menu.
        - Bugfixes in setting column names.
        - Bugfix in resetting header row.
        - Update create table menu.

2.212    2019-10-06
        - New input filter: "Remove_Cell", "Insert_Cell", "Row_Groups".

2.211    2019-10-02
        - Input Copy and Paste: show the cursor.
        - Required the fixed "Term::Choose::Util" version.

2.210    2019-09-21
        - Term::Choose::Util: use object-oriented interface.

2.209    2019-09-09
        - Bugfix in 'subqueries': term_width -> get_term_width.

2.208    2019-09-05
        - Adapt the code to the updated Term::Choose.
        - Hide cursor fixes.

2.207    2019-08-09
        - Require App::DBBrowser::Table.
        - Bugfix in Join: use the right reference to get the driver type.
        - Update menus in Join.
        - Join/Union: consider the option 'metadata'.

2.206    2019-07-07
        - Fixed cursor visibility by raising the required Term::Form version.

2.205    2019-07-05
        - Added autoflush at the beginning of run.
        - Create/Drop menu changes.

2.204    2019-07-04
        - Update required "Term::Form"- and "Term::TablePrint"-versions.
        - Code refactoring.

2.203    2019-06-30
        - Fetching column names and types: eval sql code.
        - Keep the cursor hidden, avoid cursor flickering.
        - Adapt code to work with the updated Term::Choose::LineFold::line_fold routine.


2.202    2019-05-09
        - Update minimum version: Term::Choose, Term::Choose::Util, Term::From.
        - Code refactoring.

2.201    2019-05-08
        - Bugfix in reading db options.
        - Union all: exclude views.

bin/db-browser  view on Meta::CPAN

#!/usr/bin/env perl
use warnings;
use strict;
use 5.016;
our $VERSION = '2.431';

use Term::Choose::Screen qw( hide_cursor show_cursor clear_to_end_of_screen );

use App::DBBrowser;

use Encode::Locale;

binmode STDIN,  ':encoding(console_in)';
binmode STDOUT, ':encoding(console_out)';
binmode STDERR, ':encoding(console_out)';

BEGIN {
    print hide_cursor();
    $ENV{TC_RESET_AUTO_UP} = 0;
    if ( $^O eq 'MSWin32' ) {
        require Win32::Console::ANSI;
        print "\e(U";
    }
}

END {
    delete $ENV{TC_RESET_AUTO_UP};
    print clear_to_end_of_screen();
    print show_cursor();
}


my $db_browser = App::DBBrowser->new();
$db_browser->run();


__END__

=pod

bin/db-browser  view on Meta::CPAN

chosen items when C<Return> is pressed. If the mouse mode is enabled, you can use the right mouse key instead of the
C<SpaceBar>. Pressing C<Ctrl-SpaceBar> inverts the made choices - for example, to select all but one, select the one
with the C<SpaceBar> and then press C<Ctrl-SpaceBar>.

=head2 Read-line

=over

=item *

Use C<BackSpace> or C<Strg-H> to delete the character behind the cursor and C<Delete> to delete the character at the
cursor.

=item *

Press C<Strg-U> to delete the text backward from the cursor to the beginning of the line and C<Strg-K> to delete the
text from the cursor to the end of the line.

=item *

Use C<Right-Arrow> to move forward a character and C<Left-Arrow> to move back a character.

=item *

Press C<Page-Up> to move back 10 characters and C<Page-Down> to move forward 10 characters.

=item *

bin/db-browser  view on Meta::CPAN


=head3 Expand Table

Expand table rows:

=over

=item C<YES>

If C<Return> is pressed, the selected table row is printed with each column in its line. The first row is not expanded
if the cursor auto-jumped to the first row.

=item C<NO>

Don't expand table rows.

=back

=head3 Search

Set the search behavior (C<Ctrl-F>).

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

        _quit         => '  Quit',
        _back         => '  Back',
        _continue     => '  Continue',
        _confirm      => '  Confirm',
        _reset        => '  Reset',
        s_back        => '<<',
        ok            => '-OK-',
        menu_addition => '%%',
        info_thsd_sep => ',',
    };
    $info->{tc_default}  = { hide_cursor => 0, clear_screen => 1, page => 2, keep => 6, undef => $info->{s_back}, prompt => 'Your choice:' },
    $info->{tcu_default} = { hide_cursor => 0, clear_screen => 1, page => 2, keep => 6, confirm => $info->{ok}, back => $info->{s_back} },
    $info->{tf_default}  = { hide_cursor => 2, clear_screen => 1, page => 2, keep => 6, auto_up => 1, skip_items => qr/^\s*\z/ },
    $info->{tr_default}  = { hide_cursor => 2, clear_screen => 1, page => 2, history => [ 0 .. 1000 ] },
    $info->{lyt_h}       = { order => 0, alignment => 2 },
    $info->{lyt_v}       = { undef => $info->{_back}, layout => 2 },
    return bless { i => $info }, $class;
}


sub __init {
    my ( $sf ) = @_;
    my $home = File::HomeDir->my_home();
    if ( ! $home ) {

lib/App/DBBrowser/Opt/Get.pm  view on Meta::CPAN

            j_derived  => 0,
            j_cte      => 0,

            u_derived     => 0,
            u_cte         => 0,
            u_edit_stmt   => 0,
            u_parentheses => 0,
        },
        table => {
            codepage_mapping  => 0, # not an option, always 0
            hide_cursor       => 0, # not an option, always 0
            max_rows          => 0, # not an option, always 0
            page              => 2, # not an option, always 2

            binary_filter     => 0,
            binary_string     => 'BNRY',
            color             => 0,
            max_width_exp     => 0,
            min_col_width     => 30,
            mouse             => 0,
            pad_row_edges     => 0,

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

use 5.016;

use Cwd                   qw( realpath );
use Encode                qw( encode decode );
use File::Spec::Functions qw( catfile );

#use String::Unescape  qw( unescape );             # required
#use Text::CSV_XS      qw();                       # required

use Term::Choose         qw();
use Term::Choose::Screen qw( hide_cursor clear_screen );
use Term::Form::ReadLine qw();
use Term::TablePrint     qw();

use App::DBBrowser::Auxil;
use App::DBBrowser::Opt::Set;
use App::DBBrowser::Table::Substatement;
#use App::DBBrowser::Table::InsertUpdateDelete;     # required


sub new {

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

            if ( ! eval {
                $sf->__export( $sql );
                1 }
            ) {
                $ax->print_error_message( $@ );
                next CUSTOMIZE;
            }
        }
        elsif ( $sub_stmt eq $print_table || $sub_stmt eq $hidden_print ) {
            local $| = 1;
            print hide_cursor(); # safety
            print clear_screen();
            print 'Computing:' . "\r" if $sf->{o}{table}{progress_bar};
            my $all_arrayref;
            if ( ! eval {
                $all_arrayref = $sf->__selected_statement_result( $sql );
                1 }
            ) {
                $ax->print_error_message( $@ );
                next CUSTOMIZE;
            }

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

    my $count = 0;

    FILE_NAME: while ( 1 ) {
        if ( ++$count > 2 ) {
            $file_name = '';
        }
        my $info = $ax->get_sql_info( $sql );
        # Readline
        $file_name = $tr->readline(
            'File name: ',
            { info => $info, default => $file_name, hide_cursor => 2, history => [] }
        );
        $ax->print_sql_info( $info );
        if ( ! length $file_name ) {
            return;
        }

        FULL_FILE_NAME: while ( 1 ) {
            my $file_name_plus = $file_name;
            if ( $sf->{o}{export}{add_extension} && $file_name !~ /\.csv\z/i ) {
                $file_name_plus .= '.csv';



( run in 0.280 second using v1.01-cache-2.11-cpan-4d50c553e7e )