ryzz icon indicating copy to clipboard operation
ryzz copied to clipboard

Support enums?

Open JosiahParry opened this issue 1 year ago • 0 comments

I'd like to be able to use an enum to specify a field. Ideally, I can be able to have an enum that I can use then that would get stored as a String in the table

use ryzz::*;
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize)]
enum ContentType {
    Shiny,
    Plumber,
    Rmd,
    Qmd,
}

#[table("content")]
struct Content {
    #[ryzz(pk)]
    id: String,
    name: String,
    entrypoint: String,
    slug: Option<String>,
    content_type: ContentType,
}

JosiahParry avatar Jun 15 '24 01:06 JosiahParry