Add enum to db_type and use it for key_state state.