Skip to content

Conversation

@cubic-dev-ai
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot commented Oct 30, 2025

🤖 PR by cubic

This PR addresses the comment in #1990 – Our existing code created prepared statements without finalizing them.

File: packages/memory/space.ts
Line: 788
Comment:

Wrap this statement in a try/finally so stmt.finalize() always runs even if stmt.get throws; otherwise a failing query will leak the prepared statement.

This fix was automatically generated. Please review the changes carefully before merging.


Summary by cubic

Always finalize prepared statements by wrapping stmt.get in a try/finally in packages/memory/space.ts. Prevents leaking prepared statements when a query throws.

Written for commit 495631d. Summary will update automatically on new commits.

ubik2 and others added 3 commits October 30, 2025 14:52
This changes those to properly dispose of them.
A future improvement is to only prepare the EXPORT statement once, and attach it to the Session or store.
@cubic-dev-ai cubic-dev-ai bot requested a review from ubik2 October 30, 2025 22:11
Copy link
Contributor Author

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Base automatically changed from robin/stmt-cleanup to main October 31, 2025 17:39
@cubic-dev-ai cubic-dev-ai bot closed this Oct 31, 2025
@cubic-dev-ai
Copy link
Contributor Author

cubic-dev-ai bot commented Oct 31, 2025

This fix PR has been automatically closed because the parent PR #1990 was closed.

If you still need this fix, please reopen the parent PR first, or create a new PR with these changes.

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