conundrum_db 0.1.2

Be less dum.
Documentation
use arrow_schema::{Field, Fields};
use conundrum_lang::ecosystem::db::db_traits::db_field::DatabaseField;
use serde::{Deserialize, Serialize};

// Because Lance refuses to serialize to all of arrow. If it
// wouldn't complicate the installation process for the end user or if I had
// some time on the internet to dedicate to the problem, I'd be doing this all
// with Postgres.
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct GenericValue<T: DatabaseField> {
    pub value: T,
}

impl<T: DatabaseField> DatabaseField for GenericValue<T> {
    fn field_definition(field_key: &'static str, nullable: bool) -> arrow_schema::Field {
        Field::new(field_key.to_string(),
                   arrow_schema::DataType::Struct(Fields::from(vec![T::field_definition("value", false)])),
                   nullable)
    }
}