Skip to content

Add batch operations support #35

Description

@zzstoatzz

Problem

pdsx currently operates on single records at a time. For bulk operations, users must script loops around individual commands.

Proposed Enhancement

Add batch operation support for common multi-record operations:

Batch Delete

# Delete multiple posts by rkey
pdsx batch delete app.bsky.feed.post abc123 def456 ghi789

# Delete from file (one rkey per line)
pdsx batch delete app.bsky.feed.post --from-file ./to-delete.txt

# Delete with pattern matching
pdsx batch delete app.bsky.feed.post --filter 'text contains "spam"'

Batch Create

# Create multiple records from JSON array
pdsx batch create app.bsky.feed.post --from-file ./posts.json

# Create from JSONL (one record per line)
pdsx batch create app.bsky.feed.like --from-jsonl ./likes.jsonl

Batch Export

# Export all records from collection to file
pdsx batch export app.bsky.feed.post --output ./backup.json

# Export with pagination (all pages)
pdsx batch export app.bsky.feed.post --all --output ./all-posts.json

Batch Import

# Import records from backup
pdsx batch import app.bsky.feed.post --from-file ./backup.json

# Import with dry-run
pdsx batch import app.bsky.feed.post --from-file ./backup.json --dry-run

Implementation Notes

  • Use com.atproto.repo.applyWrites for atomic batch operations
  • Support both JSON array and JSONL formats
  • Add progress bars for large batches
  • Include rollback on partial failures
  • Rate limiting to avoid API throttling

Benefits

  • Efficient bulk operations
  • Atomic multi-record changes
  • Better for backup/restore workflows
  • Reduces API round-trips

Priority

Low - nice to have, but current single-record operations work fine for most use cases

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions