redtortellini
redtortellini
Explore posts from servers
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
gave it a shot and it did not result in any changes. i enabled server actions, declared "use server" in the file and it still claimed i was trying to get server side env variables in client, which also didnt work when i switched back to process.env. when using prisma, it was for sure using server side calls, but other than that, i cant get server side to work anywhere in my project. i tried changing to 13.1 and 13.4 as well. theres gotta be something im missing btu ive been stuck on this for multiple days and i find it hard to believe im the only one with an issue like this but cant find anything else about it online
28 replies
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
the more i look into it, the more im realizing this is a problem with my project. im using next 13.2.1. something im noticing is that it feels like everything is client side. using the chirp app that Theo made as an example, mine similarly does not call "use client" on any of the components, which is making me think that i should try to declare this db connection as a server component but idk how. the only thing that comes up is how next defaults to server and only views it as client when saying "use client", but this isnt my case. is it something with next 13.2.1? im not using app dir so im considering going to next 12. is that a reasonable idea?
28 replies
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
28 replies
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
as before, the schema that contains the env variables is in src/server/db/schema.ts i uploaded a pic of it earlier in this thread, am i allowed to declare the db item, schema, and export the function all in that 1 file? does it flag it as client side for any reason? i even tried to take the db connection into its own file and export that but even just this file is giving same error for trying to access the env variables. will add a pic of the whole file
28 replies
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
which i guess supports the idea that im calling these variables in the wrong area
28 replies
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
28 replies
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
it feels like im calling this db connection client side, but according to documentation and intent, i was trying to get it to run server side
28 replies
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
28 replies
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
does "getServerSideProps()" fix anything in this case?
28 replies
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
i tried to even take some inspiration from other people who created example applications for this, but all seem to never run into this issue with env variables
28 replies
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
28 replies
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
28 replies
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
it jsut occured to me after all this time that im using planetscale mysql which is stated as "worlds most advanced serverless mysql platform". this sounds like it may be an issue. i wasnt exactly sure if i could connect thru a different means so i will try mysql2 and see
28 replies
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
in all the documentation it all seems like drizzle runs server side and not once does it mention needing to do next_public so im confused on where i went wrong. i already wiped my changes and tried to follow the startup guide on drizzle github again and its the same outcome. my db calls are only being called client side
28 replies
TTCTheo's Typesafe Cult
Created by redtortellini on 6/1/2023 in #questions
Drizzle client side vs server side?
ideally i would like it to be on the server, but when using the db connection with envinronment variables, it only works when using NEXT_PUBLIC in front of the env variables, thus exposing it to browser and allowing the call to go through. i have tried to run it on the server by using "use server" or placing it in the server folder but it still wont pick up the env variables.
28 replies