summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-02-18 11:55:34 -0600
committerJesse Luehrs <doy@tozt.net>2011-02-18 11:55:34 -0600
commitf4b3b90c3ccef7deb127c3ea1fc46984d64db605 (patch)
tree817f201afbe5fd9f48a7099cb4001d21914ef78c
parent3aee937a96e2ca2afc2c37fbf69274a08d5f8293 (diff)
downloadnarwhal-f4b3b90c3ccef7deb127c3ea1fc46984d64db605.tar.gz
narwhal-f4b3b90c3ccef7deb127c3ea1fc46984d64db605.zip
make the dsn externally settable
-rw-r--r--lib/Narwhal.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Narwhal.pm b/lib/Narwhal.pm
index 5f0eff3..0a7a24e 100644
--- a/lib/Narwhal.pm
+++ b/lib/Narwhal.pm
@@ -4,7 +4,16 @@ use Narwhal::RouteBuilder::HTTPMethod;
with 'OX::Role::WithAppRoot';
-config kioku_dsn => 'dbi:SQLite:narwhal.db';
+has dsn => (
+ is => 'ro',
+ isa => 'Str',
+ default => 'dbi:SQLite:narwhal.db',
+);
+
+config kioku_dsn => sub {
+ my ($s, $app) = @_;
+ $app->dsn;
+};
config kioku_extra_args => sub { { create => 1 } };
config template_root => sub {
shift->param('app_root')->subdir('root', 'templates')