After working on persistence issues and doing some documentation, I'm finally back to this thread ;-).
I tried to document the syntactic basics Brian is referring to here: [url]http://doc.silverstripe.com/doku.php?id=sql-queries[/url] - comments are of course very welcome.
Now to the thing to be used instead of the original switch: Would the following be what you intend? So you can (optionally) use version numbers and there's the option "other", so you won't have to duplicate queries (I wouldn't use compliant as that is sometimes not true, even if it is working across two databases).
Yes, I agree with Ingo, and this looks good, but please ensure the following cases are covered (referring to the first example in this thread):
if mysql = 4.0.1 we should throw an error (NOTE: I'm pointing out the implication in the example above that 4.0.2 is implied as a minimum version number needed. If we want to indicate that "we don't care" about version number for a particular query, we should probably have a "default" query that can be specified on a database-specific level. That means mysql would have 4.0.2, 5.0.3, and default queries as array elements.)
if mysql = 5.0.1 we should use the query specified in the 4.0.2 array element.