Billy Chan 2eda8aa3f2
Drop the use of sea-strum and depends on the original strum with a tailored EnumIter provided (#1535)
* Update heck dependency

* Fix formatter error

* Drop the use of `sea-strum` and depends on the original `strum` with a tailored `EnumIter` provided

* fmt

* Depends on `strum` 0.23

* Depends on `strum` 0.24

* Source code adapted from https://github.com/Peternator7/strum

* Update LICENSE

---------

Co-authored-by: Sergei Ivankov <sergeiivankov@pm.me>
Co-authored-by: Sergei Ivankov <96142843+sergeiivankov@users.noreply.github.com>
Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2023-03-22 11:47:15 +08:00

35 lines
1023 B
Rust

pub mod derive_attr {
use bae::FromAttributes;
/// Attributes for Models and ActiveModels
#[derive(Default, FromAttributes)]
pub struct SeaOrm {
pub column: Option<syn::Ident>,
pub entity: Option<syn::Ident>,
pub model: Option<syn::Ident>,
pub primary_key: Option<syn::Ident>,
pub relation: Option<syn::Ident>,
pub schema_name: Option<syn::Lit>,
pub table_name: Option<syn::Lit>,
pub table_iden: Option<()>,
}
}
pub mod field_attr {
use bae::FromAttributes;
/// Operations for Models and ActiveModels
#[derive(Default, FromAttributes)]
pub struct SeaOrm {
pub belongs_to: Option<syn::Lit>,
pub has_one: Option<syn::Lit>,
pub has_many: Option<syn::Lit>,
pub on_update: Option<syn::Lit>,
pub on_delete: Option<syn::Lit>,
pub on_condition: Option<syn::Lit>,
pub from: Option<syn::Lit>,
pub to: Option<syn::Lit>,
pub fk_name: Option<syn::Lit>,
}
}