| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Parse::Dia::SQL::Output::Ingres; | 
| 2 |  |  |  |  |  |  |  | 
| 3 |  |  |  |  |  |  | # $Id: Ingres.pm,v 1.2 2009/03/02 13:41:39 aff Exp $ | 
| 4 |  |  |  |  |  |  |  | 
| 5 |  |  |  |  |  |  | =pod | 
| 6 |  |  |  |  |  |  |  | 
| 7 |  |  |  |  |  |  | =head1 NAME | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | Parse::Dia::SQL::Output::Ingres - Create SQL for Ingres. | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | =head1 SEE ALSO | 
| 12 |  |  |  |  |  |  |  | 
| 13 |  |  |  |  |  |  | Parse::Dia::SQL::Output | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  | =cut | 
| 16 |  |  |  |  |  |  |  | 
| 17 | 3 |  |  | 3 |  | 5609 | use warnings; | 
|  | 3 |  |  |  |  | 7 |  | 
|  | 3 |  |  |  |  | 96 |  | 
| 18 | 3 |  |  | 3 |  | 15 | use strict; | 
|  | 3 |  |  |  |  | 7 |  | 
|  | 3 |  |  |  |  | 60 |  | 
| 19 |  |  |  |  |  |  |  | 
| 20 | 3 |  |  | 3 |  | 13 | use Data::Dumper; | 
|  | 3 |  |  |  |  | 6 |  | 
|  | 3 |  |  |  |  | 138 |  | 
| 21 | 3 |  |  | 3 |  | 19 | use File::Spec::Functions qw(catfile); | 
|  | 3 |  |  |  |  | 7 |  | 
|  | 3 |  |  |  |  | 177 |  | 
| 22 |  |  |  |  |  |  |  | 
| 23 | 3 |  |  | 3 |  | 20 | use lib q{lib}; | 
|  | 3 |  |  |  |  | 22 |  | 
|  | 3 |  |  |  |  | 17 |  | 
| 24 | 3 |  |  | 3 |  | 340 | use base q{Parse::Dia::SQL::Output}; # extends | 
|  | 3 |  |  |  |  | 11 |  | 
|  | 3 |  |  |  |  | 285 |  | 
| 25 |  |  |  |  |  |  |  | 
| 26 |  |  |  |  |  |  | require Parse::Dia::SQL::Logger; | 
| 27 |  |  |  |  |  |  | require Parse::Dia::SQL::Const; | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | =head2 new | 
| 30 |  |  |  |  |  |  |  | 
| 31 |  |  |  |  |  |  | The constructor.  Arguments: | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  | =cut | 
| 34 |  |  |  |  |  |  |  | 
| 35 |  |  |  |  |  |  | sub new { | 
| 36 |  |  |  |  |  |  | my ( $class, %param ) = @_; | 
| 37 |  |  |  |  |  |  | my $self = {}; | 
| 38 |  |  |  |  |  |  |  | 
| 39 |  |  |  |  |  |  | # Set defaults for ingres | 
| 40 |  |  |  |  |  |  | $param{db}                     = q{ingres}; | 
| 41 |  |  |  |  |  |  | $param{object_name_max_length} = $param{object_name_max_length} || 30; | 
| 42 |  |  |  |  |  |  | $param{end_of_statement}       = $param{end_of_statement} || "\n\\g"; | 
| 43 |  |  |  |  |  |  |  | 
| 44 |  |  |  |  |  |  | $self = $class->SUPER::new(%param); | 
| 45 |  |  |  |  |  |  | bless( $self, $class ); | 
| 46 |  |  |  |  |  |  |  | 
| 47 |  |  |  |  |  |  | return $self; | 
| 48 |  |  |  |  |  |  | } | 
| 49 |  |  |  |  |  |  |  | 
| 50 |  |  |  |  |  |  | =head2 _get_drop_index_sql | 
| 51 |  |  |  |  |  |  |  | 
| 52 |  |  |  |  |  |  | create drop index for index on table with given name. | 
| 53 |  |  |  |  |  |  |  | 
| 54 |  |  |  |  |  |  | drop index idx_foo for ingres | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  | =cut | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | sub _get_drop_index_sql { | 
| 59 |  |  |  |  |  |  | my ( $self, $tablename, $indexname ) = @_; | 
| 60 |  |  |  |  |  |  | return qq{drop index $indexname for } | 
| 61 |  |  |  |  |  |  | . $self->{db} | 
| 62 |  |  |  |  |  |  | . $self->{end_of_statement} | 
| 63 |  |  |  |  |  |  | . $self->{newline}; | 
| 64 |  |  |  |  |  |  | } | 
| 65 |  |  |  |  |  |  |  | 
| 66 |  |  |  |  |  |  |  | 
| 67 |  |  |  |  |  |  |  | 
| 68 |  |  |  |  |  |  | 1; | 
| 69 |  |  |  |  |  |  |  | 
| 70 |  |  |  |  |  |  | __END__ |