Skip to content

Close compile-time JDBC connection in DB.sqlTable macro - #176

Merged
Quafadas merged 1 commit into
mainfrom
fix/db-connection-leak
Oct 26, 2026
Merged

Quafadas merged 1 commit into
mainfrom
fix/db-connection-leak

Conversation

@Quafadas

Copy link
Copy Markdown
Owner

sqlTableImpl opened a connection for schema inference and never closed it, leaking one connection per macro expansion (i.e. per recompile in Metals/Mill). Wrap the schema read in try/finally.

Also remove the unused private withConnection helper, which called DriverManager directly and would fail to find drivers under the macro classloader.

sqlTableImpl opened a connection for schema inference and never closed
it, leaking one connection per macro expansion (i.e. per recompile in
Metals/Mill). Wrap the schema read in try/finally.

Also remove the unused private withConnection helper, which called
DriverManager directly and would fail to find drivers under the macro
classloader.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Quafadas
Quafadas merged commit 63ff8b0 into main Oct 26, 2026
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