2 class SQL::Translator::Object::Schema {
3 use MooseX::Types::Moose qw(HashRef Maybe Str);
4 use MooseX::AttributeHelpers;
5 use SQL::Translator::Types qw(Procedure Table View);
6 extends 'SQL::Translator::Object';
16 metaclass => 'Collection::Hash',
18 isa => HashRef[Table],
20 exists => 'exists_table',
22 values => 'get_tables',
28 my ($self, $body, $table) = @_;
29 $self->$body($table->name, $table);
33 default => sub { my %hash = (); tie %hash, 'Tie::IxHash'; return \%hash },
37 metaclass => 'Collection::Hash',
41 exists => 'exists_view',
43 values => 'get_views',
49 my ($self, $body, $view) = @_;
50 $self->$body($view->name, $view);
54 default => sub { {} },
58 metaclass => 'Collection::Hash',
60 isa => HashRef[Procedure],
62 exists => 'exists_procedure',
63 keys => 'procedure_ids',
64 values => 'get_procedures',
65 get => 'get_procedure',
69 add_procedure => sub {
70 my ($self, $body, $procedure) = @_;
71 $self->$body($procedure->name, $procedure);
75 default => sub { {} },