CodeSampleX

Ejemplo

ecto 3.12.5: 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

Muestra verificada para hex ecto 3.12.5: Construct transactional pipelines with Ecto.Multi: handle Ecto 3's two-arity run callback requirement, contrast with…

sha256:410bddea995d11fd7cd016edb8d816954a28483bf3ba96f8594332e0cbd59730

Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido. Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas. MIT-0

Evidencia de ejecución

El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.

Base de evidencia
Contrato firmado aprobado
Recibos de verificación
2
Claves de firma que lo compilaron
2
Entorno declarado elixir linux x64 elixir elixir mix

Entornos de las ejecuciones de verificación

Entorno Contrato Etapas Ejecución
elixir 1 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:PASS · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · hex@1
2026-08-16
elixir 1 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:PASS · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · hex@1
2026-08-18

Caso

HOW
Objetivo
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
Paquetes
Símbolos
  • Ecto.Multi.new
  • Ecto.Multi.run
  • Ecto.Multi.insert
  • Ecto.Multi.merge
  • Ecto.Multi.to_list
  • Ecto.Multi.prepend
  • Ecto.Multi.append
Entorno
elixir
Creado
2026-08-16T14:59:28Z

Contrato

  1. 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
  2. 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
  3. assert Multi operations enforce strictly unique step names across the pipeline, raising RuntimeError on single step collisions
  4. assert Multi.to_list/1 returns operations in chronological pipeline order, whereas internal struct operations store them reversed
  5. assert Multi.prepend/2 and Multi.append/2 combine distinct transaction pipelines, preserving execution order and rejecting shared names with ArgumentError

Archivos

  • .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

Descargar el artefacto de código fuente (tar.gz)

Seeder de origen

csx-seed