Dry runs and batch behavior

The filemaker CLI processes NDJSON operations within an atomic transaction. A regular run commits upon successful completion; a dry run executes identical operations but discards all changes. By default, any operation error aborts the transaction and rolls back earlier changes.

Batch transaction lifecycle

The CLI opens the database file once, processes operations in sequential order, and commits or aborts the transaction:

  • If all operations succeed, regular runs commit changes to the file.

  • If any operation encounters an error, the batch aborts and rolls back all preceding changes by default.

  • If --dry-run is enabled, changes are discarded upon completion.

The closing batch summary indicates whether changes committed or rolled back. Earlier successful operation results are invalidated if a subsequent operation triggers a rollback.

Dry-run validation

Pass --dry-run to validate operations without persisting changes:

Copy
filemaker --file="/absolute/path/Contacts.fmp12" \
  --dry-run \
  create-invoices.ndjson

Dry runs execute complete schema validation and operational logic, discarding changes at transaction conclusion.

Note  Point-in-time validation: A successful dry run verifies compatibility with the current database state. Concurrent user edits can alter schema before a regular run executes.

Error handling and rollback

With default settings (--abort-on-error=true), errors abort execution immediately. In the following example, if the second operation fails with table_exists, the transaction rolls back and the first table is not committed:

Copy
{"op":"create:table","name":"Invoices"}
{"op":"create:table","name":"Invoices"}

Partial batch execution

Set --abort-on-error=false to allow partial execution. The CLI continues processing subsequent operations and commits all successful operations:

Copy
filemaker --file="/absolute/path/Contacts.fmp12" \
  --abort-on-error=false \
  operations.ndjson

Use partial execution only when operations do not depend on preceding steps.