zendev
zendev
Explore posts from servers
TTCTheo's Typesafe Cult
Created by West side ⁉ on 10/14/2023 in #questions
Drizzle-ORM+PSQL: sorry, too many clients already
The solution George sent above looks good, you basically just create a singleton to use for dev instances and leave it as is for production instances
9 replies
TTCTheo's Typesafe Cult
Created by tsuki on 11/2/2023 in #questions
onSuccess, onError and onSettled deprecated next major version?
Perfect thanks mate
16 replies
TTCTheo's Typesafe Cult
Created by tsuki on 11/2/2023 in #questions
onSuccess, onError and onSettled deprecated next major version?
Yeah this is what I wanted to do but can’t find the queryClient config in the t3 setup
16 replies
TTCTheo's Typesafe Cult
Created by tsuki on 11/2/2023 in #questions
onSuccess, onError and onSettled deprecated next major version?
I could very well be wrong but could someone enlighten me on how to do useQuery error handling w trpc?
16 replies
TTCTheo's Typesafe Cult
Created by tsuki on 11/2/2023 in #questions
onSuccess, onError and onSettled deprecated next major version?
Hi just read through the article, everything makes sense but in the t3 setup there isn’t a way to do what they did regarding toasting an error, bc the onError callback from trpc occurs on the server side, inside the pages/api folder?
16 replies
TTCTheo's Typesafe Cult
Created by zendev on 11/8/2023 in #questions
Building shadcn <Form> components for string arrays?
Ahh so this is the only way, I was hoping there was a slightly less complex pattern but all good field arrays it is
5 replies
TTCTheo's Typesafe Cult
Created by fdawg on 10/27/2023 in #questions
Persisting state across Next.js pages
Reacts context api can be used to store state values globally. If you’re talking solely about rendering a UI component across all pages, simply render that component in the highest part of your component tree (I believe this is _app.tsx in the pages dir, not sure what the file is called for app dir)
5 replies
TTCTheo's Typesafe Cult
Created by West side ⁉ on 10/14/2023 in #questions
Drizzle-ORM+PSQL: sorry, too many clients already
Agreed, let me know if you figure out a solution
9 replies
TTCTheo's Typesafe Cult
Created by West side ⁉ on 10/14/2023 in #questions
Drizzle-ORM+PSQL: sorry, too many clients already
Dealing with exactly the same issue right now, did some research and it looks like it has to do with the hot module reload (HMR) that you get in dev environment with Next.js. I believe you need to create a singleton to avoid opening a new db connection everytime an HMR refresh happens, but I'm not sure as to the best way to do this, or if there's an accepted best practice. Maybe someone can confirm/correct me here and provide an example solution?
9 replies
TTCTheo's Typesafe Cult
Created by zendev on 10/6/2023 in #questions
Best practice for providing current user from db to all react components?
Sweet thanks guys
9 replies
TTCTheo's Typesafe Cult
Created by zendev on 10/6/2023 in #questions
Best practice for providing current user from db to all react components?
Ohhh really? So if I called the same useQuery in say 10 components rendered on the page, it would still only make one query to the db?
9 replies
TTCTheo's Typesafe Cult
Created by zendev on 10/6/2023 in #questions
Best practice for providing current user from db to all react components?
Sorry I think I wasn’t super clear - I’m talking about providing that data globally to every component in the app, without having to create a bunch of individual queries for every time a component needs that data
9 replies
TTCTheo's Typesafe Cult
Created by zendev on 8/23/2023 in #questions
Alternative to Clerk for cross-platform app (Next.js / React Native + Expo)
Asking because I’d rather build the web app first either way
11 replies
TTCTheo's Typesafe Cult
Created by zendev on 8/23/2023 in #questions
Alternative to Clerk for cross-platform app (Next.js / React Native + Expo)
Ah gotcha. Not too familiar with multi-schema vs. single-schema, so if I went with the single schema I’d have to create the expo project in a separate repo and then call the api from the original one?
11 replies
TTCTheo's Typesafe Cult
Created by zendev on 8/23/2023 in #questions
Alternative to Clerk for cross-platform app (Next.js / React Native + Expo)
This looks pretty sweet, would you include all the React Native/Expo stuff in the same repo when adding the mobile app?
11 replies
TTCTheo's Typesafe Cult
Created by arete on 8/15/2023 in #questions
clerk metadata
Webhooks or you can redirect to a form after sign up, depends on how you want to handle it
12 replies