Open
Description
Library version 0.40.0, sqlalchemy 2.0.4
Created this model:
from sqlalchemy_utils import Ltree
class Node(Base):
__tablename__ = 'nodes'
id: Mapped[int] = mapped_column(primary_key=True)
name: Mapped[Ltree] = mapped_column(nullable=False)
As a result of running the code I have these errors:
sqlalchemy.exc.ArgumentError: Could not locate SQLAlchemy Core type for Python type <class 'sqlalchemy_utils.primitives.ltree.Ltree'> inside the 'name' attribute Mapped annotation
sqlalchemy.exc.ArgumentError: The type provided inside the 'name' attribute Mapped annotation is the SQLAlchemy type <class 'sqlalchemy_utils.types.ltree.LtreeType'>. Expected a Python type instead
How to use LTreeType and LTree types correctly with the new version of sqlalchemy? It looks like the documentation hasn't been updated yet.
Metadata
Metadata
Assignees
Labels
No labels