Fix logic to determine database settings for schema route.