Skip to content

Support enums? #8

@JosiahParry

Description

@JosiahParry

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,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions