🌐
Medium
medium.com › dooboolab › prisma-with-python-and-fastapi-33bf25bb20c0
Prisma with Python and FastAPI. Brief experience on Prisma with Python… | by Hyo | Hyo Dev | Medium
June 19, 2022 - Other than that, we also use Prisma in our production projects like Puzz. Today, we’ve been working on few AI projects using Python and recently we were thinking about how to serve our AI apis. Firstly, we thought of using nodejs but then our AI developers should learn new language since most of them are much familiar with Python. ... We found FastAPI written in Python which serves great performance as a server programming.
🌐
Reddit
reddit.com › r/fastapi › deploy fastapi with prisma orm on vercel
r/FastAPI on Reddit: Deploy fastAPI with Prisma ORM on Vercel
September 15, 2024 -

Hello everyone. First time to the sub.

I'm a beginner developer and I've been struggling to deploy my app on Vercel which uses NextJS for front end, fastAPI for backend and Prisma + Postgres for database. The deployment failed with error:

RuntimeError: The Client hasn't been generated yet, you must run 'prisma generate' before you can use the client.

According to the Prisma docs, I did include the postinstall script in the package.json file:

{ ... "scripts" { "postinstall": "prisma generate" } ...}

Has anyone worked with this specific techstack can give me some inputs as to how to approach the problem? Since Vercel is really good for NextJS so I wanted to stick with it, but if there are more simpler and free options to host the backend then I will contemplate using.

Thank you in advance.

