Skip to content

Commit

Permalink
Fixes #1051
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Dec 9, 2019
1 parent 6375840 commit 33e047b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cli/introspection/src/prompt/components/useConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,19 @@ export function useConnector(): UseConnector {
try {
const url = credentialsToUri(credentials)
const canConnect = await canConnectToDatabase(url)
if (canConnect === true) {
if (canConnect === true || canConnect.code === 'P1003') {
// if we can connect, we always are interested in the metadata
await getMetadata(credentials)

const dbDoesntExist = typeof canConnect === 'object' && canConnect.code === 'P1003'
if (!dbDoesntExist) {
await getMetadata(credentials)
}

setState({
error: null,
canConnect: true,
checkingConnection: false,
dbDoesntExist,
})
} else {
setState({
Expand Down

0 comments on commit 33e047b

Please sign in to comment.