I'm pretty sure this doesn't compile since cloudSqlDial is not defined without the AppEngine SDK.

Also I'd prefer not to introduce case differentiations for every special case.
Maybe a var with a reference to dial function which is overwritten in the appengine file?