Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-Introspection: introspect --url outputs additional lines which make output result unusable #8321

Closed
janpio opened this issue Jul 16, 2021 · 2 comments · Fixed by #8551
Closed
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/schema Issue for team Schema. topic: introspection topic: prisma db pull CLI: prisma db pull topic: re-introspection
Milestone

Comments

@janpio
Copy link
Member

janpio commented Jul 16, 2021

In Introspection CI we use introspect --print to get the schema output in the command line instead of it being written to a file. When using Re-Introspection, so with an existing schema file (e.g. to be able to use preview features) this seems to also output 2 additional lines, which make it impossible to just pipe the output somewhere:

λ npx prisma introspect --url "postgresql://prisma:qd58r...tk@introspect...bj.eu-west-1.rds.amazonaws.com:5432/ara...ice?schema=public" --print
Prisma schema loaded from schema.prisma
Datasource "db"
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["referentialActions"]
}

datasource db {
  provider = "postgresql"
  url      = "postgresql://prisma:qd58rcCywPRS4Stk@introspection-ci-postgres-public.clfeqqifnebj.eu-west-1.rds.amazonaws.com:5432/aragon-notification-service?schema=public"
}

model eventsources {
  eventsource_id   Int             @id @default(autoincrement())
  created_at       DateTime?       @default(now()) @db.Timestamptz(6)
  enabled          Boolean         @default(true)
  contract_address String          @db.VarChar(255)
  kernel_address   String          @db.VarChar(255)
  ...
@janpio janpio added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. topic: introspection topic: cli-introspect topic: re-introspection team/schema Issue for team Schema. labels Jul 16, 2021
@janpio
Copy link
Member Author

janpio commented Jul 16, 2021

Current workaround:
sed -e /'Prisma schema loaded from schema.prisma'/d -i schema.prisma && sed -e /'Datasource "db"'/d -i schema.prisma before using and validating the file.

@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels Jul 20, 2021
@Jolg42
Copy link
Member

Jolg42 commented Jul 26, 2021

Looks like we could fix this by only outputting the scheme when --print is passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/schema Issue for team Schema. topic: introspection topic: prisma db pull CLI: prisma db pull topic: re-introspection
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants