New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make the SQLite driver work #15
Conversation
this test is very very close to the code in the svp docs
the former exists; the latter does not
For example, say I do this: #!perl use DBIx::Connector; my $conn = DBIx::Connector->new('dbi:SQLite:db.lite', undef, undef); $conn->txn({ ... $conn->svn({ ... }); }); Creating the connector loads DBIx::Connector::Driver::SQLite, which, *immediately* and during *compile time* checks $DBD::SQLite::sqlite_version to decide whether or not to create the methods that make the thing useful at all. Unfortunately, DBD::SQLite isn't loaded until the first call to txn, so checking that variable isn't very useful yet. The "$...::sqlite_version || 0" is a clue: why would that *ever* be undefined? I've replaced all that logic with runtime checks. After all, you certainly won't call txn or svp until *after* you've connected, which means *after* DBD::SQLite has been loaded. I've also made it fatal to try to use these features without the right version of SQLite. I'd hate to think someone is happily carrying on using savepoints and thinking they're useful, only to have each invocation silently do nothing!
Comment on the SQLite cleverness fix: Since I wrote that code (it should have As for the SQLite test: could it be adapted into The fix is obviously correct, though. Thanks! |
I'll have a look at moving the test and check tomorrow morning my time, so hopefully it'll be waiting for you when you get up. :-) |
Thanks! |
There you go! |
Make the SQLite driver work and fix bad method call in Driver.pm.
For detailed notes on the critical bugfixes in this pull request, see my commit comments.