RockBacon
Explore posts from serversTTCTheo's Typesafe Cult
•Created by jakeleventhal on 8/12/2023 in #questions
Anyone know how to check non-blocking migrations?
Almost like prisma migrate diff?
6 replies
TTCTheo's Typesafe Cult
•Created by francis.miko on 8/13/2023 in #questions
How Next.js 13 middleware is used as error handling?
Middleware works perfectly to check apiKeys because it runs before your api function. It wouldn't work well to catch errors because it only runs once before your api function. Where I think you have gone wrong is you think you run the api from the middleware file, like calling a function. Unfortunately that's not correct from what I see in the docs, the function prepares another http request which is sent to the api function.
On the other hand middleware on vercel is run on a completely different instance to where your api function is run.
I may be wrong, I am new to this stuff as well😀
8 replies
TTCTheo's Typesafe Cult
•Created by Xaohs on 8/14/2023 in #questions
Weird next-auth behaviour
Could cloudflare proxy be affecting it?
28 replies
TTCTheo's Typesafe Cult
•Created by ippo on 8/14/2023 in #questions
Simple SSR + Hydration with tRPC and Next.js 13
Another alternative is to use both the app and pages router at the same time. I found this repo and it was a great use to me. https://github.com/RockBacon9922/next-app-router-trpc-drizzle-planetscale-edge
5 replies
TTCTheo's Typesafe Cult
•Created by gave_one on 8/12/2023 in #questions
shadcn/ui is not really working ,it's rendering the elements but the styles are not there
css variables are set to false in components.json but seem to used in tailwind.config file. You would have to set this true and then reInstall all the components; Because as far as I am aware, when components are installed they are generated off of the components.json file. I am new too and it is pulling out my hair as https://discord.com/channels/966627436387266600/1140597617156431873
24 replies
TTCTheo's Typesafe Cult
•Created by cropsychooo on 8/13/2023 in #questions
Prisma and mySQL 'POST' method 401 Unauthorized
Connection string looks something like this: psql "postgres://username:[email protected]:5432/db".
exact same as a web address but instead of http you are using the respective db protocol
As you would know you have this in your .env file. If you change this string/add one it allows you to connect to the database.
Unlike a web address and exactly like ssh a connection string has a username and password (shown above). Exactly like in windows; Each account has different privileges, some have ones that only allow viewing some allow for full control e.g Admin. In large scale systems production would have a db account, developers would have their own account and different systems would have their own respective accounts.
2. Planetscale is just a provider for a mysql database, they don't have all the features of mysql (such as not allowing foreign keys this is due to how it scales with vitess) follow this guide to help yourself https://www.prisma.io/docs/guides/database/planetscale.
You don't have to use planetscale but you permission issues seem to be due to you database. First maybe check if your U&Password in you connection string have the correct privileges
9 replies
TTCTheo's Typesafe Cult
•Created by cropsychooo on 8/13/2023 in #questions
Prisma and mySQL 'POST' method 401 Unauthorized
Code looks ok for a quick glance. Try changing your connection string to a planet scale instance. If that works then we know it is most likely your maria instance that could be the issue.
9 replies
TTCTheo's Typesafe Cult
•Created by cropsychooo on 8/13/2023 in #questions
Prisma and mySQL 'POST' method 401 Unauthorized
I can't really tell without context of the app.
Check the database permissions. e.g Check that the connection string has admin privileges.
(once it is working/deployed in production you should reduce the privileges to least privilege)
9 replies
TTCTheo's Typesafe Cult
•Created by RockBacon on 8/1/2023 in #questions
Prevent malware upload to uploadthing/s3 bucket
Thankyou @lermatroid that is perfect.
7 replies
TTCTheo's Typesafe Cult
•Created by RockBacon on 6/25/2023 in #questions
How would you check if a user is signed in for multiple endpoints.
Thanks @nyx (Rustular DevRel) !
5 replies