App-DBBrowser

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

        - Term::Choose minimum version 1.765.

2.409  2024-04-28
        - SQLite plugin: new option to set the busy timeout.
        - SQLite: Renamed and modified the user defined scalar function 'truncate'.
                  Now 'trunc' treats any value that looks like a number as a number.
        - Bugfix in the limit/offset submenu.
        - New input filter 'convert datetime'.
        - Quote entered numbers if the data type is not numeric and no placeholders are used.
        - Added scalar convert functions.
        - Epoch_to_DateTime: bugfix and updates.
        - Data import: if chosen a deleted directory warn and remove the directory from history.

2.408_05  2024-04-21
        - sqlite_busy_timeout.
        - Bugfix limit, offset.

2.408_04  2024-04-15
        - New input filter: convert_datetime.

2.408_03  2024-04-05
        - Quote numbers if the data type is not numeric.
        - Refactoring.

2.408_02  2024-04-01
        - New: to_xxx scalar functions.
        - Refactored ScalarFunctions.
        - If chosen a deleted directory: warn and remove it from history.

2.408_01  2024-03-21
        - Epoch_to_DateTime: bugfix and updates.
        - New: Unix_Timestamp.

2.407  2024-03-11
        - Bugfix: auto-increment primary key quoted twice.

2.406  2024-03-11
        - New 'create table' options: 'table constraints' and 'table options'.
        - Update option 'auto increment column'.
        - Use storable to make deep copies.
        - DB2, Oracle, Firebird: regex operator bugfix.

Changes  view on Meta::CPAN

2.320    2023-03-14
        - Update default aliases.

2.319    2023-03-13
        - Create tables: update list of tables even if insert failed.

2.318    2023-03-13
        - Bugfix update/delete info print.

2.317    2023-03-12
        - Informix: add 'Epoch_to_DateTime'.
        - Informix add connection attribute 'ix_EnableUTF8'.
        - Pg: add schema 'public' only if db is user-db.
        - New option: DB2 application code set.
        - New option to disable table print warnings
        - Option 'binary_filter': add hexadecimal format.
        - Allow nested function.
        - attached_DB.json: save attached databases as hash.
        - Bugfix in 'from_col_by_col'.
        - Bugfix in 'CreateDropAttach'.

Changes  view on Meta::CPAN

        - Bugfix 'update' 'join' mysql/MariaDB.
        - Bugfix MariaDB: no 'offset' without 'limit'.

2.304    2022-10-12
        - Term::TablePrint minimum version is '0.154'.

2.303    2022-07-22
        - Bugfix insert plain.

2.302    2022-07-17
        - Function Epoch_to_DateTime: handle undefined values.

2.301    2022-07-06
        - Use Encode::Locale to get STDIN/STDOUT encodings.
        - Win32: don't alter the terminal code page.
        - Use at least DBD::SQLite 1.68.

2.300    2022-07-02
        - Renamed option 'Max rows' to 'Auto Limit'.
        - 'Auto Limit' defaults to 0.
        - Update database-plugins.

Changes  view on Meta::CPAN

        - Term::Form minimum version is '0.551'.

2.298    2022-06-23
        - Update and bugfixes Functions.pm.

2.297    2022-06-20
        - Added Firebird-plugin.
        - Update plugin-API: 'sqlite_search' is now 'search'.
        - Bugfix: reading file with Text::CSV.
        - Update 'from_col_by_col'.
        - Update function 'Epoch_to_DateTime'.
        - Refactoring Functions.pm.
        - Removed backward compatibility for removed option values.

2.296    2022-05-01
        - Term::Choose minimum version is '1.749'.
        - Term::Form minimum version is '0.547'.
        - Update documentation.

2.295    2022-03-31
       - Make the code work with the new version (0.543) of Term::From.

Changes  view on Meta::CPAN

        - Adapt the code to the updated Term::Choose.

2.280    2021-08-24
        - DBD::SQLite 1.68 or greater is required.
        - print_table: table_name -> footer.
        - Renamed the option 'f3' to 'search'.
        - 'Ctrl-F' instead of 'F3' to open the search prompt.
        - PageUP/PageDown: 'Ctrl-P'/'Ctrl-N' instead of 'Ctrl-B'/'Ctrl-F'.

2.279    2021-07-29
        - Bugfix in functions Epoch_to_Date/Epoch_to_DateTime: use driver specific regex statement.

2.278    2021-07-29
        - Removed the source type 'Copy&Paste'.
        - Removed option 'Truncated rows'.

2.277    2021-07-28
        - SQLite: replace 'sqlite_unicode' with 'sqlite_string_mode' if DBD::SQLite version >= 1.68.
        - Bugfix in 'attributes': use the values not the indexes.
        - Bugfix: apply DB specific setting immediately.

