use native_db::*; use native_model::{native_model, Model}; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Eq, PartialEq, Debug)] #[native_model(id = 1, version = 1)] #[native_db] struct Item { #[primary_key] id: u32, name: String, } // TODO: Test for other type enum tuple etc ... #[test] fn test_insert_my_item() { let item = Item { id: 1, name: "test".to_string(), }; let key = item.native_db_primary_key(); assert_eq!(key, 1_u32.to_key()); }