Skip to content

0.7.0 — 2025-02-01

← 0.7.1 | 0.6.1 → | ↑ 0.x series

Features

  • SQLAlchemy Integration: Complete ORM implementation:
    • Robust entity model system
    • Transaction management with ACID compliance
    • Connection pooling with configurable settings
    • Comprehensive database operations support

Usage Example

from archipy.adapters.postgres.sqlalchemy.adapters import SQLAlchemyAdapter
from archipy.models.entities.sqlalchemy.base_entities import BaseEntity
from sqlalchemy import Column, String


# Define a model
class User(BaseEntity):
    __tablename__ = "users"
    name = Column(String(100))
    email = Column(String(100), unique=True)


# Use the ORM
orm = SQLAlchemyAdapter()
with orm.session() as session:
    # Create and read operations
    new_user = User(name="John Doe", email="john@example.com")
    session.add(new_user)
    session.commit()

    user = session.query(User).filter_by(email="john@example.com").first()