Skip to content

Conversation

@ivb-supercede
Copy link
Contributor

@ivb-supercede ivb-supercede commented Aug 18, 2021

Based on the discussion in #1298.

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)

As part of the discussion in #1298, it was found that
external libraries which want to hook into Persistent's Postgres API are
limited by their inability to access the postgresql-simple `Connection`
which backs a Postgres `SqlBackend`.

A similar issue in the past with Sqlite was solved by the `RawSqlite`
wrapper, which is able to expose the raw connection as well as be
compatible with the wrapped `SqlBackend` that it stores.

This adds an equivalent wrapper to persistent-postgresql, which exposes
the raw connection, and therefore allows third-party libraries to access
it.
Copy link
Collaborator

@parsonsmatt parsonsmatt left a comment

Choose a reason for hiding this comment

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

Thanks, this looks great!

Let's not introduce microlens dependency and lens generation. I know it was copied from SQLite, but it's not something I'd like to repeat.

ivb-supercede and others added 2 commits August 31, 2021 14:51
This was requested as part of the review on #1305.

Co-authored-by: Matt Parsons <parsonsmatt@gmail.com>
@parsonsmatt parsonsmatt merged commit 02fb1e1 into yesodweb:master Sep 6, 2021
@parsonsmatt
Copy link
Collaborator

Thanks so much! I'll get this released today.

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