March Docs

MutationExec

depot/lib/mutation_exec.march Bridge between Mutation ADTs and a live Postgres Connection.

A caller builds an Insert / Update / Delete with the MutationBuild DSL (including insert_returning_all, update_returning, etc. when rows should come back), then hands the ADT to exec/2. This module compiles the ADT to parameterized SQL and ships it through the Extended Query Protocol via Connection.exec_prepared, so the RETURNING clause round-trips as data rows on the wire.

Rows come back as List(List(Option(String))) — the raw string form from the protocol, exactly as simple_query / exec_prepared already emit for SELECT. Turning those rows back into typed records lives one layer up (at the Schema / Repo layer) and is out of scope for this module.

Functions

fnaffected_countaffected_count(tag)#
fnexec_deleteexec_delete(conn, d)#
fnexec_insertexec_insert(conn, i)#
fnexec_updateexec_update(conn, u)#