Currently, users must import from specific modules:
# Current (v0.1.0)
from sqlmodel_crud_utils.sync import get_row, update_row
from sqlmodel_crud_utils.a_sync import get_row as a_get_rowShould allow:
# Proposed (v0.2.0)
from sqlmodel_crud_utils import get_row, update_row, a_get_rowImplementation: Update sqlmodel_crud_utils/__init__.py with exports.
Create a changelog file tracking v0.1.0 → v0.2.0 changes.
Implementation: Create CHANGELOG.md with standard format.
Update version from 0.1.0 → 0.2.0 in pyproject.toml.
Add generic TypeVars for better IDE support:
from typing import TypeVar
T = TypeVar('T', bound=SQLModel)
def get_row(
id_str: str | int,
session_inst: Session,
model: type[T],
...
) -> tuple[bool, T | None]:
...Impact: Better error handling for users.
Effort: Low
Files: Create sqlmodel_crud_utils/exceptions.py
Key exceptions:
RecordNotFoundErrorMultipleRecordsErrorBulkOperationError
Backward Compatible: Add raise_on_error=False parameter (default).
Impact: Safer transaction handling.
Effort: Low
Files: Create sqlmodel_crud_utils/transactions.py
# Usage
with transaction(session) as tx:
write_row(data, tx)
update_row(id, data, tx)
# Auto-commits on success, rolls back on errorImpact: Very high (common requirement).
Effort: Medium
Files: Create sqlmodel_crud_utils/mixins.py
class MyModel(SQLModel, AuditMixin, table=True):
id: int = Field(primary_key=True)
name: str
# Automatically adds: created_at, updated_at, created_by, updated_byImpact: High (common requirement). Effort: Medium
class MyModel(SQLModel, SoftDeleteMixin, table=True):
id: int = Field(primary_key=True)
name: str
# Automatically adds: deleted_at, deleted_by, is_deleted
# Usage
model.soft_delete(user="admin")
model.restore()Modification: Update get_rows() to exclude soft-deleted by default.
Allow users to inject logic before/after operations:
register_hook(MyModel, MyHook())
# Hooks called automatically:
# - before_create, after_create
# - before_update, after_update
# - before_delete, after_delete- Comprehensive docstrings
- Usage examples for each function
- Migration guide (v0.1.0 → v0.2.0)
- Troubleshooting guide
- ✅ Type checking fixes (DONE)
- Public API exports
- CHANGELOG.md
- Version bump to 0.2.0
- Enhanced type hints
Output: Immediately usable v0.2.0-alpha
- Custom exception hierarchy
- Transaction context managers
- Audit trail mixins
- Soft delete support
Output: v0.2.0-beta with production-ready features
- Lifecycle hooks
- Enhanced documentation
- Complete test coverage for new features
- Migration guide
Output: v0.2.0-rc1 (release candidate)
- Final testing
- Update README
- PyPI release
- GitHub release notes
- Announce on discussions
Output: v0.2.0 stable release
To keep scope manageable, defer these to v0.3.0:
- ❌ Query Builder (complex, needs more design)
- ❌ Caching Layer (needs external dependencies)
- ❌ Change Tracking (complex feature)
- ❌ Migration Utilities (out of scope)
- ❌ GraphQL Support (different domain)
| Feature | v0.1.0 | v0.2.0 |
|---|---|---|
| CRUD Operations | ✅ | ✅ |
| Sync/Async | ✅ | ✅ |
| Type Checking | ✅ | |
| Public API | ❌ | ✅ |
| Exceptions | Basic | Custom Hierarchy |
| Transactions | Manual | Context Managers |
| Audit Trail | ❌ | ✅ Mixins |
| Soft Deletes | ❌ | ✅ |
| Hooks | ❌ | ✅ |
| CHANGELOG | ❌ | ✅ |
| Documentation | Basic | Comprehensive |
- ✅ 100% test coverage (maintain)
- ✅ Type checking passing
- ✅ All pre-commit hooks passing
- ✅ No regressions in existing functionality
- 📦 Easier imports (public API)
- 🔧 Better error messages (custom exceptions)
- 🛡️ Safer operations (transaction managers)
- 📝 Production-ready features (audit, soft delete)
- 📈 Increase GitHub stars
- 💬 Positive feedback on discussions
- 🐛 Fewer bug reports
- 📖 More comprehensive docs
| Feature | Effort | Impact | Priority | Include in v0.2.0? |
|---|---|---|---|---|
| Public API Exports | 🟢 Low | 🔥 High | P0 | ✅ YES |
| CHANGELOG | 🟢 Low | 🔥 High | P0 | ✅ YES |
| Type Hints | 🟢 Low | 🔥 High | P0 | ✅ YES |
| Exceptions | 🟡 Medium | 🔥 High | P1 | ✅ YES |
| Transactions | 🟡 Medium | 🔥 High | P1 | ✅ YES |
| Audit Mixins | 🟡 Medium | 🔥 High | P1 | ✅ YES |
| Soft Deletes | 🟡 Medium | 🔥 High | P1 | ✅ YES |
| Hooks | 🟡 Medium | 🟡 Medium | P2 | |
| Documentation | 🔴 High | 🔥 High | P1 | ✅ YES |
| Query Builder | 🔴 High | 🟡 Medium | P3 | ❌ NO (v0.3.0) |
| Caching | 🔴 High | 🟡 Medium | P3 | ❌ NO (v0.3.0) |
Read v0.2.0_ENHANCEMENT_DESIGN.md for full details.
- Start with Phase 1 quick wins
- Ensure all tests pass after each change
- Maintain backward compatibility
- Document as you go
v0.2.0 will be 100% backward compatible with v0.1.0. No breaking changes!
- GitHub Discussions: https://github.com/fsecada01/SQLModel-CRUD-Utilities/discussions
- Issues: https://github.com/fsecada01/SQLModel-CRUD-Utilities/issues
Next Steps:
- Review both design documents
- Prioritize features based on your needs
- Start with Phase 1 quick wins
- Iterate and release!