Skip to content

Commit

Permalink
Closes #496
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Sep 24, 2019
1 parent 45c5b38 commit 8c8b22d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cli/introspection/src/prompt/components/useConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export function useConnector() {
const schema = credentials.type === DatabaseType.postgres ? credentials.schema : credentials.database
if (schema) {
meta = await connector.connector.getMetadata(schema)
meta.countOfTables = Number(meta.countOfTables)
}

setState({
Expand Down Expand Up @@ -174,7 +175,11 @@ export function useConnector() {

const schemas = await connector.connector.listSchemas()
const schemasWithMetadata = await Promise.all(
schemas.map(async name => ({ name, ...(await connector!.connector.getMetadata(name)) })),
schemas.map(async name => {
const meta = await connector!.connector.getMetadata(name)
meta.countOfTables = Number(meta.countOfTables)
return { name, ...meta }
}),
)

setState({ schemas: schemasWithMetadata })
Expand Down

0 comments on commit 8c8b22d

Please sign in to comment.