db

SQLAlchemy ORM models for tix entities.

This module defines the database schema and domain logic for Story and Task entities. The ORM models serve dual purpose: database persistence and runtime domain objects with file I/O capabilities.

class shai_tix.db.Base(**kwargs: Any)[source]
metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

See also

orm_declarative_metadata

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

class shai_tix.db.StoryOrTask(**kwargs: Any)[source]

Abstract base class for Story and Task ORM models.

Provides common fields (id, date, title, path) and file I/O methods for metadata, description, and report files.

Parameters:
  • id – Primary key, the global ID

  • date – Creation date in YYYY-MM-DD format

  • title – Sanitized title from folder name

  • path – Absolute filesystem path to the entity directory

property dir_root: Path

Get the filesystem directory for this entity as a Path object.

property file_metadata: dict[str, Any]

Read metadata from metadata.json file.

class shai_tix.db.Story(**kwargs)[source]

SQLAlchemy ORM model for Story entities.

Parameters:
  • id – Primary key, the global story ID

  • date – Creation date in YYYY-MM-DD format

  • title – Sanitized title from folder name

date: orm.Mapped[str]
id: orm.Mapped[int]
path: orm.Mapped[str]
title: orm.Mapped[str]
class shai_tix.db.Task(**kwargs)[source]

SQLAlchemy ORM model for Task entities.

Parameters:
  • id – Primary key, the global task ID

  • story_id – Foreign key to parent story

  • date – Creation date in YYYY-MM-DD format

  • title – Sanitized title from folder name

date: orm.Mapped[str]
id: orm.Mapped[int]
path: orm.Mapped[str]
title: orm.Mapped[str]