Skip to content

sqlx-postgres: Make PgNotification struct clone#4228

Merged
abonander merged 1 commit intolaunchbadge:mainfrom
michaelvanstraten:make-pg-notification-clone
Apr 10, 2026
Merged

sqlx-postgres: Make PgNotification struct clone#4228
abonander merged 1 commit intolaunchbadge:mainfrom
michaelvanstraten:make-pg-notification-clone

Conversation

@michaelvanstraten
Copy link
Copy Markdown
Contributor

I have a rest endpoint that does SSE (Server Sent Events) where I listen on a Postgres channel on a notification to look for new rows in a table. I multiplex the PgListener through a tokio broadcast channel to reuse the same connection for multiple requests. For this the PgNotification struct needs to be Clone.

There is no reason I see why it shouldn't be, Bytes is designed to be cloned.

Does your PR solve an issue?

No, the authors of #303 though thought it was related.

Is this a breaking change?

No, I think this should be fine (no negative trait impls yet).

@abonander abonander merged commit b27b49d into launchbadge:main Apr 10, 2026
147 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants