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

[Introspection] Remove @default from scalar lists #1110

Closed
janpio opened this issue Dec 6, 2019 · 5 comments
Closed

[Introspection] Remove @default from scalar lists #1110

janpio opened this issue Dec 6, 2019 · 5 comments
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. topic: introspection
Milestone

Comments

@janpio
Copy link
Member

janpio commented Dec 6, 2019

  • Error parsing attribute "@default": Cannot set a default value on list field.
  • default-on-list
  • @default on a list type field (which is not supported)

Postgres, basic-blog:

Error: Schema parsing error: Error parsing attribute "@default": Cannot set a default value on list field..
  -->  schema.prisma:25
   | 
24 |   id      Int      @id @sequence(name: "posts_id_seq", allocationSize: 1, initialValue: 1)
25 |   tags    String[] @default("{}[]") @scalarList(strategy: EMBEDDED)
26 |   title   String
   | 
@sorenbs
Copy link
Member

sorenbs commented Dec 9, 2019

Decision

We can release Photon without support for a default value on scalar lists. We should simply omit @default(...) from the printed PSL.

Later, we should decide on a serialisation format for providing a scalar list default value in the PSL

@janpio
Copy link
Member Author

janpio commented Dec 9, 2019

Long Term Solution

Decide on a serialisation format for providing a scalar list default value in the PSL

Guardrail

No support for a default value on scalar lists, simply omit @default(...) from the printed PSL.

Decision

We go with the guardrail for now.

@janpio janpio transferred this issue from prisma/prisma-engines Dec 10, 2019
@janpio janpio added this to the Preview 19 milestone Dec 10, 2019
@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. labels Dec 11, 2019
@janpio janpio changed the title [Introspection] Cannot set a default value on list field.. [Introspection] Remove @default from scalar lists Dec 15, 2019
@do4gr do4gr closed this as completed Dec 19, 2019
@BrenoMazieiro
Copy link

BrenoMazieiro commented Aug 24, 2021

Are there any news about this feature?

@janpio
Copy link
Member Author

janpio commented Aug 24, 2021

What feature? This is a bug report about Introspection getting things wrong for @default of scalar lists - which is not possible. If you mean that feature, it is being tracked at #8330

@BrenoMazieiro
Copy link

Thanks @janpio! "that" one it is! =)

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. topic: introspection
Projects
None yet
Development

No branches or pull requests

5 participants