Skip to content

Add Optional SQLAlchemy Backend for Persistent Storage #16

@Amanbig

Description

@Amanbig

Description

Currently, RunAPI uses an in-memory list-based storage as its database layer.
When SQLAlchemy is not installed, the code explicitly skips DB-related functionality.

This limits RunAPI’s usefulness for:

  • Production-like environments
  • Multi-process usage
  • Persistent storage use cases

Proposal

Introduce optional SQLAlchemy support while keeping the current in-memory fallback.

Suggested Approach

  • If sqlalchemy is installed:
    • Use SQLAlchemy models and sessions
    • Support SQLite out of the box
  • If not installed:
    • Continue using the existing in-memory list storage
  • Abstract storage behind a common interface

Benefits

  • Enables persistent storage
  • Keeps RunAPI lightweight by default
  • Allows gradual adoption without breaking changes

Expected Outcome

  • More flexible backend support
  • Better real-world usability

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions