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

@db.Date directive is recognised as DateTime with Postgres #185

Closed
westernwontons opened this issue Oct 23, 2022 · 3 comments
Closed

@db.Date directive is recognised as DateTime with Postgres #185

westernwontons opened this issue Oct 23, 2022 · 3 comments

Comments

@westernwontons
Copy link

My Prisma Schema has the following table:

model Food {
  id        Int      @id @default(autoincrement())
  food_type String   @db.VarChar(20)
  name      String   @db.VarChar(200)
  price     Float    @db.Real
  amount    Float    @db.Real
  total     Float    @db.Real
  date      DateTime @db.Date
}

Even though I set @db.Date, it's still recognised as DateTime when I want to use Prisma. Am I missing something or this is intended?

Here is a screenshot of the generated type signature:

Screenshot 2022-10-23 at 22 46 47

@Brendonovich
Copy link
Owner

Looks like Prisma Client JS uses the same type for Date as DateTime:
image

Though using Chrono's Date<Tz> would probably be a good candidate for #83. Can't promise it'll happen soon but I'll keep it in mind.

@westernwontons
Copy link
Author

Would you be accepting PR's for this?

@Brendonovich
Copy link
Owner

Yes, but it would be for 0.7.0 instead of 0.6.3. I'd want to implement many native types instead of just this one, so I'm going to close this issue in favour of #83.

@Brendonovich Brendonovich closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants