Repository navigation
Include custom carbonite prefix in multi step name - #143
Merged
Merged
Conversation
This patch changes behaviour of `Carbonite.Multi.insert_transaction/3` to
include the given `:carbonite_prefix` option in the multi name. This allows
for multi-stream setups on the same DB transaction, e.g.
```
Multi.new()
|> Carbonite.Multi.insert_transaction(%{type: "foo"})
|> Carbonite.Multi.insert_transaction(%{type: "foo"}, carbonite_prefix: "my_other_audits")
```
Hedde
added a commit
to Hedde/carbonite
that referenced
this pull request
Apr 16, 2026
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 was referenced Apr 16, 2026
maltoe
pushed a commit
that referenced
this pull request
Apr 19, 2026
This patch extends the behaviour introduced in #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 #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.
This patch changes behaviour of
Carbonite.Multi.insert_transaction/3to include the given:carbonite_prefixoption in the multi name. This allows for multi-stream setups on the same DB transaction, e.g.