sqlx/sqlx-macros-core
Sean Lynch 69bb5952ab
Drop cached db connections in macros upon hitting an error (#4009)
Once a connection to the database is lost all future macro evaluations
will fail. This is fine for normal compilation since it tends to be
short but causes issues with rust-analyzer since it keeps the macro
binaries loaded for a long time.

This commit changes the macro implementation to drop the cached
connection when it encounters an IO or protocol error. In practice these
seem to be the errors that show up when the connection is lost and
dumping the connection on every error would have unnecessary overhead.
2025-08-28 20:37:49 -07:00
..
2024-06-20 10:56:08 -07:00
2024-06-20 10:56:08 -07:00