Adds basic automatic database switching to Rails
#35073

eileencodes wants to merge eileencodes:db-selection into rails:master

We do not currently have an analysis of these two commits