Top answer
1 of 4
7
You probably want to use alembic + sqlalchemy (Python ORM) for FastAPI, not Prisma (Nodejs ORM)
2 of 4
3
I have used prisma ORM in the past for a prod backend that is serving paying customers. While Prisma ORM is a RUST-based engine developed for node, you can still use it in Python using the prisma-Python client. Using SQLAlchemy ORM with alembic is a tried and tested approach to working with relational databases in FastAPI with database migrations, so you’re more likely to find a lot of resources on integrating these technologies. Both SQLAlchemy and alembic can allow you to interact with your database and control the changes to its schemas. However, configuring these technologies together can be challenging with complex steps that can increase the odds of integrations not working on the first try. In addition, you have to write your own data models in Python and won’t receive type safety support when interacting with the returned database results. Database migrations with alembic can also be painful to configure as you have to manually edit each migration file to specify how to upgrade and downgrade your schemas. Prisma ORM is an alternative modern ORM technology that can help you reduce some of these pains to help improve your development productivity with databases. It supports both relational and document-based databases and is driver agnostic. There are 3 components to Prisma ORM: Prisma Query engine that interfaces your code with the database and figures out how to run the queries Architecture Diagram: https://www.prisma.io/docs/assets/images/typical-flow-query-engine-at-runtime-73ffdee4acc20a853bbd431dc12fb64f.png Read more about the prisma engine here: https://www.prisma.io/docs/orm/more/under-the-hood/engines 2. Prisma Client that generates a fully typed client based on a prisma schema. You can generate clients in any language including go, Python, JavaScript etc. For Python you can use prisma-python https://prisma-client-py.readthedocs.io/en/stable/ 3. Prisma schema written in prisma language that declaratively defines your database schema. You define the database connection, client generator and data models in this file. It accepts any flavour of relational database (PostgreSQL, MySQL, MSSQL, etc.) and even non-relational (i.e., MongoDB) as drivers. The beauty of prisma is you can sync your prisma schema with an existing database using “prisma db pull” command or sync a database with a prisma schema with “prisma db push” or “prisma migrate dev” command Read more about prisma schema here: https://www.prisma.io/docs/orm/prisma-schema/overview There are other tools that ship with prisma engine including: 4. Prisma Migrate: Declarative data modeling & migration system. “prisma migrate dev” or “prisma migrate deploy” commands can read your prisma schema and write SQL in whatever database driver you’ve specified 5. Prisma Studio: GUI to view and edit data in your database. Simply run “prisma studio” command. Now your problem is that your prisma Python client is not being generated when deploying your FastAPI backend. What you need to do is adding a “prisma generate” command just before running the “Uvicorn start” or “python app.py” command so that your database client is generated inside your Python’s site_packages. If you have a DockerFile it’ll look like this Copy the current directory contents into the container COPY . /app/ Generate Prisma client RUN prisma generate Expose port 8000 to the outside world EXPOSE 8000 Command to run the FastAPI application ENTRYPOINT [“uvicorn”, “main:app”, “—host”, “0.0.0.0”, “—port”, “8000”]
🌐
GitHub
github.com › prisma-korea › prisma-fastapi
GitHub - prisma-korea/prisma-fastapi: Fastapi prisma template · GitHub
Fastapi prisma template. Contribute to prisma-korea/prisma-fastapi development by creating an account on GitHub.
Starred by 52 users
Forked by 5 users
Languages   Python
🌐
GitHub
github.com › JedersonLuz › fastapi-prisma
GitHub - JedersonLuz/fastapi-prisma: A template that starts up a FastAPI server that uses Prisma to store data. · GitHub
A template that starts up a FastAPI server that uses Prisma to store data. - JedersonLuz/fastapi-prisma
Author   JedersonLuz
🌐
Medium
medium.com › @bertholdsoss › fastapi-with-prisma-next-gen-orm-396f2677fd1d
Fastapi with prisma next gen orm. FastAPI is a modern, fast… | by sossa berthold | Medium
October 6, 2023 - Fastapi with prisma next gen orm FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.7+ based on standard Python type hints. It is designed to be easy to use …
🌐
AbandonTech
blog.abandontech.cloud › easy-python-web-backend-using-fastapi-postgres-and-prisma
Easy Python Web Backend Using FastAPI, Prisma, Postgres, and Docker
March 9, 2023 - Unless there are specific ... Prisma is a very handy Object-Relational Mapping framework that gives us the ability to conveniently write our database schema in a way that is easily read and maintained...
🌐
YouTube
youtube.com › code with struckchure
Prisma ORM with Python and FastAPI - YouTube
🚀 Dive into the world of Prisma ORM and revolutionize your Python development! This tutorial will explore the basics of using Prisma ORM to enhance your dat...
Published   December 20, 2023
Views   2K
🌐
YouTube
youtube.com › watch
FastAPI Prisma REST API CRUD with PostgreSQL
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
Find elsewhere
🌐
Kitemetric
kitemetric.com › blogs › streamline-your-database-interactions-with-prisma-orm
Master Prisma ORM: Next.js & FastAPI Setup | Kite Metric
Automatic Model Generation: Define your schema once—Prisma handles the rest. No manual model class creation is needed. Multi-Language Support: Seamless integration with Node.js, Next.js, Python (FastAPI, Django, Flask), and more.
🌐
Reddit
reddit.com › r/fastapi › prisma vs alembic for managing database schema and migrations
r/FastAPI on Reddit: Prisma vs Alembic for managing database schema and migrations
April 25, 2023 -

I’ve been experimenting with building a large fastapi project for a client and recently started using prisma cli for managing my database migrations.

Prisma python has bindings to the rust based cli by prisma.io and the cli has been growing rapidly in the typescript community.

Do you think this is an easier solution to adopting sqlAlchemy and alembic for managing db and migrations with fastapi?

If you need more context someone has already produced a short tutorial on prisma python.

https://lewoudar.medium.com/alternatives-to-sqlalchemy-for-your-project-prisma-case-9df8ce037578

Note: Prisma python client is a small project supported by prisma.io but Prisma cli has been around for quite a while and loved by the typescript community.

