Mercurial > pub > Impl
comparison Lib/IMPL/SQL/Schema.pm @ 163:6ce1f052b90a
temp commit
| author | wizard |
|---|---|
| date | Tue, 15 Mar 2011 02:32:42 +0300 |
| parents | 16ada169ca75 |
| children | eb3e9861a761 |
comparison
equal
deleted
inserted
replaced
| 162:39c8788eded5 | 163:6ce1f052b90a |
|---|---|
| 1 use strict; | 1 use strict; |
| 2 package IMPL::SQL::Schema; | 2 package IMPL::SQL::Schema; |
| 3 | 3 |
| 4 use base qw(IMPL::Object IMPL::Object::Disposable IMPL::Object::Autofill); | 4 use base qw( |
| 5 IMPL::Object | |
| 6 IMPL::Object::Disposable | |
| 7 IMPL::Object::Autofill | |
| 8 IMPL::Object::Clonable | |
| 9 ); | |
| 5 use IMPL::Class::Property; | 10 use IMPL::Class::Property; |
| 6 use IMPL::Class::Property::Direct; | 11 use IMPL::Class::Property::Direct; |
| 7 | 12 |
| 8 require IMPL::SQL::Schema::Table; | 13 require IMPL::SQL::Schema::Table; |
| 9 | 14 |
| 45 $table->Dispose(); | 50 $table->Dispose(); |
| 46 | 51 |
| 47 return 1; | 52 return 1; |
| 48 } | 53 } |
| 49 | 54 |
| 55 sub ResolveTable { | |
| 56 my ($this,$table) = @_; | |
| 57 | |
| 58 UNIVERSAL::isa($table,'IMPL::SQL::Schema::Table') ? $table : $this->{$Tables}{$table}; | |
| 59 } | |
| 60 | |
| 50 sub Dispose { | 61 sub Dispose { |
| 51 my ($this) = @_; | 62 my ($this) = @_; |
| 52 | 63 |
| 53 $_->Dispose foreach values %{$this->{$Tables}}; | 64 $_->Dispose foreach values %{$this->{$Tables}}; |
| 54 | 65 |
| 61 | 72 |
| 62 __END__ | 73 __END__ |
| 63 =pod | 74 =pod |
| 64 | 75 |
| 65 =head1 SINOPSYS | 76 =head1 SINOPSYS |
| 77 | |
| 78 =begin code | |
| 66 | 79 |
| 67 require IMPL::SQL::Schema; | 80 require IMPL::SQL::Schema; |
| 68 use IMPL::SQL::Types qw(Varchar Integer); | 81 use IMPL::SQL::Types qw(Varchar Integer); |
| 69 | 82 |
| 70 my $dbSchema = new IMPL::SQL::Schema; | 83 my $dbSchema = new IMPL::SQL::Schema; |
| 82 | 95 |
| 83 # so on | 96 # so on |
| 84 | 97 |
| 85 # and finally don't forget to | 98 # and finally don't forget to |
| 86 | 99 |
| 87 $dbSchema->Dispoce(); | 100 $dbSchema->Dispose(); |
| 101 | |
| 102 =end code | |
| 88 | 103 |
| 89 =head1 DESCRIPTION | 104 =head1 DESCRIPTION |
| 90 | 105 |
| 91 Схема реляциоонной базы данных, орентированная на язык SQL, содержит описания таблиц | 106 Схема реляциоонной базы данных, орентированная на язык SQL, содержит описания таблиц |
| 92 которые являются частью базы. Позволяет создавать и удалать таблицы. | 107 которые являются частью базы. Позволяет создавать и удалать таблицы. |
