-
Notifications
You must be signed in to change notification settings - Fork 5
[Refactor] Outbox Architecture Overhaul: PostgreSQL Support, Mixin Models, and UUID v7 #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Dioneya
wants to merge
18
commits into
pypatterns:master
Choose a base branch
from
Dioneya:sqlalchemy-type-fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a0c711e
sqlalchemy as optional deps and correction of sqlalchemy models of ou…
DioneyaCthulhu befd929
tests and readme fix
DioneyaCthulhu a0458f7
Merge remote-tracking branch 'upstream/master' into sqlalchemy-type-fix
DioneyaCthulhu a595c7d
returned deprecated method rebind_outbox_model
DioneyaCthulhu 3a642e4
replaced uuid4 by uuid7 in PydanticNotificationEvent
DioneyaCthulhu 0ce18ec
remove useless import
DioneyaCthulhu 733ff7f
remove useless import
DioneyaCthulhu c00af44
tests fix
DioneyaCthulhu 6525ec3
tests fix
DioneyaCthulhu d0af53d
Apply suggestion from @coderabbitai[bot]
Dioneya 7b6db8a
tests fix
DioneyaCthulhu 90a761b
Merge remote-tracking branch 'origin/sqlalchemy-type-fix' into sqlalc…
DioneyaCthulhu 76c7dbd
tests fix
DioneyaCthulhu 6b61232
tests fix
DioneyaCthulhu c04200c
fix sys import
DioneyaCthulhu 52f67aa
fix sys import
DioneyaCthulhu 608d0a9
fix import
DioneyaCthulhu 9f3e6b1
resolve merge conflicts
DioneyaCthulhu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| from cqrs.outbox.repository import OutboxedEventRepository, EventStatus | ||
| from cqrs.outbox.map import OutboxedEventMap | ||
|
|
||
| __all__ = [ | ||
| "OutboxedEventRepository", | ||
| "EventStatus", | ||
| "OutboxedEventMap", | ||
| ] | ||
|
|
||
| try: | ||
| from cqrs.outbox.sqlalchemy import ( | ||
| SqlAlchemyOutboxedEventRepository, | ||
| OutboxModelMixin | ||
| ) | ||
| __all__.extend([ | ||
| "SqlAlchemyOutboxedEventRepository", | ||
| "OutboxModelMixin" | ||
| ]) | ||
| except ImportError: | ||
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process_bind_paramsilently passes non-uuid.UUIDvalues through for non-PostgreSQL dialects.If a string UUID (e.g.,
"550e8400-e29b-...") is passed for MySQL/SQLite, the finalreturn valuefalls through without conversion, producing a type error or silent data corruption when SQLAlchemy tries to store it in aBINARY(16)column.🛡️ Proposed fix: add a string-to-UUID conversion guard
def process_bind_param(self, value, dialect): if value is None: return value if dialect.name == "postgresql": return value # asyncpg works with uuid.UUID + if isinstance(value, str): + value = uuid.UUID(value) if isinstance(value, uuid.UUID): return value.bytes # For MySQL return 16 bytes return value🤖 Prompt for AI Agents