summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2005-12-31 17:41:38 +0000
committerJason Woodward2005-12-31 17:41:38 +0000
commit8eae4e3736e66e94de8ef5e262af15a67233a0b7 (patch)
treec2fe8094f4d0ccc3907e758eb1b8b0f1ce74f2b4
parent3cabf91c5aefb74d4a5e1facde029812f9db482c (diff)
downloadJaos-DBI-8eae4e3736e66e94de8ef5e262af15a67233a0b7.tar.gz
updated pod
-rw-r--r--META.yml18
-rw-r--r--README22
-rw-r--r--lib/Jaos/DBI.pm20
3 files changed, 16 insertions, 44 deletions
diff --git a/META.yml b/META.yml
deleted file mode 100644
index 9df9ff5..0000000
--- a/META.yml
+++ /dev/null
@@ -1,18 +0,0 @@
----
-name: Catalyst-Plugin-Session-Store-JDBI
-version: 0.01
-author:
- - 'Jason Woodward, <woodwardj@jaos.org>'
-abstract: Store your sessions in a database
-license: perl
-requires:
- Catalyst: 5.49
- Catalyst::Plugin::Session: 0
- Catalyst::Plugin::Session::Store: 0
- DBI: 0
- MIME::Base64: 0
-provides:
- Catalyst::Plugin::Session::Store::JDBI:
- file: lib/Catalyst/Plugin/Session/Store/JDBI.pm
- version: 0.01
-generated_by: Module::Build version 0.2611
diff --git a/README b/README
index 61a3a56..b69aa36 100644
--- a/README
+++ b/README
@@ -57,7 +57,13 @@ SYNOPSIS
User->delete(nick => 'zaphod', email => 'newaddress@foo.com');
DESCRIPTION
- Some description here.
+ Jaos::DBI provides a convenient abstraction layer to a database in the
+ same vein as Class::DBI and its spinoffs.
+
+ The aim is to keep it simple and avoid the db statement hit from
+ Class::DBI and make it easier to use views, complex sql joins for basic
+ class definitions, and get rid of the large requirements for external
+ modules used by Class::DBI.
METHODS
setup
@@ -118,7 +124,7 @@ METHODS
manual_update
Get or set the option to stop auto update on modification. Must call
- __PACKAGE__->update manually.
+ __PACKAGE__->update() manually.
sequence
Get or set the tables sequence. This is used to generate unique primary
@@ -126,9 +132,6 @@ METHODS
__PACKAGE__->sequence('users_id_seq');
- dbh
- Retrieve the database handle [not recommended].
-
sequence_nextval
Returns the next value for the tables sequence.
@@ -159,15 +162,6 @@ METHODS
returns undef.
my $obj = __PACKAGE__->find_or_create(column1 => $value, column2 => $value);
- =cut
-
- sub find_or_create { my $self = shift; my $table = $self->table;
-
- if (my ($r) = $self->search(@_)) {
- return $r;
- }
- return $self->insert(@_);
- }
search
Searches the table and returns a list of matching objects.
diff --git a/lib/Jaos/DBI.pm b/lib/Jaos/DBI.pm
index 6299b44..b38744f 100644
--- a/lib/Jaos/DBI.pm
+++ b/lib/Jaos/DBI.pm
@@ -69,7 +69,12 @@ Jaos::DBI - Jaos DBI object similar to Class::DBI
=head1 DESCRIPTION
-Some description here.
+Jaos::DBI provides a convenient abstraction layer to a database in the same
+vein as Class::DBI and its spinoffs.
+
+The aim is to keep it simple and avoid the db statement hit from Class::DBI
+and make it easier to use views, complex sql joins for basic class definitions,
+and get rid of the large requirements for external modules used by Class::DBI.
=cut
@@ -278,7 +283,7 @@ sub virtual_columns
=head2 manual_update
-Get or set the option to stop auto update on modification. Must call __PACKAGE__->update manually.
+Get or set the option to stop auto update on modification. Must call __PACKAGE__->update() manually.
=cut
@@ -308,12 +313,6 @@ sub sequence
$self->_sequence() || undef;
}
-=head2 dbh
-
-Retrieve the database handle [not recommended].
-
-=cut
-
=head2 sequence_nextval
Returns the next value for the tables sequence.
@@ -363,10 +362,6 @@ sub prepare
my $self = shift;
my $sql = shift;
- # this causes weird issues with the statement handles being recreated causing
- # mod_perl, apache, and postgres to have issues
- #return $self->_jaos_dbh->prepare_cached(@_,undef,$if_active);
-
$self->_jaos_dbh()->()->prepare_cached($sql);
}
@@ -438,6 +433,7 @@ sub create
This attempts to find a row with the column values specified, or creates one. Calls __PACKAGE__->search(@_) and __PACKAGE__->insert(@_) if search returns undef.
my $obj = __PACKAGE__->find_or_create(column1 => $value, column2 => $value);
+
=cut
sub find_or_create