Skip to main content

lemmy_db_schema_file/
lib.rs

1use core::default::Default;
2#[cfg(feature = "full")]
3use diesel_derive_newtype::DieselNewType;
4use serde::{Deserialize, Serialize};
5
6pub mod enums;
7#[cfg(feature = "full")]
8pub mod joins;
9#[cfg(feature = "full")]
10pub mod schema;
11#[cfg(feature = "full")]
12pub mod table_impls;
13
14#[cfg(feature = "full")]
15pub mod aliases {
16  use crate::schema::{community_actions, instance_actions, local_user, person};
17  diesel::alias!(
18    community_actions as creator_community_actions: CreatorCommunityActions,
19    instance_actions as creator_home_instance_actions: CreatorHomeInstanceActions,
20    instance_actions as creator_community_instance_actions: CreatorCommunityInstanceActions,
21    instance_actions as creator_local_instance_actions: CreatorLocalInstanceActions,
22    instance_actions as my_instance_persons_actions: MyInstancePersonsActions,
23    local_user as creator_local_user: CreatorLocalUser,
24    person as person1: Person1,
25    person as person2: Person2,
26  );
27}
28
29#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Default, Serialize, Deserialize)]
30#[cfg_attr(feature = "full", derive(DieselNewType))]
31#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
32#[cfg_attr(feature = "ts-rs", ts(optional_fields, export))]
33/// The person id.
34pub struct PersonId(pub i32);
35
36#[derive(
37  Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default, Ord, PartialOrd,
38)]
39#[cfg_attr(feature = "full", derive(DieselNewType))]
40#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
41#[cfg_attr(feature = "ts-rs", ts(optional_fields, export))]
42/// The instance id.
43pub struct InstanceId(pub i32);
44
45impl InstanceId {
46  pub fn inner(self) -> i32 {
47    self.0
48  }
49}