Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const basedOn =
!args['--url'] && schemaPath
? ` based on datasource defined in ${chalk.underline(path.relative(process.cwd(), schemaPath))}`
: ''
log(`Introspecting${basedOn} …`)
const before = Date.now()
let introspectionSchema = await engine.introspect(url)
engine.stop()
if (introspectionSchema.trim() === '') {
throw new Error(`Empty introspection result for ${chalk.underline(url)}`)
}
const connectorType = databaseTypeToConnectorType(uriToCredentials(url).type)
const datasourceString = printDatasources([
{
config: {},
connectorType,
name: 'db',
url,
},
])
introspectionSchema = datasourceString + '\n' + introspectionSchema
debug('introspectionSchema:')
debug(introspectionSchema)
try {