in reply to Re: Considering future support for different databases.
in thread Considering future support for different databases.

I don't know if completely cross-platform SQL is really an option. I know I've already used one MySQL specific function (GROUP_CONCAT), although I think most systems have a similar function.

As for the problem I'm trying to solve? Well, I just want to make future changes easier, so not only will it be able to support multiple databases, but then I won't have to worry about identical queries hardcoded in two different places.
  • Comment on Re^2: Considering future support for different databases.

Replies are listed 'Best First'.
Re^3: Considering future support for different databases.
by Joost (Canon) on Aug 15, 2008 at 20:31 UTC
    As others have already mentioned, at the very least, you want to separate out all SQL (or at least all the non-standard SQL) to some low level layer.

    IMHO instead of writing this layer yourself, usually it's a good idea to use an ORM layer like DBIx::Class, which should also make many common database tasks much more convenient. Your own design will end up looking similar anyway.

    In other words, you'll want to write as little SQL by hand as possible, and use whatever mechanism is convenient to handle the few DB specific variants (and ORM layers make that especially easy, since it's just a question of overriding the relevant methods).