Skip to content
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

persistent-sqlite: Add openRawSqliteConn #1488

Merged
merged 4 commits into from Oct 3, 2023

Conversation

ivanbakel
Copy link
Contributor

@ivanbakel ivanbakel commented Mar 24, 2023

This adds a new function for manually constructing a RawSqlite SqlBackend connection without having to use the resource-cleaning with* functions.

I want to use this because I'm working with a resource-pool fork and I don't want to be constricted by the API exposed by persistent-sqlite for creating pools - but I can't create my own custom pool without a way to create new RawSqlite SqlBackend resources from scratch that don't get automatically cleaned up.


Before submitting your PR, check that you've:

  • Documented new APIs with Haddock markup
  • Added @since declarations to the Haddock
  • Ran stylish-haskell on any changed files.
  • Adhered to the code style (see the .editorconfig file for details)

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Bumped the version number if there isn't an (unreleased) on the Changelog
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

This new function allows for creating a `RawSqlite SqlBackend` manually
(without exposing the `RawSqlite` constructor) for code that wants to
open such a connection without having to opt-in to the resource
management of `withRawSqliteConnInfo` and co.

This is useful in my particular use case for creating a custom pool,
since I am not constrained by the `resource-pool` API re-exposed by
`persistent-sqlite`.
@parsonsmatt parsonsmatt merged commit 6194b1f into yesodweb:master Oct 3, 2023
7 checks passed
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.

None yet

2 participants