pub async fn do_materialize(
_config: &Config,
tables: &Arc<ArcSwap<TableRegistry>>,
params: MaterializeParams,
) -> Result<MaterializeResult, MiniAppError>Expand description
Execute the row_materialize tool.
Selects rows from the target table, projects fields, serialises to the requested format, and writes the result to absolute filesystem path(s).
§Crux constraints enforced here
- Absolute path:
params.destis checked withPath::is_absolute()at step (a). Relative paths returnMaterializeDestRelativeimmediately. No sandbox constraint is applied to absolute paths. - SHA-256: every
MaterializeFileentry carries a 64-char hex SHA-256 digest, including whendry_run=true.
§Arguments
config— server mount configuration.tables— liveArcSwap-wrapped table registry.params— tool parameters.
§Returns
MaterializeResult on success (JSON-serialisable).
§Errors
MiniAppError::MaterializeDestRelative—destis not absolute.MiniAppError::MaterializeFieldUnknown— projected field not in schema.MiniAppError::MaterializeInvalidParam— incompatible parameter combination.MiniAppError::MaterializeRowNotFound—ByIdselector found no row.MiniAppError::MaterializeEmptyResult—ByFilterselector matched zero rows.MiniAppError::MaterializeFormatError— serialisation failure.MiniAppError::MaterializeDestInvalid— dest path problem or write_mode conflict.MiniAppError::MaterializeIo— filesystem write failure.MiniAppError::MaterializeSha256—spawn_blockingtask panic during SHA-256/write.