Add dbSelector generator function and dbDisconnectAll