bigpresh/Dancer-Plugin-SimpleCRUD

Doesn't find database config? [ not "Plugging in" properly? ]

nateau opened this issue · 2 comments

Our Main.pm has Dancer's 'database' working just fine, but SimpleCRUD doesn't seem to find it, dying with:
Error while loading .../bin/app.psgi: Can't get a database connection without settings supplied!
Please check you've supplied settings in config as per the Dancer::Plugin::Database documentation at /Library/Perl/5.18/Dancer/Plugin/Database/Core.pm line 206, line 1.
Compilation failed in require at .../bin/app.psgi line 13, line 1.
BEGIN failed--compilation aborted at .../bin/app.psgi line 13, line 1.

I've "force" fixed it by passing in the dbh as an argument (ie. everywhere that SimpleCRUD calls database, it now says:
my $dbh = $args{dbh} // database($args{db_connection_name});

However, SimpleCRUD still doesn't work, my specified prefix:
prefix => '/edit_foo',
generates a 404 error.

Also, it's not clear to me from what format the simple_crud placeholder should be in the template file?

[ It's possible that all these issues relate to SimpleCRUD's Dancer1-ness, cf. Dancer2 which we are running? ]

I don't think D:P:SC supports Dancer2 yet.

If you post a short code sample showing use of D:P:SC with Dancer2 I'll take a look at what would need to change to make this work.

Sorry for the very slow reply! As Josh says, D::P::SC sadly doesn't yet support D2.

I very much want it to, but haven't managed to find the time to make it so; I'm quite busy at the moment, so I can't promise I'll find enough spare time to tackle that unless I end up needing to do so as part of paying work.

As the issue is basically "doesn't work with Dancer2", I'm going to close this issue, and raise "work with Dancer2" as a new feature request.