Javascript / Typescript ORMs like Drizzle or Prisma

Guys sorry i know this is a very beginner question. I've been mostly a backend developer most of my life and just started getting into development with Vue. Are ORM based on javascript/Typescript meant for the back end front end or both?
If its meant for front end i have a bad feeling. I mean a front end app sending sql queries directly to a database just doesn't seem that secure and seems very likely to be abused. Where would you store connection info for the database? In javascript sent to the browser? Maybe if its meant if your running backend javascript (either node or SSR with whatever framework).
5 Replies
Josh
Josh2y ago
No, the client never directly interacts with the db I.e orms are ALWAYS backend A lot of people are using more and more full stack frameworks where the lines get blurred in the codebase, but all orms and such are backend Like when you see Prisma calls in a react component, that's not actually running on the client, it's using what's called a server component So yes, they are all meant for server side typescript
ncage
ncage2y ago
oh so Next (& probabaly Nuxt) are have back end parts that are running (APIs)
Josh
Josh2y ago
Very large backend parts, that's the reason they exist; unify the backend with the front end The traditional API layer is extremely blurred with a lot of the new frameworks Like you straight up don't have to define endpoints for most things anymore This is not a criticism, but you have a fundamental misunderstanding of what's going on with these frameworks and orms and such, and that's fine. I highly recommend going and doing research on what these frameworks are, why they are here, what problems they solve, and how they work
ncage
ncage2y ago
Thanks @Josh for the clarification. This has been extremly helpful.
Josh
Josh2y ago
Absolutely
Want results from more Discord servers?
Add your server