Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
case DatabaseType.mysql: {
client = await getConnectedMysqlClient(credentials)
disconnect = async () => (client as Connection).end()
break
}
case DatabaseType.postgres: {
client = await getConnectedPostgresClient(credentials)
disconnect = () => (client as PGClient).end()
break
}
case DatabaseType.sqlite:
throw new Error('sqlite not supported yet')
}
const connector = Connectors.create(credentials.type, client!)
return { connector, disconnect: disconnect! }
}