Main > Programming > Libraries >

Jifty::DBI::SchemaGenerator 0.29

Jifty::DBI::SchemaGenerator 0.29

Sponsored Links

Jifty::DBI::SchemaGenerator 0.29 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 0.097 MB
Platform: Any Platform
License: Perl Artistic License
Price:
Downloads: 1010
Date added: 2007-01-17
Publisher: David Glasser

Jifty::DBI::SchemaGenerator 0.29 description

Jifty::DBI::SchemaGenerator is a Perl module to generate table schemas from Jifty::DBI records.

This module turns a Jifty::Record object into an SQL schema for your chosen database. At the moment, your choices are MySQL, SQLite, or PostgreSQL. Oracle might also work right, though its untested.

SYNOPSIS

The Short Answer

See below for where we get the $handle and $model variables.

use Jifty::DBI::SchemaGenerator;
...
my $s_gen = Jifty::DBI::SchemaGenerator->new( $handle );
$s_gen->add_model($model);

my @statements = $s_gen->create_table_sql_statements;
print join("n", @statements, );
...
The Long Version
See Jifty::DBI for details about the first two parts.
MyModel
package MyModel;
# lib/MyModel.pm

use warnings;
use strict;

use base qw(Jifty::DBI::Record);
# your custom code goes here.
1;
MyModel::Schema
package MyModel::Schema;
# lib/MyModel/Schema.pm

use warnings;
use strict;

use Jifty::DBI::Schema;

column foo => type is text;
column bar => type is text;

1;
myscript.pl
#!/usr/bin/env perl
# myscript.pl

use strict;
use warnings;

use Jifty::DBI::SchemaGenerator;

use Jifty::DBI::Handle;
use MyModel;
use MyModel::Schema;

my $handle = Jifty::DBI::Handle->new();
$handle->connect(
driver => SQLite,
database => testdb,
);

my $model = MyModel->new($handle);
my $s_gen = Jifty::DBI::SchemaGenerator->new( $handle );
$s_gen->add_model($model);

# heres the basic point of this module:
my @statements = $s_gen->create_table_sql_statements;
print join("n", @statements, );

# this part is directly from Jifty::Script::Schema::create_all_tables()
$handle->begin_transaction;
for my $statement (@statements) {
my $ret = $handle->simple_query($statement);
$ret or die "error creating a table: " . $ret->error_message;
}
$handle->commit;

Jifty::DBI::SchemaGenerator 0.29 Screenshot

Advertisements

Jifty::DBI::SchemaGenerator 0.29 Keywords

Bookmark Jifty::DBI::SchemaGenerator 0.29

Hyperlink code:
Link for forum:

Jifty::DBI::SchemaGenerator 0.29 Copyright

WareSeeker periodically updates pricing and software information of Jifty::DBI::SchemaGenerator 0.29 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Jifty::DBI::SchemaGenerator 0.29 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
Related Software
SQL::Generator is a Perl module to generate SQL-statements with oo-perl. Free Download
Jifty::Manual::Tutorial is a Perl module for Zero to Jifty in a Jiffy. Free Download
Jifty::Script::Help is a Perl module to show help. Free Download
DBD-InterBase is a Perl-DBI driver for the Firebird and InterBase Databases, written using the InterBase C API. Free Download
Wily::Message is a Perl extension to handle Wily Messages. Free Download
DBIx::Wrapper is a Perl module that serves as a wrapper around DBI. Free Download
DBIx::DataModel is a Perl module with Classes and UML-style Associations on top of DBI. Free Download
DBIx::XMLMessage is a Perl module for XML Message exchange between DBI data sources. Free Download