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?
3 Replies
Matoslav
MatoslavOP5mo ago
so any idea how to handle this situation? or better question, how to define custom type that accepts string and returns Date?
rphlmr ⚡
rphlmr ⚡5mo ago
I tried before answering and had no luck. The customType helper forces to have the same ts type in and out :/
Want results from more Discord servers?
Add your server