liboxen 0.50.6

Oxen is a fast, unstructured data version control, to help version large machine learning datasets written in Rust.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;