🌐
GitHub
github.com › vvatelot › fastapi_boilerplate
GitHub - vvatelot/fastapi_boilerplate: This is a simple boilerplate MVC like project to create quickly application with great components (Fastapi, Prisma, HTMX...) · GitHub
This is a boilerplate project for fastapi. It is based on the fastapi official tutorial. It aims to be a simple MVC project with a database connection. The example is a simple todo list. It uses Jinja2 as a template engine and Prisma as an ORM.
Starred by 44 users
Forked by 2 users
Languages   Python 52.4% | HTML 44.3% | CSS 1.7% | Shell 1.2% | JavaScript 0.4%
🌐
Prisma
prisma.io › home › prisma orm
What is Prisma ORM? (Overview) | Prisma Documentation
Prisma ORM is a next-generation Node.js and TypeScript ORM that provides type-safe database access, migrations, and a visual data editor.
🌐
Real Python
realpython.com › podcasts › rpp › 107
Episode #107: Type-Safe ORM With Prisma Client & Real Python at PyCon US 2022 – The Real Python Podcast
April 22, 2022 - In this course, you’ll learn the main concepts of FastAPI and how to use it to quickly create web APIs that implement best practices by default. By the end of it, you will be able to start creating production-ready web APIs. Topics: 00:00:00 – Introduction · 00:02:15 – Have you worked on other open-source projects? 00:02:59 – What is Prisma?
🌐
Reddit
reddit.com › r/python › has anybody tried using prisma in python n production?
r/Python on Reddit: Has anybody tried using Prisma in Python n production?
February 5, 2023 -

Some of you I think heard about Prisma ORM that gained a lot of popularity (or maybe more of a hype) in Javascript/Typescript world recently. I was suprised that there is Python library that allows to interact with Prisma and became curious if somebody tried using it at work projects. Does anybody here tried using it on production or at work in general?

🌐
GitHub
github.com › coji › zenn-content › blob › main › articles › creating_rest_api_with_fastapi_and_prisma.md
zenn-content/articles/creating_rest_api_with_fastapi_and_prisma.md at main · coji/zenn-content
FastAPI と Prisma を使うことで、Python で REST API を簡単に作成できます。Prisma の型安全性と FastAPI の優れたパフォーマンスにより、効率的に開発を進められます。
Author   coji
🌐
Medium
medium.com › dooboolab › prisma-with-fastapi-and-graphql-1e55a27c4ac2
Prisma with FastAPI and GraphQL. Following the previous post, we want to… | by Hyo | Hyo Dev | Medium
June 19, 2022 - Prisma with FastAPI and GraphQL Following the previous post, we want to continue working on creating graphql resolvers in the current post. Since FastAPI recommends using Strawberry for using graphql …
🌐
DEV Community
dev.to › sajjadali › why-you-should-use-prisma-orm-in-your-next-project-oah
Why You Should Use Prisma ORM in Your Next Project 🚀 - DEV Community
February 27, 2025 - ✅ Automatic Model Generation – Define your schema once, and Prisma takes care of the rest. No need to manually create model classes. ✅ Multi-Language Support – Works seamlessly with Node.js, Next.js, Python (FastAPI, Django, Flask), and more. ✅ Type Safety – Provides full TypeScript support for safer queries.
🌐
IJRASET
ijraset.com › best-journal › ai-skill-path-A-Multimodal-Generative-AI-Framework-for-Automated-Career-Path-Optimization-and-Skill-Gap-Analysis pdf
14 III March 2026 https://doi.org/10.22214/ijraset.2026.79081
Backend (FastAPI): Manages authentication via Clerk and orchestrates calls to the Llama 3.3 model on Groq. ... Data Consistency (Prisma/PostgreSQL): Ensures that all analyses are persisted and linked to the user's account for career
🌐
Medium
medium.com › @rizky.purnawan › building-a-typescript-based-rest-api-with-prisma-and-fastify-a-boilerplate-guide-d1348f95d51a
Building a Fast and Type-Safe API with TypeScript, Fastify and Prisma | by Rizky Purnawan Dwi Putra | Medium
October 16, 2024 - Building a Fast and Type-Safe API with TypeScript, Fastify and Prisma Creating a fast, efficient, and scalable API from scratch can feel like a daunting task. But don’t worry! Thanks to modern …