builder
¤
Classes:
-
FlureeSelectBuilder
–Builds Fluree select queries from Pydantic models.
-
HasModelConfig
–Protocol for objects that have a model_config attribute.
Functions:
-
from_pydantic
–Convert a Pydantic model to a Fluree select query structure.
FlureeSelectBuilder
dataclass
¤
FlureeSelectBuilder(
warning_manager: WarningManager = WarningManager(),
select: list[Any] = lambda: ["*"](),
_processed_models: set[type[BaseModel]] = set(),
)
Builds Fluree select queries from Pydantic models.
Example
class User(BaseModel):
... id: str
... name: str
builder = FlureeSelectBuilder()
query = builder.build(User)
assert query == ["*"]
Methods:
-
build
–Build a Fluree select query structure from a Pydantic model.
build
¤
Build a Fluree select query structure from a Pydantic model.
Raises:
-
MissingIdFieldError
–If the model is missing a required 'id' field
-
DeeplyNestedStructureError
–If the model contains unsupported deeply nested structures
-
ModelConfigError
–If there's an issue with the model configuration