Skip to content

Conversation

@maximelb
Copy link
Contributor

@maximelb maximelb commented Sep 6, 2025

Summary

  • Port batch operations functionality from go-limacharlie SDK to Python
  • Enable multiple hive operations in a single API call for improved performance
  • Maintain full compatibility with existing code

Changes

  • Added HiveID, RecordID, and ConfigRecordMutation data classes for structured batch operations
  • Implemented HiveBatch class with methods:
    • get_record() - Get full record data
    • get_record_mtd() - Get record metadata only
    • set_record() - Set/update record with data
    • set_record_mtd() - Set record metadata
    • del_record() - Delete a record
    • execute() - Send all batched operations in single API call
  • Added new_batch_operations() method to existing Hive class for creating batch contexts
  • Created comprehensive unit tests (13 tests, all passing)
  • Added demo script with usage examples

Usage Example

hive = Hive(manager, 'dr')
batch = hive.new_batch_operations()

# Add multiple operations
batch.get_record(RecordID(hive_id, 'rule1'))
batch.set_record(RecordID(hive_id, 'rule2'), config)
batch.del_record(RecordID(hive_id, 'rule3'))

# Execute all in one API call
responses = batch.execute()

Testing

  • All unit tests passing
  • Maintains backward compatibility with existing code
  • Mirrors go-limacharlie SDK functionality

🤖 Generated with Claude Code

Port the batch operations functionality from go-limacharlie SDK to Python.
This allows multiple hive operations to be executed in a single API call,
significantly improving performance for bulk operations.

Key changes:
- Add HiveID, RecordID, and ConfigRecordMutation data classes
- Implement HiveBatch class with support for get, set, delete operations
- Add new_batch_operations() method to Hive class
- Include comprehensive unit tests
- Add demo script showing usage examples

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@maximelb maximelb requested review from josh-lc and tomaz-lc September 6, 2025 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants