Neffrey
Neffrey
TTCTheo's Typesafe Cult
Created by Neffrey on 4/30/2024 in #questions
Error with tRPC & Drizzle with numeric data type
Now a little extra code to validate the string but thats not too bad. Ty!
11 replies
TTCTheo's Typesafe Cult
Created by Neffrey on 4/30/2024 in #questions
Error with tRPC & Drizzle with numeric data type
omg youre right. It is a string!
11 replies
TTCTheo's Typesafe Cult
Created by Neffrey on 4/30/2024 in #questions
Error with tRPC & Drizzle with numeric data type
Now I believe it to be in the interaction of Zod and Drizzle mixed with number types. Integer, number, decimel, still throws same error even with basic z.number() input checking. Guess I'm saving it as a numerical str for now :/
11 replies
TTCTheo's Typesafe Cult
Created by Neffrey on 4/30/2024 in #questions
Error with tRPC & Drizzle with numeric data type
After some testing, Its an error with the numeric data type. It works after commenting out my code in both the schema and trpc function. After uncommenting, error returns. Error persists after removing object with precision and scale. So it seems like the data type isnt being handled correctly. Not sure if me, trpc, drizzle... idk
11 replies
TTCTheo's Typesafe Cult
Created by Neffrey on 4/30/2024 in #questions
Error with tRPC & Drizzle with numeric data type
But I want to get it directly from ctx. Though even changing it to the input schema doesnt fix it :/
11 replies
TTCTheo's Typesafe Cult
Created by Neffrey on 4/30/2024 in #questions
Error with tRPC & Drizzle with numeric data type
Oh. Guess I should add the error. :/ No overload matches this call. Overload 2 of 2, '(values: { userId: string | SQL<unknown> | Placeholder<string, any>; total: string | SQL<unknown> | Placeholder<string, any>; hourly: string | SQL<unknown> | Placeholder<...>; startDate: SQL<...> | ... 1 more ... | Placeholder<...>; endDate: SQL<...> | ... 1 more ... | Placeholder<...>; id?: string | ... 2 more ... | undefined; }[]): PgInsertBase<...>', gave the following error. Object literal may only specify known properties, and 'userId' does not exist in type '{ userId: string | SQL<unknown> | Placeholder<string, any>; total: string | SQL<unknown> | Placeholder<string, any>; hourly: string | SQL<unknown> | Placeholder<string, any>; startDate: SQL<...> | ... 1 more ... | Placeholder<...>; endDate: SQL<...> | ... 1 more ... | Placeholder<...>; id?: string | ... 2 more ... |...'.ts(2769)
11 replies
TTCTheo's Typesafe Cult
Created by Neffrey on 4/24/2023 in #questions
Best way to fetch external api with variable & env_variable body data?
I ended up just implementing the query wrong in trpc. I was thinking I needed to use "useQuery" inside trpc which is just incorrect. After setting it up correctly it works like a charm 🙂
6 replies