Matoslav
Matoslav
DTDrizzle Team
Created by Matoslav on 7/12/2024 in #help
Date (de)serializing
Hi, how can I achieve that for data type "date" in postgresql I will be able to insert dates in string and they will be deserialized as Date data type when selecting? In Drizzle v. 0.29.3, this behavior was common: I could input dates as strings, and they would be deserialized into Date objects. However, now it seems that Drizzle requires me to either: Serialize the date as a string and deserialize it as a string, or Serialize the date as a Date object and deserialize it as a Date object. How can I achieve the previous behavior in the current version?
5 replies
DTDrizzle Team
Created by Matoslav on 8/27/2023 in #help
onConflictDoUpdate() ID entry
How to get ID of entry in onConflictDoUpdate, where conflict appeared?
10 replies
DTDrizzle Team
Created by Matoslav on 7/6/2023 in #help
Compare enums in select
I want to compare enum from my offer schema with query parameter (that is basically string). export const offerType = pgEnum('type', ['SEARCH']); query used in where statement: eq(offers.type, query.type) error from nestjs server:
[Nest] 6660 - 06. 07. 2023, 19:22:57 ERROR [ExceptionsHandler] invalid input syntax for type integer: "SEARCH"
error: invalid input syntax for type integer: "SEARCH"
[Nest] 6660 - 06. 07. 2023, 19:22:57 ERROR [ExceptionsHandler] invalid input syntax for type integer: "SEARCH"
error: invalid input syntax for type integer: "SEARCH"
How am I supposed to check equality of enum and string in my select query?
3 replies