use worker::wasm_bindgen::JsValue;
pub trait D1Model: Sized + for<'de> serde::Deserialize<'de> {
const TABLE: &'static str;
const COLUMNS: &'static [&'static str];
fn values(&self) -> Vec<JsValue>;
}
pub fn opt_js<T: Into<JsValue>>(val: Option<T>) -> JsValue {
val.map(Into::into).unwrap_or(JsValue::NULL)
}