Skip to content

Add base database manager#89

Merged
javidahmed64592 merged 5 commits into
mainfrom
add-base-database-manager
May 5, 2026
Merged

Add base database manager#89
javidahmed64592 merged 5 commits into
mainfrom
add-base-database-manager

Conversation

@javidahmed64592
Copy link
Copy Markdown
Owner

This pull request introduces a foundational database layer to the project using SQLModel, adds configuration support for database settings, and provides comprehensive unit tests for the new functionality. The most important changes are grouped below:

Database Layer Implementation:

  • Added sqlmodel as a project dependency in pyproject.toml to enable SQLModel-based database operations.
  • Introduced BaseDatabaseManager as an abstract base class for database management, initializing the SQLModel engine and handling database URL configuration.
  • Added a module docstring for python_template_server/db/__init__.py.

Configuration Enhancements:

  • Added DatabaseConfig model to encapsulate database directory and URL construction logic, and integrated it into the main TemplateServerConfig as a new db field. [1] [2]

Testing Infrastructure:

  • Added fixtures in tests/conftest.py for mocking database configuration and temporary database paths, ensuring isolated and reliable tests. [1] [2] [3] [4] [5]
  • Created tests/db/test_base_database_manager.py with unit tests for the database manager, including initialization and URL property checks.
  • Extended tests/test_models.py with unit tests for the new DatabaseConfig and its integration into TemplateServerConfig. [1] [2] [3] [4]

Test Suite Maintenance:

  • Minor test fixture adjustments in tests/test_template_server.py for improved type consistency. [1] [2]

@javidahmed64592 javidahmed64592 merged commit ba0f229 into main May 5, 2026
16 checks passed
@javidahmed64592 javidahmed64592 deleted the add-base-database-manager branch May 5, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant