Skip to main content

Module paths

Module paths 

Source
Expand description

Cross-backend path and identifier operations.

Holds primitives shared by catalog backends: separator normalization, local path to URI conversion, object-store path constructors, identifier sanitization, and persistence-owned type-to-prefix traits for streaming/session writers. Backend-specific catalog paths are mapped in crate::catalog::types.

All path splitting in this module normalizes Windows \ separators first, so parsing behaves identically on every platform. Call sites must use these helpers instead of splitting raw paths on /.

Traits§

CatalogPathPrefix
Persistence-owned static path prefix used by streaming/session writers.

Functions§

extract_identifier_from_path
Extracts the identifier from a file path: typically the second-to-last path component.
extract_path_components
Extracts path components using platform-appropriate path parsing.
local_to_object_store_path
Converts a local PathBuf to an object store path string.
make_object_store_path
Joins a base path and components into an object-store path with forward slashes.
make_sql_safe_identifier
Makes an identifier safe for use in SQL table names.
normalize_path_separators
Normalizes Windows \ separators to /.
normalize_path_to_uri
Normalizes a path to URI format for consistent object store usage.
safe_directory_identifier
Normalizes a user-supplied identifier for use in directory paths.
urisafe_instrument_id
Converts an instrument ID to a URI-safe format by removing forward slashes and replacing carets with underscores. Some instrument IDs contain forward slashes (e.g., “BTC/USD”) which are not suitable for use in file paths.