mrnicericee
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Nemila on 5/15/2023 in #questions
Your experience with T3 for Mobile dev
I would say, try it out 🙂
it works well imo
here's the starter repo
https://github.com/t3-oss/create-t3-turbo
3 replies
TTCTheo's Typesafe Cult
•Created by headadmiral on 5/15/2023 in #questions
Does it make sense to use tRPC without a frontend?
not necessarily, if you like the DX of trpc backend to creating the routes & procedures & testing. It makes sense to use the trpc server still. you can even just go with next, express, fastify or node
5 replies
TTCTheo's Typesafe Cult
•Created by janusqa on 5/12/2023 in #questions
Is it possible to pass a zod schema as a prop?
8 replies
TTCTheo's Typesafe Cult
•Created by l on 4/28/2023 in #questions
InfiniteQuery or Pagination
Hey luka!
with drizzle you have to write the query closer to sql. the infinite query is weirdly placed in the title because it's mostly a frontend abstraction of the backend pagination.
so, it sounds like you want to learn more about different ways to paginate data in the backend!
since it would be terrible to receive thousands of rows of data!
the one that will be the easiest to implement is
limit + offset.
pros: able to do pages, and you can do "page 1" and go to "page 200" very easily.
cons: say you are paginating 25 at a time, and you want to query row 1 million, the select has to iterate 1 million times + fetch your 25.
the one i typically use is key set. you have a column & id you agree on that you will do a
WHERE
statement on
pros: fetching the million + 25, now is a lot faster because it skipped all of the first million, and goes for the 25.
cons: can't do "page 1" to page "200", since you need the cursor/key set id
what i mentioned just now is described in great detail by slack. i recommend giving it a read, and then looking up how to do both limit + offset and key set paginations. you're most likely be fine with just a limit + offset solution 🙂
https://slack.engineering/evolving-api-pagination-at-slack/3 replies
TTCTheo's Typesafe Cult
•Created by Domcario on 3/20/2023 in #questions
avoid rendering more hooks: running trpc query based on supabase session's user
it could get reduced to that
34 replies
TTCTheo's Typesafe Cult
•Created by Domcario on 3/20/2023 in #questions
avoid rendering more hooks: running trpc query based on supabase session's user
34 replies
TTCTheo's Typesafe Cult
•Created by Domcario on 3/20/2023 in #questions
avoid rendering more hooks: running trpc query based on supabase session's user
from the docs it looks like you're trying to redo the supabase
useUser
hook?
source: https://supabase.com/docs/guides/auth/auth-helpers/nextjs
34 replies
TTCTheo's Typesafe Cult
•Created by Domcario on 3/20/2023 in #questions
avoid rendering more hooks: running trpc query based on supabase session's user
the useEffect probably is the one that's running too many times
34 replies
TTCTheo's Typesafe Cult
•Created by Domcario on 3/20/2023 in #questions
avoid rendering more hooks: running trpc query based on supabase session's user
you're also using a
useEffect
remove getUser
from the useEffect, and if you really want to, put it on a useCallBack
34 replies
TTCTheo's Typesafe Cult
•Created by Maïeul on 3/17/2023 in #questions
Auth: which solution for which situation
it is, and tbh I still recommend at least trying to build out your own auth when starting out (or want to know how auth solutions work). You learn best when things aren't working plus you get to understand authorization vs authentication
21 replies
TTCTheo's Typesafe Cult
•Created by Maïeul on 3/17/2023 in #questions
Auth: which solution for which situation
btw, if you haven't already make this into an article write it up! 🙂
21 replies
TTCTheo's Typesafe Cult
•Created by Maïeul on 3/17/2023 in #questions
Auth: which solution for which situation
This is a great summary of each solution! Love how you mentioned each pros and cons. rolling your own auth is great for getting started (as a developer and/or in a project).
IMO, i'd rather hand over auth to someone else. I can focus on what I need/want to do, and auth becomes the easiest thing to implement, plus because auth is their business, they'll either 1. already have what features you need when you need them, or 2. already working on building it out.
21 replies
TTCTheo's Typesafe Cult
•Created by feldrok on 3/15/2023 in #questions
tRPC API endpoints?
also quick note, POST probably should be a
mutation
instead of a query
, since it's mutating something on the server16 replies
TTCTheo's Typesafe Cult
•Created by feldrok on 3/15/2023 in #questions
tRPC API endpoints?
open-api trpc requires you to do an output iirc, it's also used to generate the open-api docs 🙂
16 replies
TTCTheo's Typesafe Cult
•Created by Debaucus on 3/15/2023 in #questions
Prisma Docs not working as instructed for insensitive case search. 9am and my brain hurts.
your original
has
was really close looks like18 replies
TTCTheo's Typesafe Cult
•Created by Debaucus on 3/15/2023 in #questions
Prisma Docs not working as instructed for insensitive case search. 9am and my brain hurts.
this part of the docs should help out @Debaucus
https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-scalar-lists-arrays
18 replies