def once

bend-kit-commands@0.4.0.0 · commands.bend:126

import bend-kit-commands@0.4.0.0/commands.bend as Commands
import Base
import bend-kit-sqlite@0.1.0.1/sqlite.bend as Sqlite

126# Prepares one statement, runs body on it, and finalizes it, also after body fails.
127def once(-A: Type, +db: U32, text: String, body: U32 -> Run(A)) -> Run(A):
128  do Run<A>:
129    s : U32 <- Sqlite.stmt.prepare(db, text)
130    once.run(A, s, body)

Uses (6)

Used by (4)