Skip to content

Conversation

@Naveencodespeaks
Copy link

✨ Feature: ORM Support for SQL Data Nodes using SQLAlchemy

This PR adds ORM support for SQL Data Nodes using SQLAlchemy — enabling ORM-style CRUD operations and seamless integration with Taipy’s data layer.


🧩 Highlights

🧱 ORMSessionManager

  • Manages SQLAlchemy engine, sessions, and commits

  • Uses expire_on_commit=False to prevent DetachedInstanceError

🧠 SQLAlchemyTableDataNode

  • Full CRUD support (create, read, update, delete)

  • Integrates with DataNode protocol (read / write)

  • Returns detached model instances safe for use post-session

🧪 Unit Tests

  • Verified on SQLite with SQLAlchemy ORM

  • ✅ 100% CRUD coverage, clean teardown


🧩 Dependencies

Dependency | Version -- | -- 🐍 Python | 3.11.7 🧱 SQLAlchemy | 2.0.35 🧠 Taipy Core | Local dev version 🧪 pytest | 8.3.3 🧰 marshmallow | 3.26.1

👤 Contributor

@Naveencodespeaks
Python Developer | Backend Engineer | Taipy Contributor

✨ Feature: ORM Support for SQL Data Nodes using SQLAlchemy

This PR adds ORM support for SQL Data Nodes using SQLAlchemy — enabling ORM-style CRUD operations and seamless integration with Taipy’s data layer.

🧩 Highlights

🧱 ORMSessionManager

Manages SQLAlchemy engine, sessions, and commits

Uses expire_on_commit=False to prevent DetachedInstanceError

🧠 SQLAlchemyTableDataNode

Full CRUD support (create, read, update, delete)

Integrates with DataNode protocol (read / write)

Returns detached model instances safe for use post-session

🧪 Unit Tests

Verified on SQLite with SQLAlchemy ORM

✅ 100% CRUD coverage, clean teardown

🧩 Dependencies
Dependency Version
🐍 Python 3.11.7
🧱 SQLAlchemy 2.0.35
🧠 Taipy Core Local dev version
🧪 pytest 8.3.3
🧰 marshmallow 3.26.1
✅ Tests
pytest tests/core/data/test_sql_table_data_node_orm.py -q
... [100%]
3 passed, 2 warnings in 0.39s

⚠️ Warnings due to Marshmallow v4 deprecation (not ORM-related).

🧾 Related Tickets

Related Issue: #2745 - ORM Support for SQL Data Nodes

Closes: #2745

⚙️ Reproduction
initialize_and_test_datanode:
description: "Example usage of SQLAlchemyTableDataNode."
code: |
from taipy.core.data.sql_table_data_node_orm import SQLAlchemyTableDataNode

node = SQLAlchemyTableDataNode(
    "user_node", User, "sqlite:///test.db", primary_keys=["id"]
)

node.create({"name": "Alice"})
node.read_all()
node.update({"name": "Alice"}, {"name": "Alicia"})
node.delete({"name": "Alicia"})

🔄 Backport
backporting:
targets:
- develop

☑️ Checklist
Status Description
✅ Meets acceptance criteria
🧪 Includes CRUD unit tests
🔄 E2E tests planned post-pipeline integration
📚 Docs update planned next PR
📌 Release notes entry confirmed
👤 Contributor

@Naveencodespeaks

Python Developer | Backend Engineer | Taipy Contributor

@JPluess
Copy link

JPluess commented Oct 22, 2025

hey thank you so much for your commit, we would need someone from the taipy maintainer to review the code, and complete the merger

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

This PR has been labelled as "🥶Waiting for contributor" because it has been inactive for more than 14 days. If you would like to continue working on this PR, then please add new commit or another comment, otherwise this PR will be closed in 14 days. For more information please refer to the contributing guidelines.

@github-actions github-actions bot added the 🥶Waiting for contributor Issues or PRs waiting for a long time label Nov 6, 2025
@arcanaxion arcanaxion removed the 🥶Waiting for contributor Issues or PRs waiting for a long time label Nov 7, 2025
@github-actions
Copy link
Contributor

This PR has been labelled as "🥶Waiting for contributor" because it has been inactive for more than 14 days. If you would like to continue working on this PR, then please add new commit or another comment, otherwise this PR will be closed in 14 days. For more information please refer to the contributing guidelines.

@github-actions github-actions bot added the 🥶Waiting for contributor Issues or PRs waiting for a long time label Nov 21, 2025
@JPluess
Copy link

JPluess commented Nov 21, 2025

hey thank you so much for your commit, we would need someone from the taipy maintainer to review the code, and complete the merger

@github-actions github-actions bot removed the 🥶Waiting for contributor Issues or PRs waiting for a long time label Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[✨ FEATURE] ORM Support for SQL Data Nodes

4 participants