You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Still loving this library! but I have some question(s) and would like to pick your brain. Might be nice to open up github-discussions?
questions:
Do you know a straight forward way to create an async-stream from a query?
Is cloning an async-sqlite client a bad idea? I figured out a way to make an async-stream from a client but it involves cloning the client if you/one does not want to consume their client.
How costly is cloning a client?
The text was updated successfully, but these errors were encountered:
Hey! I just enabled discussions, so feel free to ask questions over there 😄
To answer the questions:
Cloning a Client is very cheap. The way a Client works under the hood is that a sqlite connection is opened in a dedicated thread, and the client communicates with that thread asynchronously to run your provided function there with the rusqlite connection. So when a Client is cloned, it's essentially just copying a reference to that thread/connection.
This means that although a Client can be shared across threads and used asynchronously at the same time, only one function can actually be run with the rusqlite connection at a time. As long as one function is still running, no other functions can run on that connection. For your question about creating an async stream, what is your use case? Are you trying to incrementally stream a blob out of your db?
I really could not say if that is a good or bad way of doing it, but it does seem to work, and it is VERY fast. The using async streams for map-tiles is pretty ideal seeming (afaict) because what I am using this for often involves receiving/sending a huge number of rows to/from a database often with totally inconsistent timing.
Hi @ryanfowler,
Still loving this library! but I have some question(s) and would like to pick your brain. Might be nice to open up github-discussions?
questions:
The text was updated successfully, but these errors were encountered: