Live data from Hacker News

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

github.com

1–10 of 91 posts

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

#1
I created this ORM to fill a gap in the Python ecosystem. Due to the nature of typing in Python there are no other Python ORMs that can provide correct type hints. Prisma Python manages to work around this by auto-generating python types.

Aside from static type checking, providing type hints means that you will get autocomplete suggestions for you which for me is the killer feature for this ORM (see the GIF in the README for an example).

It's also built on top of 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.

Prisma Python also supports PostgreSQL, SQLite, MongoDB, MariaDB and more!

Show HN: Prisma Python – A fully typed ORM for Python
github.com

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

#6
post #5

This looks really cool. I might have to try it for my current project. Question: The Readme says there's room for massive improvement in performance. What's the performance like right now? Any benchmarks?

I haven't written benchmarks yet but it is something I am working on. The reason that performance is mentioned in the README is that I haven't spent time on improving it yet.

The biggest blockers in terms of performance are:

- Communication with the internal Rust engine is performed over HTTP instead of FFI.

- You cannot select a subset of fields (every scalar field in a model is selected)

- You cannot skip pydantic validation which while fast is unnecessary in some cases

With that said Prisma Python should be reasonably fast but I would expect it to be on the lower end of the spectrum compared to other Python ORMs. I have ran some load tests locally and creating 500,000 records took about 90 seconds.

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

#7
post #5

This looks really cool. I might have to try it for my current project. Question: The Readme says there's room for massive improvement in performance. What's the performance like right now? Any benchmarks?

I haven't written benchmarks yet but it is something I am working on. The reason that performance is mentioned in the README is that I haven't spent time on improving it yet. The biggest blockers in terms of performance are: - Communication with the internal Rust engine is performed over HTTP instead of FFI. - You cannot select a subset of fields (every scalar field in a model is selected) - You cannot skip pydantic…

What is the Rust engine doing here?

How come GitHub doesn't highlight any Rust code in the project repo?

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

#8

Earlier quoted context omitted.

I haven't written benchmarks yet but it is something I am working on. The reason that performance is mentioned in the README is that I haven't spent time on improving it yet. The biggest blockers in terms of performance are: - Communication with the internal Rust engine is performed over HTTP instead of FFI. - You cannot select a subset of fields (every scalar field in a model is selected) - You cannot skip pydantic…

What is the Rust engine doing here? How come GitHub doesn't highlight any Rust code in the project repo?

Because Prisma Python currently interfaces with the Rust engine over HTTP (I am looking into changing this) and the Rust engines can be found here:

https://github.com/prisma/prisma-engines

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

#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

Post reply on HN