use crate::constants::TABLE_NAME;
use crate::core::db::data_frames::df_db::{self, with_df_db_manager};
use crate::error::OxenError;
use crate::model::{Schema, Workspace};
use crate::repositories;
use std::path::Path;
pub fn get_by_path(workspace: &Workspace, path: impl AsRef<Path>) -> Result<Schema, OxenError> {
let file_path = path.as_ref();
let staged_db_path = repositories::workspaces::data_frames::duckdb_path(workspace, file_path);
let df_schema = with_df_db_manager(&staged_db_path, |manager| {
manager.with_conn(|conn| Ok(df_db::get_schema(conn, TABLE_NAME)?))
})?;
Ok(df_schema)
}
pub use crate::core::v_latest::workspaces::data_frames::schemas::update_schema;