DB::Introspector::Base::FunctionalIndex
DB::Introspector::Base::Index
use DB::Introspector; my $introspector = DB::Introspector->get_instance($dbh); my $table = $introspector->find_table('users'); foreach my $index ($table->indexes) { print "INDEX (". join(",", $index->column_names). ")\n"; }
Represents a functional index of a table. This implementation is a very barebones quick fix that still fits into the DB::Introspector::Base framework.
In the future, I would like to create a collection of datastructures that can generically describe a functional index expression, which could then be returned by the FunctionIndex package. This would require that driver implementations be able to parse expressions.
Returns: an array (@) of column names in the order in which the index was declared. If the column name is an expression then it is the expression as it is declared in the database.
Returns: 1 if this column is an expression and 0 otherwise.
Masahji C. Stewart
The DB::Introspector::Base::FunctionalIndex module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install DB::Introspector, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DB::Introspector
CPAN shell
perl -MCPAN -e shell install DB::Introspector
For more information on module installation, please visit the detailed CPAN module installation guide.