Alzabo::IntroAlzabo::Intro is a Perl module that contains introductory information about Alzabo. | |
Download |
Alzabo::Intro Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Dave Rolsky
- Publisher web site:
- http://search.cpan.org/~drolsky/
Alzabo::Intro Tags
Alzabo::Intro Description
Alzabo::Intro is a Perl module that contains introductory information about Alzabo. Alzabo::Intro is a Perl module that contains introductory information about Alzabo.CREATING A SCHEMAThe first thing you'll want to do is create a schema. The easiest way to do this is to reverse engineer an existing schema. The Mason GUI, available in the separate Alzabo::GUI::Mason distribution, provides another means of creating a schema.And of course, you can create one through a custom Perl script which uses the various Alzabo::Create::* classes. Here's the beginning of such a script: use Alzabo::Create::Schema; eval { my $s = Alzabo::Create::Schema->new( name => 'foo', rdbms => 'MySQL' ); my $table = $s->make_table( name => 'some_table' ); my $a_col = $table->make_column( name => 'a_column', type => 'int', nullable => 0, sequenced => 0, attributes => ); $table->add_primary_key($a_col); my $b_col = $table->make_column( name => 'b_column', type => 'varchar', length => 240, nullable => 0 ); $table->make_index( columns => ); ... $s->save_to_file; }; if ($@) { handle exceptions }USAGE EXAMPLESAlzabo is a powerful tool but as with many powerful tools it can also be a bit overwhelming at first. The easiest way to understand some of its basic capabilities is through some examples. Let's first assume that you've created the following schema: TABLE: Movie movie_id tinyint -- primary key title varchar(200) release_year year TABLE: Person person_id tinyint -- primary key name varchar(200) birthdate date birthplace_location_id tinyint -- foreign key to location TABLE: Job job_id tinyint -- primary key job varchar(200) -- something like 'actor' or 'director' TABLE: Credit movie_id tinyint -- primary key part 1, foreign key to movie person_id tinyint -- primary key part 2, foreign key to person job_id tinyint -- primary key part 3, foreign key to job TABLE: Location location_id tinyint -- primary key location varchar(200) -- 'New York City' or 'USA' parent_location_id tinyint -- foreign key to location Requirements: · Perl
Alzabo::Intro Related Software