App-DBIUtils

 view release on metacpan or  search on metacpan

bin/dump-dbi-column-info  view on Meta::CPAN

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
            pos => 0,
        },
        table => {
            schema => 'str*',
            req => 1,
            pos => 1,
        },
        user => {
            schema => 'str*',
        },
        password => {
            schema => 'str*',
        },
        catalog => {
            schema => 'str*',
        },
        schema => {
            schema => 'str*',
            default => 'main',
        },
    },
};
sub dump_dbi_column_info {
    my %args = @_;
 
    my $dbh = DBI->connect($args{dsn}, $args{user}, $args{password},
                           {RaiseError=>1});
    my @rows;
    my $sth = $dbh->column_info($args{catalog}, $args{schema}, $args{table}, undef);
    while (my $row = $sth->fetchrow_hashref) {
        push @rows, $row;
    }
    [200, "OK", \@rows];
}
 
Perinci::CmdLine::Any->new(url => '/main/dump_dbi_column_info')->run;

bin/dump-dbi-column-info  view on Meta::CPAN

154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
=over
 
=item B<--catalog>=I<s>
 
=item B<--dsn>=I<s>*
 
=item B<--help>, B<-h>, B<-?>
 
Display help message and exit.
 
=item B<--password>=I<s>
 
=item B<--schema>=I<s>
 
Default value:
 
 "main"
 
=item B<--table>=I<s>*
 
=item B<--user>=I<s>

bin/dump-dbi-column-info  view on Meta::CPAN

230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=foo ...]>. The section will then only be used when the reading program matches.
 
Finally, you can filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]>. If you only want a sectio...
 
List of available configuration parameters:
 
 catalog (see --catalog)
 dsn (see --dsn)
 format (see --format)
 naked_res (see --naked-res)
 password (see --password)
 schema (see --schema)
 table (see --table)
 user (see --user)
 
=head1 ENVIRONMENT
 
=head2 DUMP_DBI_COLUMN_INFO_OPT => str
 
Specify additional command-line options

bin/dump-dbi-table-info  view on Meta::CPAN

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
    summary => 'Dump DBI table_info() information',
    args => {
        dsn => {
            schema => 'str*',
            req => 1,
            pos => 0,
        },
        user => {
            schema => 'str*',
        },
        password => {
            schema => 'str*',
        },
        catalog => {
            schema => 'str*',
        },
        schema => {
            schema => 'str*',
            default => 'main',
        },
    },
};
sub dump_dbi_table_info {
    my %args = @_;
 
    my $dbh = DBI->connect($args{dsn}, $args{user}, $args{password},
                           {RaiseError=>1});
    my @rows;
    my $sth = $dbh->table_info($args{catalog}, $args{schema}, "%", undef);
    while (my $row = $sth->fetchrow_hashref) {
        push @rows, $row;
    }
    [200, "OK", \@rows];
}
 
Perinci::CmdLine::Any->new(url => '/main/dump_dbi_table_info')->run;

bin/dump-dbi-table-info  view on Meta::CPAN

149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
=over
 
=item B<--catalog>=I<s>
 
=item B<--dsn>=I<s>*
 
=item B<--help>, B<-h>, B<-?>
 
Display help message and exit.
 
=item B<--password>=I<s>
 
=item B<--schema>=I<s>
 
Default value:
 
 "main"
 
=item B<--user>=I<s>
 
=item B<--version>, B<-v>

bin/dump-dbi-table-info  view on Meta::CPAN

223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=foo ...]>. The section will then only be used when the reading program matches.
 
Finally, you can filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]>. If you only want a sectio...
 
List of available configuration parameters:
 
 catalog (see --catalog)
 dsn (see --dsn)
 format (see --format)
 naked_res (see --naked-res)
 password (see --password)
 schema (see --schema)
 user (see --user)
 
=head1 ENVIRONMENT
 
=head2 DUMP_DBI_TABLE_INFO_OPT => str
 
Specify additional command-line options
 
=head1 FILES



( run in 0.252 second using v1.01-cache-2.11-cpan-e9199f4ba4c )