META.json  view on Meta::CPAN

         "requires" : {
            "ExtUtils::MakeMaker" : "0"
         }
      },
      "runtime" : {
         "requires" : {
            "Cwd" : "0",
            "DBD::SQLite" : "1.74",
            "DBD::SQLite::Constants" : "0",
            "DBI" : "0",
            "DateTime::Format::Strptime" : "0",
            "Encode" : "0",
            "Encode::Locale" : "0",
            "File::Basename" : "0",
            "File::Find" : "0",
            "File::HomeDir" : "0",
            "File::Spec::Functions" : "0",
            "File::Which" : "0",
            "FindBin" : "0",
            "Getopt::Long" : "0",
            "JSON::MaybeXS" : "0",

META.yml  view on Meta::CPAN

name: App-DBBrowser
no_index:
  directory:
    - t
    - inc
requires:
  Cwd: '0'
  DBD::SQLite: '1.74'
  DBD::SQLite::Constants: '0'
  DBI: '0'
  DateTime::Format::Strptime: '0'
  Encode: '0'
  Encode::Locale: '0'
  File::Basename: '0'
  File::Find: '0'
  File::HomeDir: '0'
  File::Spec::Functions: '0'
  File::Which: '0'
  FindBin: '0'
  Getopt::Long: '0'
  JSON::MaybeXS: '0'

Makefile.PL  view on Meta::CPAN

    EXE_FILES        => [ 'bin/db-browser' ],
    BUILD_REQUIRES   => {
        'Test::More' => 0,
    },
    PREREQ_PM => {
        'bytes'                      => 0,
        'open'                       => 0,
        'strict'                     => 0,
        'warnings'                   => 0,
        'Cwd'                        => 0,
        'DateTime::Format::Strptime' => 0,
        'DBD::SQLite'                => '1.74',
        'DBD::SQLite::Constants'     => 0,
        'DBI'                        => 0,
        'Encode'                     => 0,
        'Encode::Locale'             => 0,
        'File::Basename'             => 0,
        'File::Find'                 => 0,
        'File::HomeDir'              => 0,
        'File::Spec::Functions'      => 0,
        'File::Which'                => 0,

bin/db-browser  view on Meta::CPAN

Supported L<modifiers|https://perldoc.perl.org/perlre#Modifiers>: C<imnsxage>.

In the replacement, the variable C<$c> can be used as a counter. C<$c> is set to C<0> before each C<s///>.

By selecting the prompt line (I<Your choice:>), one can save I<search & replace> instructions for later use.

If a I<search & replace> has altered the first row of the input data, a menu entry named C<RESTORE header row> is
offered.


=item Convert DateTime

Convert a I<DateTime> to another format or to seconds since the Unix epoch.

    id | date_time                            id | date_time
    ---|----------------------------          ---|--------------------
     1 | Sat 13 Aug 2022 07:38:49 PM           1 | 2022-08-13 19:38:49
    ---|----------------------------          ---|--------------------
     2 | Mon 15 Aug 2022 12:08:54 PM           2 | 2022-08-15 12:08:54
    ---|----------------------------          ---|--------------------
     3 | Tue 16 Aug 2022 09:56:13 AM           3 | 2022-08-16 09:56:13

=item Split Table

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

    my $remove_cell   = 'Remove_Cell';
    my $insert_cell   = 'Insert_Cell';
    my $split_table   = 'Split_Table';
    my $split_column  = 'Split_Column';
    my $join_columns  = 'Join_Columns';
    my $fill_up_rows  = 'Fill_up_Rows';
    my $empty_to_null = ' Empty_2_null';
    my $choose_cols   = 'Choose_Columns';
    my $append_col    = 'Append_Columns';
    my $cols_to_rows  = 'Columns_to_Rows';
    my $convert_date  = 'Convert_DateTime';
    my $s_and_replace = 'Search_&_Replace';
    my $field_count = @{$sql->{insert_args}} * @{$sql->{insert_args}[0]};
    my $bu_insert_args = [ map { [ @$_ ] } @{$sql->{insert_args}} ]; # copy the entire data
    $sf->{empty_to_null} = $sf->{o}{insert}{empty_to_null_file};
    my $working = $field_count > 500_000 ? 'Working ... ' : undef;
    my $old_idx = 0;

    FILTER: while ( 1 ) {
        my $skip = ' ';
        my $menu = [

lib/App/DBBrowser/GetContent/Filter/ConvertDate.pm  view on Meta::CPAN

package # hide from PAUSE
App::DBBrowser::GetContent::Filter::ConvertDate;

use warnings;
use strict;
use 5.016;

use DateTime::Format::Strptime;

use Term::Choose         qw();
use Term::Form::ReadLine qw();

use App::DBBrowser::Auxil;
use App::DBBrowser::GetContent::Filter;


sub new {
    my ( $class, $info, $options, $d ) = @_;

lib/App/DBBrowser/GetContent/Filter/ConvertDate.pm  view on Meta::CPAN

                    # Readline
                    my $locale_in = $tr->readline(
                        $prompt_locale_in,
                        { info => $info, history => [] }
                    );
                    if ( length $locale_in ) {
                        $formatter_args->{locale} = $locale_in;
                        push @in_info, $prompt_locale_in . $locale_in;
                    }
                }
                my $formatter = DateTime::Format::Strptime->new( %$formatter_args, on_error  => 'undef' );

                TYPE: while ( 1 ) {
                    $info = $cf->__get_filter_info( $sql, join( "\n", @in_info ) );
                    my ( $format, $epoch ) = ( '- DateTime', '- Epoch' );
                    # Choose
                    my $choice = $tc->choose(
                        [ @pre, $format, $epoch ],
                        { %{$sf->{i}{lyt_v}}, prompt => 'To: ', undef => $sf->{i}{s_back}, info => $info }
                    );
                    if ( ! defined $choice ) {
                        ++$count_error_in;
                        next IN;
                    }
                    my $count_error_out = 0;



( run in 0.344 second using v1.01-cache-2.11-cpan-05444aca049 )