You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add connect_with_socket() for custom transports
Add the ability to establish MySQL and PostgreSQL connections over
pre-connected sockets, enabling custom transports such as in-memory
pipes, simulation frameworks (e.g. turmoil for deterministic simulation
testing), SSH tunnels, or SOCKS proxies.
Changes:
- Add `net::connect_with()` in sqlx-core as the analog of `connect_tcp`
and `connect_uds` for pre-established sockets
- Add `MySqlConnectOptions::connect_with_socket()` and
`MySqlConnection::connect_with_socket()` for MySQL
- Add `PgConnectOptions::connect_with_socket()` and
`PgConnection::connect_with_socket()` for PostgreSQL
- Re-export `Socket` trait and `connect_with` from top-level `sqlx::net`
- Refactor MySQL post-connect init into shared `after_connect()` to
avoid duplication between `connect()` and `connect_with_socket()`
The Socket trait was already public; these changes simply expose a way
to pass a pre-connected Socket into the connection establishment flow
that was previously only reachable through connect_tcp/connect_uds.
0 commit comments