pub struct ModelSaver<B: StorageBackend> { /* private fields */ }Expand description
Model saver that uses a storage backend
Implementations§
Source§impl<B: StorageBackend> ModelSaver<B>
impl<B: StorageBackend> ModelSaver<B>
Sourcepub async fn save_table(
&self,
workspace_path: &str,
table: &TableData,
) -> Result<(), StorageError>
pub async fn save_table( &self, workspace_path: &str, table: &TableData, ) -> Result<(), StorageError>
Save a table to storage
Saves the table as a YAML file in the workspace’s tables/ directory.
The filename will be based on the table name if yaml_file_path is not provided.
Sourcepub async fn save_relationships(
&self,
workspace_path: &str,
relationships: &[RelationshipData],
) -> Result<(), StorageError>
pub async fn save_relationships( &self, workspace_path: &str, relationships: &[RelationshipData], ) -> Result<(), StorageError>
Save relationships to storage
Saves relationships to relationships.yaml in the workspace directory.
Note: Relationships are now stored within domain.yaml files, but this method
is kept for backward compatibility.
Sourcepub async fn save_domain(
&self,
workspace_path: &str,
domain: &Domain,
tables: &HashMap<Uuid, Table>,
odps_products: &HashMap<Uuid, ODPSDataProduct>,
cads_assets: &HashMap<Uuid, CADSAsset>,
) -> Result<(), StorageError>
pub async fn save_domain( &self, workspace_path: &str, domain: &Domain, tables: &HashMap<Uuid, Table>, odps_products: &HashMap<Uuid, ODPSDataProduct>, cads_assets: &HashMap<Uuid, CADSAsset>, ) -> Result<(), StorageError>
Save a domain to storage
Saves the domain as domain.yaml in a domain directory named after the domain.
Also saves all associated ODCS tables, ODPS products, and CADS assets within the domain directory.
Sourcepub async fn save_odps_product(
&self,
workspace_path: &str,
domain_name: &str,
product: &ODPSDataProduct,
) -> Result<(), StorageError>
pub async fn save_odps_product( &self, workspace_path: &str, domain_name: &str, product: &ODPSDataProduct, ) -> Result<(), StorageError>
Save an ODPS product to a domain directory
Saves the product as {product_name}.odps.yaml in the specified domain directory.
Sourcepub async fn save_cads_asset(
&self,
workspace_path: &str,
domain_name: &str,
asset: &CADSAsset,
) -> Result<(), StorageError>
pub async fn save_cads_asset( &self, workspace_path: &str, domain_name: &str, asset: &CADSAsset, ) -> Result<(), StorageError>
Save a CADS asset to a domain directory
Saves the asset as {asset_name}.cads.yaml in the specified domain directory.