|Just another Perl shrine|
Mogilefs is a significant perl app which is database-independent between MySQL, Postgres and SQLite.
Basically, the approach is to have a 'store' base class which encapsulates all db access.
There are capability flags set by each concrete derived store. e.g. 'can_replace' returns true in MogileFS::Store::MySQL, but false in MogileFS::Store::Postgres.
This allows methods like:
to try and do something sensible depending on the back-end.
But frankly, you're going to have db-specific bugs unless you've got good test coverage. And db independence gets harder the more of the db features you use (both because you have to check for more variation and because such things are less standardised).
In reply to Re: Considering future support for different databases.