DBIx::OO 0.0.4
Sponsored Links
DBIx::OO 0.0.4 Ranking & Summary
File size:
0.023 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
1015
Date added:
2007-01-13
Publisher:
Mihai Bazon
DBIx::OO 0.0.4 description
DBIx::OO is a database to Perl objects abstraction.
SYNOPSIS
package MyDB;
use base DBIx::OO;
# We need to overwrite get_dbh since its an abstract function.
# The way you connect to the DB is really your job; this function
# should return the database handle. The default get_dbh() croaks.
my $dbh;
sub get_dbh {
$dbh = DBI->connect_cached(dbi:mysql:test, user, passwd)
if !defined $dbh;
return $dbh;
}
package MyDB::Users;
use base MyDB;
__PACKAGE__->table(Users);
__PACKAGE__->columns(P => [ id ],
E => [qw/ first_name last_name email /]);
__PACKAGE__->has_many(pages => MyDB::Pages, user);
package MyDB::Pages;
use base MyDB;
__PACKAGE__->table(Pages);
__PACKAGE__->columns(P => [ id ],
E => [qw/ title content user /]);
__PACKAGE__->has_a(user => MyDB::Users);
package main;
my $u = MyDB::Users->create({ id => userid,
first_name => Q,
last_name => W });
my $foo = MyDB::Users->retrieve(userid);
my @p = @{ $foo->fk_pages };
print "User: ", $foo->first_name, " ", $foo->last_name, " pages:n";
foreach (@p) {
print $_->title, "n";
}
$foo->first_name(John);
$foo->last_name(Doe);
# or
$foo->set(first_name => John, last_name => Doe);
$foo->update;
SYNOPSIS
package MyDB;
use base DBIx::OO;
# We need to overwrite get_dbh since its an abstract function.
# The way you connect to the DB is really your job; this function
# should return the database handle. The default get_dbh() croaks.
my $dbh;
sub get_dbh {
$dbh = DBI->connect_cached(dbi:mysql:test, user, passwd)
if !defined $dbh;
return $dbh;
}
package MyDB::Users;
use base MyDB;
__PACKAGE__->table(Users);
__PACKAGE__->columns(P => [ id ],
E => [qw/ first_name last_name email /]);
__PACKAGE__->has_many(pages => MyDB::Pages, user);
package MyDB::Pages;
use base MyDB;
__PACKAGE__->table(Pages);
__PACKAGE__->columns(P => [ id ],
E => [qw/ title content user /]);
__PACKAGE__->has_a(user => MyDB::Users);
package main;
my $u = MyDB::Users->create({ id => userid,
first_name => Q,
last_name => W });
my $foo = MyDB::Users->retrieve(userid);
my @p = @{ $foo->fk_pages };
print "User: ", $foo->first_name, " ", $foo->last_name, " pages:n";
foreach (@p) {
print $_->title, "n";
}
$foo->first_name(John);
$foo->last_name(Doe);
# or
$foo->set(first_name => John, last_name => Doe);
$foo->update;
DBIx::OO 0.0.4 Screenshot
DBIx::OO 0.0.4 Keywords
DBIx
OO
MyDB
PACKAGE
OO 0.0.4
Perl Objects
Database To
name
dbh
last
first
database
user
DBIx::OO
DBIxOO
DBIx::OO 0.0.4
Bookmark DBIx::OO 0.0.4
DBIx::OO 0.0.4 Copyright
WareSeeker periodically updates pricing and software information of DBIx::OO 0.0.4 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 DBIx::OO 0.0.4 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
DBIx::OO::Tree is a Perl module to manipulate hierarchical data using the "nested sets" model. Free Download
DBIx:DataLookup 0.03 is designed as a useful tool which can help you easily both cache records pulled by an SQL statement from a database in the memory as well as look them up later at any time during execution of your script. Free Download
DBIx::Version is a Perl extension for getting database software name and version. Free Download
DBOW is a database compiler-compiler or front-end. Free Download
DBIx::Log4perl is a Perl extension for DBI to selectively log SQL, parameters, result-sets, etc. Free Download
Doodle is a file search tool based on meta-data. Free Download
DBIx::DBStag is a Perl module for Relational Database to Hierarchical (Stag/XML) Mapping. Free Download
DBIx::XML_RDB is a Perl extension for creating XML from existing DBI datasources. Free Download
Latest Software
Popular Software
Favourite Software