| 1 | package DB::Introspector::SQLGen::TypeMapper; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | |||
| 5 | |||
| 6 | sub new { | ||
| 7 | my $class = shift; | ||
| 8 | my $self = bless({}, ref($class) || $class); | ||
| 9 | |||
| 10 | return $self; | ||
| 11 | } | ||
| 12 | |||
| 13 | sub stringify { | ||
| 14 | my $class = shift; | ||
| 15 | my $column = shift; | ||
| 16 | |||
| 17 | if( UNIVERSAL::isa($column, 'DB::Introspector::Base::IntegerColumn') ) { | ||
| 18 | $class->stringify_integer($column); | ||
| 19 | } elsif( UNIVERSAL::isa($column, 'DB::Introspector::Base::StringColumn') ) { | ||
| 20 | $class->stringify_string($column); | ||
| 21 | } elsif( UNIVERSAL::isa($column, 'DB::Introspector::Base::DateTimeColumn') ) { | ||
| 22 | $class->stringify_date($column); | ||
| 23 | } elsif( UNIVERSAL::isa($column, 'DB::Introspector::Base::CharColumn') ) { | ||
| 24 | $class->stringify_char($column); | ||
| 25 | } elsif( UNIVERSAL::isa($column, 'DB::Introspector::Base::BooleanColumn')) { | ||
| 26 | $class->stringify_boolean($column); | ||
| 27 | } elsif( UNIVERSAL::isa($column, 'DB::Introspector::Base::CLOBColumn')) { | ||
| 28 | $class->stringify_clob($column); | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | sub stringify_clob { | ||
| 33 | my $class = shift; | ||
| 34 | my $column = shift; | ||
| 35 | |||
| 36 | } | ||
| 37 | |||
| 38 | sub stringify_integer { | ||
| 39 | my $class = shift; | ||
| 40 | my $column = shift; | ||
| 41 | |||
| 42 | } | ||
| 43 | |||
| 44 | sub stringify_string { | ||
| 45 | my $class = shift; | ||
| 46 | my $column = shift; | ||
| 47 | |||
| 48 | } | ||
| 49 | |||
| 50 | sub stringify_date { | ||
| 51 | my $class = shift; | ||
| 52 | my $column = shift; | ||
| 53 | |||
| 54 | } | ||
| 55 | |||
| 56 | sub stringify_char { | ||
| 57 | my $class = shift; | ||
| 58 | my $column = shift; | ||
| 59 | |||
| 60 | } | ||
| 61 | |||
| 62 | 1; |