The bindings docs (api/schema.md, api/transactions.md, the transactions guide, and comments across tests, examples, and doc code blocks: 50 places) say schema operations are "auto-transactional" and tell users not to wrap them in with db.transaction():. Upstream's answer on ArcadeData#8635 (fixed in ArcadeData#8657 for 26.10.1) is the other way round on both points: a schema statement is not transactional (it takes effect at once and a rollback does not undo it), and running many inside one transaction, or as one sqlscript, is the recommended way to create many types, because the schema is then written once when the transaction ends.
Measured on the laptop with the issue's repro on the published snapshot 66a82a8fd0 (Temurin 25 / 21): 30 types with a property and an index in one transaction cost 3.30 / 3.13 ms per type, against 14.6 / 15.0 ms for a single standalone CREATE DOCUMENT TYPE.
The bindings docs (api/schema.md, api/transactions.md, the transactions guide, and comments across tests, examples, and doc code blocks: 50 places) say schema operations are "auto-transactional" and tell users not to wrap them in
with db.transaction():. Upstream's answer on ArcadeData#8635 (fixed in ArcadeData#8657 for 26.10.1) is the other way round on both points: a schema statement is not transactional (it takes effect at once and a rollback does not undo it), and running many inside one transaction, or as onesqlscript, is the recommended way to create many types, because the schema is then written once when the transaction ends.Measured on the laptop with the issue's repro on the published snapshot
66a82a8fd0(Temurin 25 / 21): 30 types with a property and an index in one transaction cost 3.30 / 3.13 ms per type, against 14.6 / 15.0 ms for a single standaloneCREATE DOCUMENT TYPE.