Live data from Hacker News

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

github.com

11–20 of 91 posts

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

#12
post #10

This looks promising. Using prisma both in TypeScript app backends and in Python data pipelines would make switching between the two without much cognitive overhead much easier. I'll probably oppose introducing a different Python ORM at work until Prisma Python reaches 1.0

Thanks :)

Yeah that is understandable, it is being successfully used in production but it is safer to use a more stable ORM for mission critical products.

If you don't want to have to duplicate your model definitions you could write a custom Prisma Generator to generate models for a different Python ORM.

https://prisma-client-py.readthedocs.io/en/stable/reference/...

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

#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.

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

#14
> by auto-generating python types

I'm assuming you are using a code generator? My understanding is that as MyPy is a static analyser there is no way to automatically create types at runtime (which is actually super annoying, particularly for a language as dynamic as Python).

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

#15

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.

To add to this answer, an ORM is useful to deploy queries across multiple database vendors (e.g. Oracle, Postgres, SQLite) without re-writing queries. When used correctly it sanitizes SQL as well as supports with typing, as this library assist with.

Though to add to another comment, this is pretty basic in the CRUD and front-end world, and learning how to learn when confronted with unfamiliar information is a very useful life skill.

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

#16
> Prisma, a next-generation ORM for TypeScript which means that the core query building and connection handling has been battle tested, getting around a potential concern with adopting a new ORM.

Can I suggest you put this at the top of your README.md file, as I had never heard of Prisma before and it would have helped.

> Prisma Python

Is your program called Prisma Python or Prisma Client Python? You seem to be inconsistent with naming.

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

#17

> Prisma, a next-generation ORM for TypeScript which means that the core query building and connection handling has been battle tested, getting around a potential concern with adopting a new ORM. Can I suggest you put this at the top of your README.md file, as I had never heard of Prisma before and it would have helped. > Prisma Python Is your program called Prisma Python or Prisma Client Python? You seem to be incon…

Thanks for the feedback, I will add that.

> Prisma Python

I originally decided to go with Prisma Client Python however I found this to be too verbose and have recently used Prisma Python. I do need to decide on one and stick with that. Thanks for pointing that out

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

#19

> by auto-generating python types I'm assuming you are using a code generator? My understanding is that as MyPy is a static analyser there is no way to automatically create types at runtime (which is actually super annoying, particularly for a language as dynamic as Python).

You are correct, we use code generation to define the query API types.

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

#20

fully typed? it used dicts for queryinb - should maybe look at sqlalchemy for comparison

Yes it is fully typed because of TypedDicts, https://docs.python.org/3/library/typing.html#typing.TypedDi...

SQLAlchemy on the other hand provides very little (if any) type hints for their query API.

Post reply on HN