Skip to content

Conversation

@apkhandkar
Copy link
Contributor

Not doing so was leading to a "maximum open cursors exceeded" error.

Copy link
Collaborator

@dmjio dmjio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, maybe it's worth making a withStatement function that automatically performs closeStatement (like withHandle). I can update the nix hash in a separate PR.

withStmt conn sql action = do
  stmt <- prepareStmt conn sql
  result <- action stmt
  closeStatement stmt
  pure result

@dmjio dmjio merged commit ea120be into master Oct 26, 2025
1 check failed
@dmjio dmjio deleted the close-stmt-fix branch October 26, 2025 05:58
dmjio added a commit that referenced this pull request Oct 26, 2025
@dmjio dmjio mentioned this pull request Oct 26, 2025
@dmjio
Copy link
Collaborator

dmjio commented Oct 26, 2025

@apkhandkar sorry, I should not have merged this, I assumed this was something you were upstreaming that was a fix.

  • stmt is not in scope so there is a compile error (fixed in closeStatement #55)
  • closeStatement is causing test failures

If I get bandwidth I'll come back to the test failures, or if you'd like to upstream the fix.

dmjio added a commit that referenced this pull request Oct 26, 2025
@dmjio dmjio restored the close-stmt-fix branch October 26, 2025 14:15
dmjio added a commit that referenced this pull request Oct 26, 2025
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