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

implement `Send` for SqliteConnection #228

Closed
euclio opened this Issue Feb 28, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@euclio

euclio commented Feb 28, 2016

Why is this not the case? It seems like it'd be ok given the reasons outlined in #190, but I admit that I'm not that familiar with the matter.

Use case: I'm working on a web application where I'd like to be able to share a SqliteConnection between multiple requests using a combination of iron's persistent crate and r2d2-diesel.

@sgrif

This comment has been minimized.

Member

sgrif commented Mar 5, 2016

Why is this not the case?

Short version is that with SQLite, there's no cost to an additional connection. That said, I don't have a terribly strong opinion one way or another. If you want to open a PR for this with an argument laying out why implementing Send is beneficial over just establishing a new connection as you need it, I'd be open to it.

@euclio

This comment has been minimized.

euclio commented Mar 7, 2016

Right, but I think one use case would be for a :memory: database where you cannot create multiple connections to it.

sgrif added a commit that referenced this issue Apr 6, 2016

Implement `Send` for `SqliteConnection`
After spending some time poking at it, I can't find any reason this
wouldn't be safe. There's a legitimate use case for this where you want
to share a connection to an in memory database (wrapped in a mutex of
course)

Fixes #228

sgrif added a commit that referenced this issue Apr 6, 2016

Implement `Send` for `SqliteConnection`
After spending some time poking at it, I can't find any reason this
wouldn't be safe. There's a legitimate use case for this where you want
to share a connection to an in memory database (wrapped in a mutex of
course)

Fixes #228

@sgrif sgrif closed this in #259 Apr 6, 2016

sgrif added a commit that referenced this issue Apr 6, 2016

Implement `Send` for `SqliteConnection`
After spending some time poking at it, I can't find any reason this

wouldn't be safe. There's a legitimate use case for this where you want

to share a connection to an in memory database (wrapped in a mutex of

course)



Fixes #228
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment