SurrealDB icon

SurrealDB

Interaction with a SurrealDB database

Batch → Batch Update

AI-generated

Summary

Update multiple records in a specified SurrealDB table using batch processing with configurable batch size, parallel execution, error handling, and transaction support.

Inputs

  • Table (required) — The name of the SurrealDB table where records will be updated (e.g., "person", "product", "order").
  • Records Data (JSON) (required) — A JSON array of record objects each containing the ID and fields to update.
  • Batch Configuration — Settings to control batch processing behavior including batch size (number of records per batch), parallel processing toggle, maximum parallel batches, error handling strategy (stop on first error, continue on errors, or partial success), transaction mode to execute all updates within a single transaction, and progress tracking enablement.
  • Options — Additional options to override credential namespace and database for the operation.
  • Connection Pooling — Configuration for the connection pool such as minimum and maximum number of connections, connection acquisition timeout, health check intervals, idle time before closing connections, retry attempts and delay for acquiring connections, and whether to validate connections before use.

Output shape

a list of result objects for each processed batch indicating success or failure per batch and aggregate processed counts.

The returned results include batch-level success information and partial results depending on the configured error handling strategy; progress reporting is available if enabled. Errors and partial successes propagate as per configuration.

Examples

Example 1: Updating multiple product records with different fields in batches of 50 using parallel processing of up to 3 batches simultaneously, continuing on errors to collect all errors.

Table set to 'product'; Records Data is a JSON array of records with IDs and updated fields; Batch Size set to 50; Parallel Processing enabled; Max Parallel Batches set to 3; Error Handling set to 'Continue on Errors'; Transaction Mode disabled; Progress Tracking enabled.

Links

Discussion