markitect-main/markitect/database.py

12 lines
357 B
Python
Raw Permalink Normal View History

feat: Implement Issue #1 - Database initialization and front matter parsing Complete TDD implementation of core MarkiTect functionality: **Database Module (markitect/database.py):** - DatabaseManager class with SQLite database initialization - markdown_files table with proper schema (id, filename, front_matter, content, created_at) - Front matter storage as JSON with content separation - File storage, retrieval, and listing methods - Comprehensive error handling **Front Matter Module (markitect/frontmatter.py):** - FrontMatterParser class with YAML front matter parsing - Clean separation of metadata from markdown content - Graceful handling of invalid YAML and missing front matter - Regex-based parsing with proper delimiter handling **Dependencies:** - Added PyYAML for front matter parsing - Updated pyproject.toml with new dependency **Test Coverage:** - 9 comprehensive tests covering all functionality - Database initialization and schema validation - Front matter parsing with Issue #1 example content - Integrated workflow testing (storage/retrieval) - Error handling for edge cases **TDD Process:** - RED phase: 8 failing tests defining requirements - GREEN phase: Minimal implementation making all tests pass - Validation: Complete workflow verified with example content This implementation provides the foundation for all subsequent MarkiTect features, handling the exact example from Issue #1 specification. Issue #1: Initialize Database and Store Example Markdown File https://gitea.coulomb.social/coulomb/markitect_project/issues/1 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 04:28:29 +02:00
"""
Database management - Backward Compatibility Module.
feat: Implement Issue #1 - Database initialization and front matter parsing Complete TDD implementation of core MarkiTect functionality: **Database Module (markitect/database.py):** - DatabaseManager class with SQLite database initialization - markdown_files table with proper schema (id, filename, front_matter, content, created_at) - Front matter storage as JSON with content separation - File storage, retrieval, and listing methods - Comprehensive error handling **Front Matter Module (markitect/frontmatter.py):** - FrontMatterParser class with YAML front matter parsing - Clean separation of metadata from markdown content - Graceful handling of invalid YAML and missing front matter - Regex-based parsing with proper delimiter handling **Dependencies:** - Added PyYAML for front matter parsing - Updated pyproject.toml with new dependency **Test Coverage:** - 9 comprehensive tests covering all functionality - Database initialization and schema validation - Front matter parsing with Issue #1 example content - Integrated workflow testing (storage/retrieval) - Error handling for edge cases **TDD Process:** - RED phase: 8 failing tests defining requirements - GREEN phase: Minimal implementation making all tests pass - Validation: Complete workflow verified with example content This implementation provides the foundation for all subsequent MarkiTect features, handling the exact example from Issue #1 specification. Issue #1: Initialize Database and Store Example Markdown File https://gitea.coulomb.social/coulomb/markitect_project/issues/1 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 04:28:29 +02:00
This module re-exports from markitect.storage.database for backward compatibility.
New code should import from markitect.storage.database directly.
feat: Implement Issue #1 - Database initialization and front matter parsing Complete TDD implementation of core MarkiTect functionality: **Database Module (markitect/database.py):** - DatabaseManager class with SQLite database initialization - markdown_files table with proper schema (id, filename, front_matter, content, created_at) - Front matter storage as JSON with content separation - File storage, retrieval, and listing methods - Comprehensive error handling **Front Matter Module (markitect/frontmatter.py):** - FrontMatterParser class with YAML front matter parsing - Clean separation of metadata from markdown content - Graceful handling of invalid YAML and missing front matter - Regex-based parsing with proper delimiter handling **Dependencies:** - Added PyYAML for front matter parsing - Updated pyproject.toml with new dependency **Test Coverage:** - 9 comprehensive tests covering all functionality - Database initialization and schema validation - Front matter parsing with Issue #1 example content - Integrated workflow testing (storage/retrieval) - Error handling for edge cases **TDD Process:** - RED phase: 8 failing tests defining requirements - GREEN phase: Minimal implementation making all tests pass - Validation: Complete workflow verified with example content This implementation provides the foundation for all subsequent MarkiTect features, handling the exact example from Issue #1 specification. Issue #1: Initialize Database and Store Example Markdown File https://gitea.coulomb.social/coulomb/markitect_project/issues/1 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 04:28:29 +02:00
"""
# Re-export from storage package for backward compatibility
from markitect.storage.database import DatabaseManager
feat: Implement Issue #1 - Database initialization and front matter parsing Complete TDD implementation of core MarkiTect functionality: **Database Module (markitect/database.py):** - DatabaseManager class with SQLite database initialization - markdown_files table with proper schema (id, filename, front_matter, content, created_at) - Front matter storage as JSON with content separation - File storage, retrieval, and listing methods - Comprehensive error handling **Front Matter Module (markitect/frontmatter.py):** - FrontMatterParser class with YAML front matter parsing - Clean separation of metadata from markdown content - Graceful handling of invalid YAML and missing front matter - Regex-based parsing with proper delimiter handling **Dependencies:** - Added PyYAML for front matter parsing - Updated pyproject.toml with new dependency **Test Coverage:** - 9 comprehensive tests covering all functionality - Database initialization and schema validation - Front matter parsing with Issue #1 example content - Integrated workflow testing (storage/retrieval) - Error handling for edge cases **TDD Process:** - RED phase: 8 failing tests defining requirements - GREEN phase: Minimal implementation making all tests pass - Validation: Complete workflow verified with example content This implementation provides the foundation for all subsequent MarkiTect features, handling the exact example from Issue #1 specification. Issue #1: Initialize Database and Store Example Markdown File https://gitea.coulomb.social/coulomb/markitect_project/issues/1 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 04:28:29 +02:00
__all__ = ['DatabaseManager']