1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Procedural macros for the Fletch database toolkit.
//!
//! Provides `#[derive(Entity)]` to generate `fletch_orm::Entity` trait
//! implementations from annotated structs.
use TokenStream;
/// Derive macro to generate `fletch_orm::Entity` trait implementation.
///
/// # Struct Attributes
///
/// - `#[fletch(table = "table_name")]`: Override the table name
/// (default: `snake_case` pluralized struct name).
///
/// # Field Attributes
///
/// - `#[fletch(id)]`: Mark the primary key field (required, exactly one).
/// - `#[fletch(skip)]`: Exclude a field from persistence.
/// - `#[fletch(rename = "col_name")]`: Override the column name.
///
/// # Example
///
/// ```ignore
/// #[derive(Entity)]
/// #[fletch(table = "users")]
/// pub struct User {
/// #[fletch(id)]
/// pub id: i64,
/// pub name: String,
/// #[fletch(skip)]
/// pub cached_display: String,
/// }
/// ```