Write TableAccessQuerySet for other tables. Create Id macro

This commit is contained in:
micialware committed 2026-08-30 22:15:03 +03:00
1 parent 9a5b64a4fe
commit d9bbf9e705
8 files changed
+184 -57

No files matched your search

+24 -3
View File
@@ -7,18 +7,18 @@ use log::info;
use rayon::prelude::*;
use rhai::{Engine, Scope};
use std::cmp::Ordering;
use std::collections::HashMap;
use std::marker::PhantomData;
use std::time::Instant;
use litemap::LiteMap;
#[derive(Clone, Debug)]
pub struct WordData {
pub id: Id,
pub group_id: Id,
pub key: String,
pub value: String,
pub tags: String,
pub additional: HashMap<String, String>,
pub group_id: Id,
pub additional: LiteMap<String, String>,
}
impl EntityData for WordData {
@@ -37,6 +37,16 @@ pub struct WordGroup {
pub name: String,
}
impl EntityData for WordGroup {
fn id(&self) -> Id {
self.id
}
fn set_id(&mut self, id: Id) {
self.id = id;
}
}
impl WordData {
pub fn new() -> Self {
Self {
@@ -155,6 +165,17 @@ pub struct CardState {
pub fsrs_memory: Option<MemoryState>,
pub fsrs_open_day: NaiveDate,
}
impl EntityData for CardState {
fn id(&self) -> Id {
self.id
}
fn set_id(&mut self, id: Id) {
self.id = id;
}
}
impl CardState {
pub fn update(&mut self, status: WordOpenMode) {
match status {