Feature/orm support sql datanodes #2746
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✨ 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=Falseto preventDetachedInstanceError🧠 SQLAlchemyTableDataNode
Full CRUD support (
create,read,update,delete)Integrates with
DataNodeprotocol (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
👤 Contributor
@Naveencodespeaks
✨ Feature: ORM Support for SQL Data Nodes using SQLAlchemyPython Developer | Backend Engineer | Taipy Contributor
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
🧾 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
🔄 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