<delurk> hi, my name's Dave and I'm one of the London.pm cabal </>
On Fri, May 09, 2008 at 07:30:03PM +0100, Lyle wrote: > This last week I've overhauled a load of database routines grouping > methods into easy to use objects. All the routines are currently MySQL > based. My future plans are to have MSSQL, SQLite and maybe PostgreSQL as > database options. > > My current experience is with MySQL only. Does anyone know of any good > resources for doing this? Class::DBI or DBIx::Class. Personally I prefer Class::DBI but its internals are nasty and DBIx::Class seems to have more active development going on these days. They both provide a reasonably clean objecty abstraction for databases so you won't need to worry about the slight differences in syntax - although of course you are also largely confined to functionality that they share in common. That means no fancy tricks with triggers or stored procedures, although they both let you define pseudo-triggers in perl - handy if you're using an old version of MySQL, or need to do more in a trigger than SQLite can support. > I'm guessing the syntax for creating tables, etc, will be different for > each. Neither of the modules helps with that anyway, although the syntax should be mostly the same - CREATE TABLE is defined as part of the SQL standard. Where you'll find differences are in some of the extended datatypes (PostgreSQL is a particular offender here) which aren't supported everywhere, and in the non-standard methods that all databases use for doing things like telling the storage engine where to put the data and (in some cases) what format to use (eg MyISAM vs InnoDB for MySQL). -- David Cantrell | Hero of the Information Age _______________________________________________ BristolBathPM mailing list [email protected] http://mailman.bristolbath.org/mailman/listinfo/bristolbathpm
