Update macro to use #[index] attributes

- Also use proper types for index.
 - Update DB interface to be more flexible for index params

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2025-04-25 13:26:15 +02:00
parent dc93518a35
commit 96a1ecd974
10 changed files with 368 additions and 167 deletions

View File

@@ -8,7 +8,7 @@ use serde::{Serialize, Deserialize};
pub struct SimpleUser {
pub base_data: BaseModelData,
/// @index
#[index]
pub login: String,
pub full_name: String,
@@ -20,10 +20,10 @@ pub struct SimpleUser {
pub struct CustomUser {
pub base_data: BaseModelData,
/// @index(name = "user_name", key_type = "str")
#[index(name = "user_name")]
pub login_name: String,
/// @index(key_type = "bool")
#[index]
pub is_active: bool,
pub full_name: String,