SeaQL / SeaQL/sea-orm

Python bindings for SeaORM

Open
#2,736 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
9.9k
Forks
734
Avg merge
6h 36m
Merged PRs (30d)
8

Description

Wanted to know your thoughts on python bindings for SeaORM — Pydantic/SQLModel-friendly API as a replacement for sqlalchemy + sqlmodel + alembic(for migrations) combo

Motivation

SeaORM is an excellent ORM solution in the Rust ecosystem, offering strong type safety, async-first design, and performance benefits. However, adoption is currently limited to Rust projects.

The Python ecosystem, particularly in data and web development, heavily relies on SQLAlchemy as the de facto ORM. While SQLAlchemy is powerful, it comes with complexity, performance tradeoffs, and sometimes less ergonomic type handling compared to what SeaORM provides.

There is growing interest in Python projects that are more strongly typed and async-friendly. Frameworks like SQLModel (built on top of SQLAlchemy) and Pydantic have gained significant traction for their developer experience, type validation, and integration with async web frameworks like FastAPI.

By providing Python bindings to SeaORM that integrate smoothly with SQLModel/Pydantic, SeaORM could:

  • Offer Python developers a modern, performant alternative to SQLAlchemy.
  • Tap into the large Python data science and web development ecosystem.
  • Expand SeaORM’s adoption and visibility beyond the Rust ecosystem.

Proposed Solutions

  1. Python bindings for SeaORM core
  • Expose SeaORM’s core ORM functionality via a Python extension (e.g., using PyO3 or similar).
  • Provide async-compatible APIs to match Python’s asyncio ecosystem.
  1. Integration with SQLModel/Pydantic
  • Allow models to be defined using SQLModel or Pydantic schemas.
  • Enable seamless mapping between Pydantic models and SeaORM entities.
  • Ensure type validation, serialization, and query building follow Python conventions.
  1. Developer Experience
  • Provide migrations and query APIs idiomatic to Python.
  • Offer a familiar interface for SQLModel/Pydantic users, minimizing friction.
  • Ensure interoperability with existing FastAPI and async frameworks.

Additional Information

Potential approach: Start with exposing SeaORM as a Python package using PyO3, then build an integration layer with SQLModel/Pydantic.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by reviewing SeaORM's core architecture and the proposed PyO3 approach, then determine the scope of Python, SQLModel/Pydantic, async, and migration support. Done would require an agreed design and implementation boundary rather than a single isolated change.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust, sqlalchemy
Domain
api, backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.