Shell scripts that loop over 'bd' invocations cause severe write
amplification on a dolt sql-server backed by btrfs+compression: each
process opens a connection, runs one operation, and creates one
DOLT_COMMIT. This new command lets a script collapse N operations into
a single dolt transaction with one DOLT_COMMIT.
Reads simple line-oriented commands from stdin (or -f file). Supported
subset matches what existing gascity orders actually loop over:
close <id> [reason...]
update <id> <key>=<value> [<key>=<value> ...]
create <type> <priority> <title...>
dep add <from-id> <to-id> [type]
dep remove <from-id> <to-id>
Update keys: status, priority, title, assignee.
The command dispatches directly against storage.Transaction (which
already exists) so no refactoring of the existing cobra handlers is
required. Unsupported commands fail at parse time before any writes,
and any error inside the transaction rolls the whole batch back.
Tests:
- batch_test.go: tokenizer, parser, supported/unsupported commands,
update key validation, command registration
- batch_embedded_test.go (//go:build cgo): full transaction commit,
rollback on FK error, empty input no-op, unsupported command guard,
dep remove path, and a guard test confirming the rollback trigger
still actually fails at the storage layer
Co-authored-by: Jim Wordelman <jim@wordelman.name>