RFieldStorage
Enum defining storage backend options for RField values.
RFieldStorage determines where and how a field's value is persisted when a Resource is saved, and how it is retrieved when the Resource is loaded.
Attributes: DATABASE: Store field value in the relational database. - Pros: Searchable, queryable, indexed for fast lookups - Cons: Limited to small data sizes, slower for large values - Use for: Metadata, identifiers, small structured data - Example: count=5, name="result", is_valid=True
KV_STORE: Store field value in a key-value store.
- Pros: Handles larger data, efficient storage and retrieval
- Cons: Not directly searchable, lazy-loaded when accessed
- Use for: Large strings, serialized data, binary blobs
- Example: Large text content, JSON data, file contents
NONE: Do not persist the field value.
- Only use when you know what you are doing
- Note: Values can be provided via ResourceFactory.create_resource(additional_data=...)
Example: ```python class MyResource(Resource): # Small searchable metadata - stored in database item_count = IntRField(storage=RFieldStorage.DATABASE)
# Large content - stored in KV store
description = StrRField(storage=RFieldStorage.KV_STORE)
# Temporary computed value - not persisted
is_processed = BoolRField(storage=RFieldStorage.NONE)
```