Live data from Hacker News

Show HN: Prisma Python – A fully typed ORM for Python

github.com

51–60 of 91 posts

Re: Show HN: Prisma Python – A fully typed ORM for Python

#51
post #48

Earlier quoted context omitted.

Yes it is similar to SQLModel however as SQLModel is based off of SQLAlchemy, the query API is not typed. That is the difference.

My understanding is that this is exactly what SQLModel adds on top of SQLAlchemy. statement = select(Hero).where(Hero.age > 32).limit(3) But I am only halfway through the tutorial so I might be wrong. HN discussion of SQLModel here [1] [1] https://news.ycombinator.com/item?id=28294534

My understanding of SQLModel is that it brings the benefits of both Pydantic and SQLAlchemy. The benefit of merging Pydantic with SQLAlchemy is that you can then use the database models directly in FastAPI route definitions.

Re: Show HN: Prisma Python – A fully typed ORM for Python

#53

Is it just me who thinks that plain SQL has won the SQL vs ORM battle? I mean why should I learn how to use X different ORM syntaxes in Y different languages and in addition to that lose full control over the actual query.

Use whatever works for you! I personally felt the same until I learned of Prisma. The main benefits for me are type checking and autocomplete.

Autocomplete is the big one as it lessens the learning curve immensely. You no longer have to search through documentation to find a relevant method, you simply have to trigger autocomplete and it'll show you what you can do!

Re: Show HN: Prisma Python – A fully typed ORM for Python

#54

Earlier quoted context omitted.

Yes it is similar to SQLModel however as SQLModel is based off of SQLAlchemy, the query API is not typed. That is the difference.

AFAIK SQLAlchemy 2.0 (coming soon?) will use a new system for full typing.

Yes I had heard about that but due to the nature of Python typing, they can't actually type the query API properly without falling back to Any, negating the benefits of type checking.

Re: Show HN: Prisma Python – A fully typed ORM for Python

#55
post #22

Seems to solve the same problem as SQLModel. From [1]: "SQLModel is a library for interacting with SQL databases from Python code, with Python objects. It is designed to be intuitive, easy to use, highly compatible, and robust. SQLModel is based on Python type annotations, and powered by Pydantic and SQLAlchemy." [1] https://sqlmodel.tiangolo.com/

Yes it is similar to SQLModel however as SQLModel is based off of SQLAlchemy, the query API is not typed. That is the difference.

The creator of sqlmodel seems to be very busy with fastapi and other projects. Only so much you can do in a day, so progress is slowed down by that.

Prisma looks nice. Is it a solo project mostly? Or is there a company paying for your time to spend on this ORM? To me it is very important that such an important module as an ORM will have support for the lifetime of an application. Or at least when the app is still being developed.

Re: Show HN: Prisma Python – A fully typed ORM for Python

#56

Earlier quoted context omitted.

Yes it is similar to SQLModel however as SQLModel is based off of SQLAlchemy, the query API is not typed. That is the difference.

The creator of sqlmodel seems to be very busy with fastapi and other projects. Only so much you can do in a day, so progress is slowed down by that. Prisma looks nice. Is it a solo project mostly? Or is there a company paying for your time to spend on this ORM? To me it is very important that such an important module as an ORM will have support for the lifetime of an application. Or at least when the app is still bei…

Unfortunately this is a solo project, however I am in communication with the Prisma team and the core engine that Prisma Python uses is backed by Prisma.

Re: Show HN: Prisma Python – A fully typed ORM for Python

#57

Is it just me who thinks that plain SQL has won the SQL vs ORM battle? I mean why should I learn how to use X different ORM syntaxes in Y different languages and in addition to that lose full control over the actual query.

That's how I've personally felt since I first encountered ORMs a decade ago at a data intensive startup where ORMs were a burden. Yet I keep running into ORMs.

Luckily, they are better implemented at my current job. I still think it gets in the way quite often, but I recognize that it enables some outsized returns on effort. Entire REST APIs can be generated with things like Spring Data. SqlAlchemy can be pretty slick in Python.

I still write raw SQL on my personal projects, but I recognize that I have to spend a lot of time doing that.

Re: Show HN: Prisma Python – A fully typed ORM for Python

#58

Is it just me who thinks that plain SQL has won the SQL vs ORM battle? I mean why should I learn how to use X different ORM syntaxes in Y different languages and in addition to that lose full control over the actual query.

Big fan of queries being written in SQL and yielding pure, properly structured business objects.

An example of this approach is PureORM[0]

[0]https://github.com/craigmichaelmartin/pure-orm

Re: Show HN: Prisma Python – A fully typed ORM for Python

#59
post #13

Nowhere is the acronym ORM explained, let alone how it can benefit Python programmers.

Presumably a lot of Python-developers already know what an ORM is and how they can benefit from it, in particular given how long SQLAlchemy has been around. The rest can presumably hit up their favourite search engine and type in 'ORM', hit 'Search' and learn quite quickly what it is.

[deleted]

Re: Show HN: Prisma Python – A fully typed ORM for Python

#60

Nowhere is the acronym ORM explained, let alone how it can benefit Python programmers.

ORM stands for Object Relational Mapper and is essentially a wrapper over raw SQL queries to provide an easier to use interface.

Thank you. I heard of ORM, My comment was mostly to enhance the readme.
Post reply on HN