Abuzeid
Abuzeid
TTCTheo's Typesafe Cult
Created by Circus on 3/19/2024 in #questions
Migrating away from Planetscale (expiring hobby plan)
I guess I was not clear enough. I was trying to answer the first question about migrating off PlanetScale. As for Railway It is up to you and your needs. The Approach pulling your data from PlanetScale db and storing it in a json files in your local machine. Then using primsa to connect to a new one -any db that that support Prisma- seeding -populating- from the Json files.
12 replies
TTCTheo's Typesafe Cult
Created by Circus on 3/19/2024 in #questions
Migrating away from Planetscale (expiring hobby plan)
If you are using Prisma or any ORM; You can easily export your data to a json file; Then upload it to any db provider of your choosing; in my case it was neon Pulling Script
await prisma.*model.findMany().then(async (val) => {
await Bun.write("*./file.json", JSON.stringify(val));
});
await prisma.*model.findMany().then(async (val) => {
await Bun.write("*./file.json", JSON.stringify(val));
});
Seeding Script example
await prisma.*model.createMany({ data: *importedFromJsonFile, skipDuplicates: true });
await prisma.*model.createMany({ data: *importedFromJsonFile, skipDuplicates: true });
In case you ran the seeding script multiple times.
skipDuplicates: true
skipDuplicates: true
12 replies
TTCTheo's Typesafe Cult
Created by Tessa on 3/20/2024 in #questions
Data transfer from Prisma to Spreadsheet
If you are using Prisma you can easily export your data to a JSON or CSV. Here is how I did it with bun and JSON;
await prisma.*model.findMany().then(async (val) => {
await Bun.write("*./file.json", JSON.stringify(val));
});
await prisma.*model.findMany().then(async (val) => {
await Bun.write("*./file.json", JSON.stringify(val));
});
4 replies
TTCTheo's Typesafe Cult
Created by hassanshan on 4/25/2023 in #questions
Should create-t3-app change its boiler plate based on the new nextjs 13 update?
I guess it will change when the app Dir become stable, Theo discuss it in more details here https://www.youtube.com/watch?v=hgglCqAXHuE
3 replies
TTCTheo's Typesafe Cult
Created by sagar4915 on 4/24/2023 in #questions
"trpc failed on posts.getAll" - unsure what is broken and how to debug it?
According to the code, it's either the author or author.username is undefined, console.log(author) to find which one Also check Theo implementation https://github.com/t3dotgg/chirp/blob/main/src/server/api/routers/posts.ts
5 replies
TTCTheo's Typesafe Cult
Created by sagar4915 on 4/24/2023 in #questions
"trpc failed on posts.getAll" - unsure what is broken and how to debug it?
can you share the code?
5 replies
TTCTheo's Typesafe Cult
Created by cje on 4/8/2023 in #questions
how do you get the query string in next app dir api routes?
7 replies
TTCTheo's Typesafe Cult
Created by GXLDEN on 4/8/2023 in #questions
Seeding with prisma
hover over the variables to check their types and see if they match
5 replies
TTCTheo's Typesafe Cult
Created by GXLDEN on 4/8/2023 in #questions
Seeding with prisma
The problem is most likely the price being type number instead of float by default.
5 replies
TTCTheo's Typesafe Cult
Created by Ayato on 4/5/2023 in #questions
findUnique from current user
you can use delete it only deletes one, is the deposit id unique?
11 replies
TTCTheo's Typesafe Cult
Created by Perchant on 3/27/2023 in #questions
Browser suggestion
don't know, I haven't used firefox for while.
17 replies
TTCTheo's Typesafe Cult
Created by Perchant on 3/27/2023 in #questions
Browser suggestion
It works well for chrome, I thought it would be the same for firefox.
17 replies
TTCTheo's Typesafe Cult
Created by Eylon on 3/27/2023 in #questions
deploying to vercel - typeerrors
I think it would be better practice to solve all the warnings first, then double check the types
13 replies
TTCTheo's Typesafe Cult
Created by Perchant on 3/27/2023 in #questions
Browser suggestion
Most of the browser have tab groups, you can also change the settings to continue where you left on start up.
17 replies
TTCTheo's Typesafe Cult
Created by kdiffin on 3/12/2023 in #questions
how to get the same effect as browser zoom/unzoom in css natively
Basically you need the size of elements to scale with the screen. For that you must avoid using constant units as much as possible. For images as an example, give them width in % and height auto, control them through aspect-ratio and object-fit for fonts make use of clamp()
5 replies
TTCTheo's Typesafe Cult
Created by JessesBeetShoppe on 3/12/2023 in #questions
Disable Refetch on Focus in TRPC
example
trpc.pokemonPair.useQuery(undefined, {
refetchInterval: false,
refetchOnReconnect: false,
refetchOnWindowFocus: false,
});
trpc.pokemonPair.useQuery(undefined, {
refetchInterval: false,
refetchOnReconnect: false,
refetchOnWindowFocus: false,
});
12 replies
TTCTheo's Typesafe Cult
Created by JessesBeetShoppe on 3/12/2023 in #questions
Disable Refetch on Focus in TRPC
12 replies
TTCTheo's Typesafe Cult
Created by JessesBeetShoppe on 3/12/2023 in #questions
Disable Refetch on Focus in TRPC
You can adjust the refetch behavior through useQuery options
12 replies