Skip to content

libsql: Open a fresh stream in HttpConnection::prepare() #2108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

penberg
Copy link
Collaborator

@penberg penberg commented Jun 22, 2025

The server expires idle streams in 10 seconds. Therefore, let's not even attempt to reuse the same stream for preparing a new SQL statement.

The server expires idle streams in 10 seconds. Therefore, let's not even
attempt to reuse the same stream for preparing a new SQL statement.
@@ -81,7 +81,7 @@ where
}

pub async fn prepare(&self, sql: &str) -> crate::Result<Statement<T>> {
let stream = self.current_stream().clone();
Copy link

Choose a reason for hiding this comment

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

Did the expired stream get properly cleaned up?
Is it possible to check the current stream to see if it's a live and reuse it, if it's dead open a new stream - does that improve anything?

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