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

Add insertUnique_ to PersistUniqueWrite #1469

Merged
merged 4 commits into from
Mar 3, 2023

Conversation

lbseale
Copy link
Contributor

@lbseale lbseale commented Jan 27, 2023

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)

- Works the same as insertUnique, but doesn't return a key
- For SQL databases this can be twice as fast since there is no SELECT
  to get the key after the original INSERT

commit 093b2347762e15a12fc4422c718d6adeb3e7fb89
Author: Luke Seale <19484084+lbseale@users.noreply.github.com>
Date:   Tue Jan 24 17:33:41 2023 -0800

    Add a test for insertUnique_

commit 75ffc4f3eb5048d1983fab6d8b0df22e1d6f4517
Author: Luke Seale <19484084+lbseale@users.noreply.github.com>
Date:   Tue Jan 24 17:33:19 2023 -0800

    Add help for insertUnique_

    - Also fix incorrect type annotation

commit bc81b359f454d0984062ab4f32980df75a6a85d8
Author: Luke Seale <19484084+lbseale@users.noreply.github.com>
Date:   Tue Jan 24 17:31:50 2023 -0800

    Add insertUnique_ to PersistUniqueWrite typeclass

    - Works the same way is insertUnique, but calls insert_ instead of
      insert
    - Return type is Maybe (), since it insert_ doesn't return a key
@lbseale
Copy link
Contributor Author

lbseale commented Jan 27, 2023

Fixes issue #1457

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.

This is great, thank you! Please make a Changelog entry. I'll relesae this with 2.14.5.0

--
-- Linus's record was inserted to <#dataset-persist-unique-1 dataset-1>, while SPJ wasn't because SPJ already exists in <#dataset-persist-unique-1 dataset-1>.
--
-- @since 2.14.4.4
Copy link
Collaborator

@parsonsmatt parsonsmatt Mar 2, 2023

Choose a reason for hiding this comment

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

As an addition to a class with a default method, this is a minor version bump - let's bundle this with 2.14.5.0.

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!

@parsonsmatt parsonsmatt merged commit 20f6914 into yesodweb:master Mar 3, 2023
@lbseale
Copy link
Contributor Author

lbseale commented Mar 3, 2023

Thank you! Proud to have my contribution included

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