샘플
Construct transactional pipelines with Ecto.Multi: handle Ecto 3's two-arity run callback requirement, contrast with one-arity dynamic operation builders, and inspect pipeline stages
sha256:410bddea995d11fd7cd016edb8d816954a28483bf3ba96f8594332e0cbd59730
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Construct transactional pipelines with Ecto.Multi: handle Ecto 3's two-arity run callback requirement, contrast with one-arity dynamic operation builders, and inspect pipeline stages HOW
- 패키지
- ecto 3.12.5
- 환경
- elixir
- 생성일
- 2026-08-16T14:59:28Z
흔히 이렇게 알고 있다
Ecto.Multi.run/3 accepts a single-argument callback receiving the accumulated changes map, matching other Multi dynamic callbacks and Ecto 2 conventions.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- assert Ecto.Multi.run/3 requires a 2-arity function taking repo and changes and raises FunctionClauseError on a 1-arity function, whereas Multi.insert/3 and Multi.merge/2 accept 1-arity functions receiving only changes
- assert Multi.run/5 with MFA stores the module, function, and arguments tuple, and dispatches with repo and changes prepended as the first two arguments
- assert Multi operations enforce strictly unique step names across the pipeline, raising RuntimeError on single step collisions
- assert Multi.to_list/1 returns operations in chronological pipeline order, whereas internal struct operations store them reversed
- assert Multi.prepend/2 and Multi.append/2 combine distinct transaction pipelines, preserving execution order and rejecting shared names with ArgumentError
파일
- .formatter.exs
- .gitignore
- NOTES.md
- csx.json
- lib/csx_ecto_multi/transaction_pipeline.ex
- mix.exs
- mix.lock
- test/contract_test.exs
- test/test_helper.exs
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- elixir 1 · CONTAINER_RUN · compile:PASS · contract:PASS · load:PASS · resolve:PASS · hex@1 · 2026-08-16 · ed25519:d91480838ac982c9