How to fetch data from the database with RSC?
Unanswered
Flat-Coated Retriever posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/3.png)
Flat-Coated RetrieverOP
I am new to RSC and the app router, I am looking for some docs on how to use TypeORM and fetch data from a vercel Postgres DB using the app router / React Server Components. Do I still use an API route for this?
2 Replies
![Avatar](https://cdn.discordapp.com/avatars/678259999201427466/1936f7e8963ff0f800f5eb4b43bc833c.webp?size=256)
Clown
You can directly use mutation actions with ORMs using server actions.
That aside i found an issue on GitHub where developers criticized how TypeORM was straying from supporting NextJS:
https://github.com/typeorm/typeorm/issues/8870
Do note that the issue is 2 years old however has comments as early as 5 days ago from the time of writing this message. Take it with pinch of salt and maybe try it yourself to see if it works or not.
That aside i found an issue on GitHub where developers criticized how TypeORM was straying from supporting NextJS:
https://github.com/typeorm/typeorm/issues/8870
Do note that the issue is 2 years old however has comments as early as 5 days ago from the time of writing this message. Take it with pinch of salt and maybe try it yourself to see if it works or not.
You can try the docs of server actions on the nextjs doc site or also api routes, but i would personally recommend switching to either Drizzle (its more similar) or to Prisma. Both work quite well with nextjs