From: Justin Hunter Date: Tue, 11 Aug 2009 02:51:35 +0000 (-0700) Subject: add compat methods X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=49063029f50f110a34cdad85bf25127446373511;p=dbsrgits%2FSQL-Translator-2.0-ish.git add compat methods --- diff --git a/lib/SQL/Translator/Object/Table.pm b/lib/SQL/Translator/Object/Table.pm index 9e8d986..7a1d9c4 100644 --- a/lib/SQL/Translator/Object/Table.pm +++ b/lib/SQL/Translator/Object/Table.pm @@ -19,6 +19,7 @@ class SQL::Translator::Object::Table { provides => { exists => 'exists_column', keys => 'column_ids', + values => 'get_columns', get => 'get_column', }, curries => { @@ -39,6 +40,7 @@ class SQL::Translator::Object::Table { provides => { exists => 'exists_index', keys => 'index_ids', + values => 'get_indices', get => 'get_index', }, curries => { @@ -59,6 +61,7 @@ class SQL::Translator::Object::Table { provides => { exists => 'exists_constraint', keys => 'constraint_ids', + values => 'get_constraints', get => 'get_constraint', }, curries => { @@ -69,7 +72,7 @@ class SQL::Translator::Object::Table { } } }, - default => sub { {} }, + default => sub { my %hash = (); tie %hash, 'Tie::IxHash'; return \%hash }, ); has 'sequences' => ( @@ -79,6 +82,7 @@ class SQL::Translator::Object::Table { provides => { exists => 'exists_sequence', keys => 'sequence_ids', + values => 'get_sequences', get => 'get_sequence', }, curries => { @@ -102,4 +106,6 @@ class SQL::Translator::Object::Table { isa => Bool, default => 0 ); + + method get_fields { return $self->get_columns } }