App-AltSQL

 view release on metacpan or  search on metacpan

lib/App/AltSQL/Model/MySQL.pm  view on Meta::CPAN

189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
        ## Update autocomplete entries
 
        if ($self->database) {
                $self->current_database($self->database);
                $self->update_autocomplete_entries($self->database);
        }
 
        $self->update_db_types();
}
 
sub update_autocomplete_entries {
        my ($self, $database) = @_;
 
        return if $self->no_auto_rehash;
        my $cache_key = 'autocomplete_' . $database;
        if (! $self->{_cache}{$cache_key}) {
                $self->log_debug("Reading table information for completion of table and column names\nYou can turn off this feature to get a quicker startup with -A\n");
 
                my %autocomplete;
                my $rows = $self->dbh->selectall_arrayref("select TABLE_NAME, COLUMN_NAME from information_schema.COLUMNS where TABLE_SCHEMA = ?", {}, $database);
                foreach my $row (@$rows) {

lib/App/AltSQL/Model/MySQL.pm  view on Meta::CPAN

284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
        };
 
        if (my $error = $self->dbh->errstr || $@) {
                $self->log_error($error);
                return;
        }
 
        return $sth;
}
 
sub update_db_types {
        my $self = shift;
 
        ## Collect type info from the handle
 
        my %types;
        my $type_info_all = $self->{dbh}->type_info_all();
        my %key_map = %{ shift @$type_info_all };
 
        $types{unknown} = { map { $_ => 'unknown' } keys %key_map };



( run in 0.222 second using v1.01-cache-2.11-cpan-454fe037f31 )