How to use the prisma-db-introspection.Connectors.create function in prisma-db-introspection

To help you get started, we’ve selected a few prisma-db-introspection examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prisma / prisma2 / cli / introspection / src / introspectionConnector.ts View on Github external
}
    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! }
}

prisma-db-introspection

This module is capable of generating a prisma datamodel for a relational or document databases. Please refer to the `prisma-datamodel` doc for more information on the `ISDL` datamodel structure.

Apache-2.0
Latest version published 4 years ago

Package Health Score

56 / 100
Full package analysis

Popular prisma-db-introspection functions

Similar packages