Permalink
Browse files

Creating Dancer2 version

  • Loading branch information...
1 parent 855824f commit 25acd0eaa7faa4fb53b174c355649e90350efd96 @ambs ambs committed Jul 25, 2013
View
@@ -15,3 +15,4 @@ cover_db
pod2htm*.tmp
Dancer-Plugin-Database-*
MYMETA.*
+*~
View
@@ -15,7 +15,7 @@ SYNOPSIS
template 'display_widget', { widget => $sth->fetchrow_hashref };
};
- # The handle is a Dancer::Plugin::Database::Handle object, which subclasses
+ # The handle is a Dancer::Plugin::Database::Core::Handle object, which subclasses
# DBI's DBI::db handle and adds a few convenience features, for example:
get '/insert/:name' => sub {
database->quick_insert('people', { name => params->{name} });
@@ -36,10 +36,10 @@ DESCRIPTION
Provides an easy way to obtain a connected DBI database handle by simply
calling the database keyword within your Dancer application
- Returns a Dancer::Plugin::Database::Handle object, which is a subclass
+ Returns a Dancer::Plugin::Database::Core::Handle object, which is a subclass
of DBI's `DBI::db' connection handle object, so it does everything you'd
expect to do with DBI, but also adds a few convenience methods. See the
- documentation for Dancer::Plugin::Database::Handle for full details of
+ documentation for Dancer::Plugin::Database::Core::Handle for full details of
those.
Takes care of ensuring that the database handle is still connected and
@@ -106,7 +106,7 @@ CONFIGURATION
The optional `log_queries' setting enables logging of queries generated
by the helper functions `quick_insert' et al in
- Dancer::Plugin::Database::Handle. If you enable it, generated queries
+ Dancer::Plugin::Database::Core::Handle. If you enable it, generated queries
will be logged at 'debug' level. Be aware that they will contain the
data you're passing to/from the database, so be careful not to enable
this option in production, where you could inadvertently log sensitive
@@ -119,7 +119,7 @@ CONFIGURATION
The optional `handle_class' defines your own class into which database
handles should be blessed. This should be a subclass of
- Dancer::Plugin::Database::Handle (or DBI::db directly, if you just want
+ Dancer::Plugin::Database::Core::Handle (or DBI::db directly, if you just want
to skip the extra features).
You will require slightly different options depending on the database
@@ -198,10 +198,10 @@ GETTING A DATABASE HANDLE
CONVENIENCE FEATURES (quick_select, quick_update, quick_insert, quick_delete)
The handle returned by the `database' keyword is a
- Dancer::Plugin::Database::Handle object, which subclasses the `DBI::db'
+ Dancer::Plugin::Database::Core::Handle object, which subclasses the `DBI::db'
DBI connection handle. This means you can use it just like you'd
normally use a DBI handle, but extra convenience methods are provided,
- as documented in the POD for Dancer::Plugin::Database::Handle.
+ as documented in the POD for Dancer::Plugin::Database::Core::Handle.
Examples:
@@ -225,7 +225,7 @@ CONVENIENCE FEATURES (quick_select, quick_update, quick_insert, quick_delete)
database->quick_select($table_name, {});
There's more extensive documentation on these features in
- Dancer::Plugin::Database::Handle, including using the `order_by',
+ Dancer::Plugin::Database::Core::Handle, including using the `order_by',
`limit', `columns' options to sort / limit results and include only
specific columns.
@@ -7,19 +7,6 @@ use Dancer::Plugin::Database::Core::Handle;
use Dancer ':syntax';
use Dancer::Plugin;
-use DBI;
-use Scalar::Util 'blessed';
-
-# my $dancer_version = (exists &dancer_version) ? int(dancer_version()) : 1;
-# my ($logger);
-# if ($dancer_version == 1) {
-# require Dancer::Config;
-# Dancer::Config->import();
-
-# $logger = sub { Dancer::Logger->can($_[0])->($_[1]) };
-# } else {
-# $logger = sub { log @_ };
-# }
=encoding utf8
@@ -29,7 +16,7 @@ Dancer::Plugin::Database - easy database connections for Dancer applications
=cut
-our $VERSION = '2.04';
+our $VERSION = '2.50'; # Try to keep up with Dancer2
my $settings = undef;
View
@@ -0,0 +1,6 @@
+Revision history for Dancer-Plugin-Database
+
+2.50 XXX
+ - First version, released together with
+ Dancer::Plugin::Database::Core version 0.01 and
+ Dancer::Plugin::Database version 2.50
View
@@ -0,0 +1,16 @@
+Changes
+MANIFEST
+MANIFEST.SKIP
+Makefile.PL
+README
+lib/Dancer2/Plugin/Database.pm
+t/00-load.t
+t/01-basic.t
+t/manifest.t
+t/pod-coverage.t
+t/pod.t
+t/lib/TestApp.pm
+t/lib/lib/TestHandleClass.pm
+t/lib/public/.placeholder
+t/lib/views/.placeholder
+t/lib/lib/.placeholder
View
@@ -0,0 +1,16 @@
+^\.git\/
+maint
+^tags$
+.last_cover_stats
+Makefile$
+^blib
+^pm_to_blib
+^.*.bak
+^.*.old
+^t.*sessions
+^cover_db
+^.*\.log
+^run_perltidy.sh$
+^.*\.swp$
+^ignore.txt
+^.gitignore
View
@@ -0,0 +1,16 @@
+Changes
+MANIFEST
+MANIFEST.SKIP
+Makefile.PL
+README
+lib/Dancer/Plugin/Database.pm
+t/00-load.t
+t/01-basic.t
+t/manifest.t
+t/pod-coverage.t
+t/pod.t
+t/lib/TestApp.pm
+t/lib/lib/TestHandleClass.pm
+t/lib/public/.placeholder
+t/lib/views/.placeholder
+t/lib/lib/.placeholder
View
@@ -0,0 +1,30 @@
+use strict;
+use warnings;
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+ NAME => 'Dancer2::Plugin::Database',
+ AUTHOR => q{David Precious <davidp@preshweb.co.uk>},
+ VERSION_FROM => 'lib/Dancer2/Plugin/Database.pm',
+ ABSTRACT_FROM => 'lib/Dancer2/Plugin/Database.pm',
+ ($ExtUtils::MakeMaker::VERSION >= 6.3002
+ ? ('LICENSE'=> 'perl')
+ : ()),
+ PL_FILES => {},
+ PREREQ_PM => {
+ 'Test::More' => 0,
+ 'Dancer::Plugin::Database::Core' => 0,
+ # Need support for Dancer2-compatible stuff
+ 'Dancer' => 1.3099,
+ 'DBI' => 0,
+ },
+ dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
+ clean => { FILES => 'Dancer2-Plugin-Database-*' },
+ META_MERGE => {
+ resources => {
+ repository => 'https://github.com/bigpresh/Dancer-Plugin-Database',
+ bugtracker => 'https://github.com/bigpresh/Dancer-Plugin-Database/issues',
+ homepage => 'https://github.com/bigpresh/Dancer-Plugin-Database/',
+ },
+ },
+);
Oops, something went wrong.

0 comments on commit 25acd0e

Please sign in to comment.