Include custom carbonite prefix in remaining multi step names#148
Merged
maltoe merged 2 commits intobitcrowd:mainfrom Apr 19, 2026
Merged
Include custom carbonite prefix in remaining multi step names#148maltoe merged 2 commits intobitcrowd:mainfrom
maltoe merged 2 commits intobitcrowd:mainfrom
Conversation
This patch extends the behaviour introduced in bitcrowd#143 to the remaining `Carbonite.Multi` functions: `fetch_changes/2` and `override_mode/2` now also include the `:carbonite_prefix` option in their multi step name. Without this, calls to these functions for different prefixes within the same `Ecto.Multi` raise because of a duplicate step name, which defeats the multi-stream setups that bitcrowd#143 was meant to enable, e.g. ``` Multi.new() |> Carbonite.Multi.insert_transaction(%{type: "foo"}) |> Carbonite.Multi.fetch_changes() |> Carbonite.Multi.insert_transaction(%{type: "foo"}, carbonite_prefix: "my_other_audits") |> Carbonite.Multi.fetch_changes(carbonite_prefix: "my_other_audits") ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows up on #143 — closes #147.
Extends the prefixed step-name behaviour introduced in #143 to the remaining
Carbonite.Multifunctions:fetch_changes/2andoverride_mode/2now alsoinclude the
:carbonite_prefixoption in their multi step name. Without this,combining these functions with different prefixes in one
Ecto.Multiraisesbecause of a duplicate step name.
Changes:
fetch_changes/2step is{:carbonite_changes, <prefix>}when:carbonite_prefixis givenoverride_mode/2step is{:carbonite_triggers, <prefix>}when:carbonite_prefixis given