if/the/else chains depending on some kind of mode switch indicate that polymorphism should be used. The Strategy pattern would fit nicely: define an interface for "load CSV into the database", provide implementations for MySQL, PostGres and generic SQL.