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

Support for Unsupported, dbgenerated() and @@ignore #679

Closed
do4gr opened this issue Jan 27, 2021 · 4 comments · Fixed by #684, #685 or #687
Closed

Support for Unsupported, dbgenerated() and @@ignore #679

do4gr opened this issue Jan 27, 2021 · 4 comments · Fixed by #684, #685 or #687
Labels
kind/feature A request for a new feature.
Milestone

Comments

@do4gr
Copy link
Member

do4gr commented Jan 27, 2021

We've introduced two new schema properties and also changed dbgenerated(). We'd like to get support for these from the VsCode extension as soon as possible. Just not highlighting them as wrong would be fine in the beginning.

The changes in the first model are already implemented, the @@ignore from the second will also hopefully be done this sprint.
Unsupported is a new type containing a String description of a db type for migrate. It does not allow for a native type at the same time.
The db generated default changes to now always take one String argument. That is the db description necessary to set the default for migrate.

@@ignore is a new model level directive that tells the client to ignore this model. It has no arguments and is valid on all models.

model Simple {
  id                Int                                     @id @db.Integer
  new            Unsupported("money") @default(dbgenerated("12"))
}

model NoId {
  id                Int                                     
  @@ignore
}

AC:

  • Don't show errors on the VSCode
  • (Potential) Add autocomplete for Unsupported() (again, if easy)
  • Grey out fields and models for [@]@ignore `
  • The new Native Types are shown:
    Postgres: Money (mapped to Float Prisma scalar),
    Postgres: InetAdress (String)
    Postgres: OID (Integer)
    Postgres: citext (String)
    MySQL: Set (String)
    Unsupported()
@albertoperdomo
Copy link
Contributor

@janpio is suggesting we split the new types from supporting Unsupported+dbgenerate, @@ignore.
DO you agree it make sense @martzoukos @do4gr ?

@janpio janpio added the kind/feature A request for a new feature. label Jan 28, 2021
@Jolg42
Copy link
Member

Jolg42 commented Jan 29, 2021

@madebysid made these 2 PR

#684
#685

@sdnts
Copy link
Contributor

sdnts commented Jan 29, 2021

On the latest Insiders version, I have verified that these things work:

  • @db.Money (Postgres)
  • @db.Inet (Postgres)
  • @db.Oid (Postgres)
  • @db.Citext (Postgres)
  • @db.Set (MySQL) (this is not returned by prisma-fmt @do4gr, is this expected? I'll create an issue if yea)
  • Unsupported("") with autocomplete

Greying out @@ignored models is a bit more work so I've created a separate issue (#689) for it that we can tackle after this release, since there's significant work to be done in Studio yet.

@ignore is not yet supported by engines, so there's only a draft PR open: #688. I'll merge this in next week.

There's one PR open for dbgenerated(): #687 which will close this issue.

@sdnts sdnts modified the milestone: 2.16.0 Jan 29, 2021
@Jolg42
Copy link
Member

Jolg42 commented Jan 29, 2021

@madebysid @tomhoule mentioned (in our team slack) that @db.Set (MySQL) was not implemented yet.

@Jolg42 Jolg42 linked a pull request Jan 29, 2021 that will close this issue
@sdnts sdnts closed this as completed Jan 29, 2021
@janpio janpio added this to the 2.16.0 milestone Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment