Git Product home page Git Product logo

Comments (9)

ymc9 avatar ymc9 commented on May 28, 2024

Hi @levipro , thanks for reporting this! Currently @default doesn't support the second argument yet. I think you can workaround using the @prisma.passthrough attribute:

CreatedDate  DateTime @prisma.passthrough('@default(now(), map: "DF_Address_CreatedDate")') @db.DateTime

from zenstack.

levipro avatar levipro commented on May 28, 2024

Thanks @ymc9 is there any work around for

NVarChar(Max)
VarChar(Max)

from zenstack.

ymc9 avatar ymc9 commented on May 28, 2024

Thanks @ymc9 is there any work around for

NVarChar(Max) VarChar(Max)

Sorry I missed that part. I'm actually not sure where this error came from. Do you mind sharing the zmodel snippet that caused it? Thanks! @levipro

from zenstack.

levipro avatar levipro commented on May 28, 2024

Here is an example repo
https://github.com/levipro/zenstack-issue

pnpm zenstack generate
Validation errors:
line 20: Could not resolve reference to ReferenceTarget named 'Max'. [Max]
line 21: Could not resolve reference to ReferenceTarget named 'Max'. [Max]
line 20: Value is not assignable to parameter [Max]
line 21: Value is not assignable to parameter [Max]
line 20: expression cannot be resolved [Max]
line 21: expression cannot be resolved [Max]

from zenstack.

ymc9 avatar ymc9 commented on May 28, 2024

I see. You can use the same "@prisma.passthrough" attribute to workaround. It basically passes text directly to the generated prisma schema:

Latitude                 String? @prisma.passthrough('@db.VarChar(Max)')

from zenstack.

ymc9 avatar ymc9 commented on May 28, 2024

Hi @levipro , I'm working on fixing this but couldn't find Prisma's documentation for the @db.VarChar(Max) definition (for the Max enum). Just wondering you may know where it's documented. I want to make sure to add other missing definitions as well.

from zenstack.

levipro avatar levipro commented on May 28, 2024

I don't have much information on that, maybe these might be a little help:
https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference
https://www.prisma.io/dataguide/datamodeling/tables-tuples-types

from zenstack.

ymc9 avatar ymc9 commented on May 28, 2024

Thanks! Finally found something in a link to Microsoft's doc. It seems Max is the only missing thing for that part.

from zenstack.

ymc9 avatar ymc9 commented on May 28, 2024

Hi @levipro , both issues are fixed in v1.1.0

from zenstack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.