
louise
Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.
Dernier runRéussi#1201 · main · 9 min 57 s
1Étoiles
0Forks
0Issues
Types: a rigid row tail under a nonempty row; packages: `pg.savepoint` (ADR 0010 note)
A `use` callback (a lambda) could not call its action after a concrete
effect: E0502, because a call whose row's tail is a rigid row variable
was only allowed when the current row was still empty. Now the current
row's flexible tail becomes the callee's extra labels over the rigid one
(`perform` in `louise_types::infer::effects`), so
use _ <- result.try(execute("savepoint " <> name, []))
match action() { ... }
checks. One restriction stays, documented in ADR 0010's note: after such
a call, a *new* concrete effect in the same scope can't extend the
now-rigid tail (perform it first). Two repairs ride along:
- the dead-row lint (issue #203) read each call's unzonked labels, so an
effect performed only through a callback's row variable looked dead;
it reads the zonked row now;
- a site reported by `resolve` (a handler a callback's fixed type can't
use) was reported again by `unhandled`: one E0502 per site.
tests/ui/effects.lse pins both the accepted shape and the remaining
restriction. With it, the postgres package's `savepoint` is the clean
form, and `with_connection` keeps its `use` (transactions keep the
`match` on purpose: the begin-failure path releases the connection).
`pg.savepoint(fn() { ... })`: SAVEPOINT/RELEASE on the transaction's
connection, `ROLLBACK TO SAVEPOINT` on an `Error` — nested transactions
for #145. Names are generated. Live-tested against postgres:18: a failing
savepoint keeps the outer transaction's writes.Parents ef4bfca
6 fichiers modifiés, 167 ajouts, 28 suppressions
crates/louise_types/src/infer/effects.rs+31−7docs/adr/0010-lexical-handlers.md+16−0examples/event_store/louise.toml+5−0packages/postgres/src/lib.lse+35−17packages/postgres/test/pool_test.lse+52−4tests/ui/effects.lse+28−0