fix: Resolve Python 3.12 SQLite datetime adapter deprecation warnings
Fixed the massive number of deprecation warnings generated during test runs by updating datetime handling in SQLite operations to use ISO format strings instead of raw datetime objects. ## Problem - Tests were generating 63+ deprecation warnings per run - Python 3.12 deprecated the default datetime adapter for SQLite - Warning: "The default datetime adapter is deprecated as of Python 3.12" ## Solution - Convert datetime.now() to datetime.now().isoformat() in SQL INSERT - Uses ISO format strings that SQLite handles natively - Eliminates dependency on deprecated datetime adapter ## Impact ✅ Zero deprecation warnings in test runs ✅ All existing functionality preserved ✅ Database compatibility maintained ✅ Clean test output for better debugging ## Files Changed - markitect/database.py: Updated store_markdown_file() method This fix improves the development experience by eliminating the flood of warnings that were obscuring actual test output and issues. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -85,7 +85,7 @@ class DatabaseManager:
|
||||
cursor.execute('''
|
||||
INSERT INTO markdown_files (filename, front_matter, content, created_at)
|
||||
VALUES (?, ?, ?, ?)
|
||||
''', (filename, front_matter_json, markdown_content, datetime.now()))
|
||||
''', (filename, front_matter_json, markdown_content, datetime.now().isoformat()))
|
||||
|
||||
record_id = cursor.lastrowid
|
||||
conn.commit()
|
||||
|
||||
Reference in New Issue
Block a user