Implement db switching.