"Dancer::Logger" is not generally a helpful debug message :)
This is thanks to Ignor Bujna who supplied the original code for this - thanks Igor! I've refactored it slightly and added some documentation. This allows you to say database($name) where $name is the name of a connection defined in your configuration file, so multiple connections are easily handled. Since this is a fairly major change, I'll release it as a dev release for testing first.
DBD::SQLite requires the database name (filename) to be passed as 'dbname', not 'database'. (The DBI docs recommend that all DBD::* drivers should understand 'database', but DBD::SQLite currently doesn't). Make things easier for users by translating database to dbname if connecting using the SQLite driver.
When forming a DSN, colons should be used for "dbi:driver:", but semi-colons should be used to delimit additional parameters (database, host, port). Thanks to Steve Atkins for reporting this in RT #61089. Also, documentation update to relect the use of $dbh->ping.
Wish I'd spotted this before releasing 0.05, rather than just after!
Applying patch from Igor Bujna ading the ability to provide parameters to be passed to the DBI->connect call, e.g. RaiseError or AutoCommit, and also the ability to provide a list of queries which should be performed immediately upon connection to the database. Thanks Igor! In documenting these changes, I also improved the existing documentation slightly.
If DBD driver doesn't implement ping(), do our own simple test (attempt a simple query). This avoids unnecessary and expensive reconnects when using a DBD driver without a ping() implementation. Log a debug message when reconnecting. This release seems to fix an issue Tadzik was experiencing whilst using DBD::SQLite, and receiving a warning when the old DB connection went out of scope: Issuing rollback() due to DESTROY without explicit disconnect()
This is unlikely to achieve much, but it doesn't hurt to make sure. A user was experiencing warnings when using SQLite, stating: Issuing rollback() due to DESTROY without explicit disconnect()... This might, possibly, help with that. If not, it won't hurt.
…d directly. So, prefix with _.