Add SQLite-backed bidirectional sync tool for PreTeXt book structure/content#137
Add SQLite-backed bidirectional sync tool for PreTeXt book structure/content#137
Conversation
Co-authored-by: geoff-cox <63681414+geoff-cox@users.noreply.github.com>
Co-authored-by: geoff-cox <63681414+geoff-cox@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces a SQLite-based bidirectional synchronization tool for managing PreTeXt book content between source files and a database. The tool is designed as a beginner-friendly workflow utility for solo authors and small teams to inspect and edit book content via database queries while maintaining sync with the source .ptx files.
Changes:
- Adds a new Python sync utility with init/pull/push/sync commands and conflict detection/resolution
- Provides comprehensive documentation explaining the database schema, sync strategy, and practical workflows
- Updates .gitignore to exclude Python cache files for the new tooling
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| processing-tools/book-db-sync/book_db_sync.py | Core sync utility implementing bidirectional sync with hash-based conflict detection, path traversal protection, and parameterized SQL queries |
| processing-tools/book-db-sync/README.md | Documentation covering database schema, sync strategy, usage examples, and practical workflows |
| .gitignore | Adds Python cache files (pycache/, *.pyc) to gitignore |
| else: | ||
| conflicts += 1 | ||
| continue |
There was a problem hiding this comment.
When conflicts are detected with prefer="none", only the count is reported without identifying which specific files have conflicts. Consider logging the conflicting file paths to help users identify and resolve conflicts more easily. For example, print a warning message with the href when a conflict is detected.
There was a problem hiding this comment.
Implemented in b65b45e. The sync tool now prints the specific conflicting href whenever sync --prefer none detects a conflict, so you can immediately see which file needs resolution.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: geoff-cox <63681414+geoff-cox@users.noreply.github.com>
--prefer nonedetects conflicts✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.