Modified query_executor module to handle db switches using metaprogramming