Skip to content

feat: update automatically on row modifications#86

Merged
Besthope-Official merged 2 commits into
mainfrom
fix/mixin-update-at-db-level
Jan 7, 2026
Merged

feat: update automatically on row modifications#86
Besthope-Official merged 2 commits into
mainfrom
fix/mixin-update-at-db-level

Conversation

@Besthope-Official
Copy link
Copy Markdown
Contributor

Related Issue

Closes #84

Summary of Changes

Added sa_column_kwargs={"onupdate": ...} to TimestampMixin.updated_at in src/shared/mixins.py:8-11 to automatically update the timestamp at database level when rows are modified.

Created tests/shared/test_mixins.py with two tests:

  • test_timestamp_mixin_updated_at_updates: verifies updated_at changes on UPDATE
  • test_timestamp_mixin_created_at_unchanged: verifies created_at remains unchanged on UPDATE

Breaking Changes

N/A

Checklist

  • Issue discussion completed before opening PR
  • Scope is small and focused (single feature/fix)
  • All functions have full type annotations
  • Async/await used for all I/O operations
  • Tests added for new behaviors

@Besthope-Official Besthope-Official added the bug Something isn't working label Jan 7, 2026
@Besthope-Official Besthope-Official merged commit 4af8c1a into main Jan 7, 2026
3 checks passed
@Besthope-Official Besthope-Official deleted the fix/mixin-update-at-db-level branch January 7, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TimestampMixin updated_at should update at db level

1 participant