From: Arthur Axel "fREW" Schmidt Date: Tue, 7 Sep 2010 01:07:06 +0000 (+0000) Subject: add some docs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6b1bf9f8155a05d8e2827c30af8d0ad8071bd295;p=scpubgit%2FQ-Branch.git add some docs --- diff --git a/lib/DBIx/Class/Storage/PrettyPrinter.pm b/lib/DBIx/Class/Storage/PrettyPrinter.pm index 58a64a4..d71995f 100644 --- a/lib/DBIx/Class/Storage/PrettyPrinter.pm +++ b/lib/DBIx/Class/Storage/PrettyPrinter.pm @@ -27,3 +27,28 @@ sub query_start { } 1; + +=pod + +=head1 SYNOPSIS + + package MyApp::Schema; + + use parent 'DBIx::Class::Schema'; + + use DBIx::Class::Storage::PrettyPrinter; + + __PACKAGE__->load_namespaces; + + my $pp = DBIx::Class::Storage::PrettyPrinter->new({ profile => 'console' }); + + sub connection { + my $self = shift; + + my $ret = $self->next::method(@_); + + $self->storage->debugobj($pp); + + $ret + } + diff --git a/lib/SQL/Abstract/Tree.pm b/lib/SQL/Abstract/Tree.pm index d626caf..78d496a 100644 --- a/lib/SQL/Abstract/Tree.pm +++ b/lib/SQL/Abstract/Tree.pm @@ -346,3 +346,14 @@ sub format { my $self = shift; $self->unparse($self->parse(@_)) } # FROM foo # WHERE foo.a > 2 +=head1 METHODS + +=head2 new + + my $sqla_tree = SQL::Abstract::Tree->new({ profile => 'console' }); + +=head2 format + + $sqlat->format('SELECT * FROM bar') + +Returns a formatting string based on wthe string passed in diff --git a/t/91podcoverage.t b/t/91podcoverage.t index dd3533c..de31232 100644 --- a/t/91podcoverage.t +++ b/t/91podcoverage.t @@ -28,6 +28,8 @@ my $exceptions = { ] }, 'SQL::Abstract::Test' => { skip => 1 }, + 'SQL::Abstract::Tree' => { skip => 1 }, + 'DBIx::Class::Storage::PrettyPrinter' => { skip => 1 }, }; foreach my $module (@modules) {