Skip to content

Docs call schema operations "auto-transactional" and say not to wrap them; upstream says they are not transactional and should be batched in one transaction #21

Description

@tae898

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions