]> Untitled Git - lemmy.git/commitdiff
Split up lemmy_db_views, put lemmy_rate_limit into lemmy_utils
authorFelix Ableitner <me@nutomic.com>
Mon, 21 Dec 2020 23:27:42 +0000 (00:27 +0100)
committerFelix Ableitner <me@nutomic.com>
Mon, 21 Dec 2020 23:34:54 +0000 (00:34 +0100)
99 files changed:
Cargo.lock
Cargo.toml
lemmy_api/Cargo.toml
lemmy_api/src/comment.rs
lemmy_api/src/community.rs
lemmy_api/src/lib.rs
lemmy_api/src/post.rs
lemmy_api/src/site.rs
lemmy_api/src/user.rs
lemmy_apub/Cargo.toml
lemmy_apub/src/activities/receive/comment.rs
lemmy_apub/src/activities/receive/comment_undo.rs
lemmy_apub/src/activities/receive/community.rs
lemmy_apub/src/activities/receive/post.rs
lemmy_apub/src/activities/receive/post_undo.rs
lemmy_apub/src/activities/receive/private_message.rs
lemmy_apub/src/activities/send/comment.rs
lemmy_apub/src/activities/send/community.rs
lemmy_apub/src/activities/send/post.rs
lemmy_apub/src/activities/send/private_message.rs
lemmy_apub/src/activities/send/user.rs
lemmy_apub/src/activity_queue.rs
lemmy_apub/src/extensions/group_extensions.rs
lemmy_apub/src/fetcher.rs
lemmy_apub/src/http/comment.rs
lemmy_apub/src/http/community.rs
lemmy_apub/src/http/mod.rs
lemmy_apub/src/http/post.rs
lemmy_apub/src/http/user.rs
lemmy_apub/src/inbox/community_inbox.rs
lemmy_apub/src/inbox/mod.rs
lemmy_apub/src/inbox/receive_for_community.rs
lemmy_apub/src/inbox/shared_inbox.rs
lemmy_apub/src/inbox/user_inbox.rs
lemmy_apub/src/lib.rs
lemmy_apub/src/objects/comment.rs
lemmy_apub/src/objects/community.rs
lemmy_apub/src/objects/mod.rs
lemmy_apub/src/objects/post.rs
lemmy_apub/src/objects/private_message.rs
lemmy_apub/src/objects/user.rs
lemmy_db_queries/Cargo.toml
lemmy_db_queries/src/aggregates/comment_aggregates.rs [moved from lemmy_db_aggregates/src/comment_aggregates.rs with 97% similarity]
lemmy_db_queries/src/aggregates/community_aggregates.rs [moved from lemmy_db_aggregates/src/community_aggregates.rs with 97% similarity]
lemmy_db_queries/src/aggregates/mod.rs [moved from lemmy_db_aggregates/src/lib.rs with 100% similarity]
lemmy_db_queries/src/aggregates/post_aggregates.rs [moved from lemmy_db_aggregates/src/post_aggregates.rs with 97% similarity]
lemmy_db_queries/src/aggregates/site_aggregates.rs [moved from lemmy_db_aggregates/src/site_aggregates.rs with 97% similarity]
lemmy_db_queries/src/aggregates/user_aggregates.rs [moved from lemmy_db_aggregates/src/user_aggregates.rs with 97% similarity]
lemmy_db_queries/src/lib.rs
lemmy_db_schema/src/source/comment_report.rs
lemmy_db_schema/src/source/post_report.rs
lemmy_db_views/Cargo.toml
lemmy_db_views/src/comment_report_view.rs
lemmy_db_views/src/comment_view.rs
lemmy_db_views/src/lib.rs
lemmy_db_views/src/post_report_view.rs
lemmy_db_views/src/post_view.rs
lemmy_db_views/src/private_message_view.rs
lemmy_db_views/src/site_view.rs
lemmy_db_views_actor/Cargo.toml [moved from lemmy_db_aggregates/Cargo.toml with 78% similarity]
lemmy_db_views_actor/src/community_follower_view.rs [moved from lemmy_db_views/src/community/community_follower_view.rs with 97% similarity]
lemmy_db_views_actor/src/community_moderator_view.rs [moved from lemmy_db_views/src/community/community_moderator_view.rs with 97% similarity]
lemmy_db_views_actor/src/community_user_ban_view.rs [moved from lemmy_db_views/src/community/community_user_ban_view.rs with 97% similarity]
lemmy_db_views_actor/src/community_view.rs [moved from lemmy_db_views/src/community/community_view.rs with 97% similarity]
lemmy_db_views_actor/src/lib.rs [moved from lemmy_db_views/src/community/mod.rs with 72% similarity]
lemmy_db_views_actor/src/user_mention_view.rs [moved from lemmy_db_views/src/user_mention_view.rs with 98% similarity]
lemmy_db_views_actor/src/user_view.rs [moved from lemmy_db_views/src/user_view.rs with 96% similarity]
lemmy_db_views_moderator/Cargo.toml [new file with mode: 0644]
lemmy_db_views_moderator/src/lib.rs [moved from lemmy_db_views/src/moderator/mod.rs with 100% similarity]
lemmy_db_views_moderator/src/mod_add_community_view.rs [moved from lemmy_db_views/src/moderator/mod_add_community_view.rs with 97% similarity]
lemmy_db_views_moderator/src/mod_add_view.rs [moved from lemmy_db_views/src/moderator/mod_add_view.rs with 96% similarity]
lemmy_db_views_moderator/src/mod_ban_from_community_view.rs [moved from lemmy_db_views/src/moderator/mod_ban_from_community_view.rs with 97% similarity]
lemmy_db_views_moderator/src/mod_ban_view.rs [moved from lemmy_db_views/src/moderator/mod_ban_view.rs with 96% similarity]
lemmy_db_views_moderator/src/mod_lock_post_view.rs [moved from lemmy_db_views/src/moderator/mod_lock_post_view.rs with 96% similarity]
lemmy_db_views_moderator/src/mod_remove_comment_view.rs [moved from lemmy_db_views/src/moderator/mod_remove_comment_view.rs with 97% similarity]
lemmy_db_views_moderator/src/mod_remove_community_view.rs [moved from lemmy_db_views/src/moderator/mod_remove_community_view.rs with 96% similarity]
lemmy_db_views_moderator/src/mod_remove_post_view.rs [moved from lemmy_db_views/src/moderator/mod_remove_post_view.rs with 96% similarity]
lemmy_db_views_moderator/src/mod_sticky_post_view.rs [moved from lemmy_db_views/src/moderator/mod_sticky_post_view.rs with 96% similarity]
lemmy_rate_limit/Cargo.toml [deleted file]
lemmy_structs/Cargo.toml
lemmy_structs/src/community.rs
lemmy_structs/src/lib.rs
lemmy_structs/src/post.rs
lemmy_structs/src/site.rs
lemmy_structs/src/user.rs
lemmy_utils/Cargo.toml
lemmy_utils/src/lib.rs
lemmy_utils/src/rate_limit/mod.rs [moved from lemmy_rate_limit/src/lib.rs with 98% similarity]
lemmy_utils/src/rate_limit/rate_limiter.rs [moved from lemmy_rate_limit/src/rate_limiter.rs with 98% similarity]
lemmy_websocket/Cargo.toml
lemmy_websocket/src/chat_server.rs
lemmy_websocket/src/lib.rs
src/code_migrations.rs
src/main.rs
src/routes/api.rs
src/routes/feeds.rs
src/routes/images.rs
src/routes/webfinger.rs
tests/integration_test.rs

index dd16aa97ff1b99c5e245b82f5b425384e18019a2..782458b1dd4d3865a236b50a5640e132a175850f 100644 (file)
@@ -1720,7 +1720,8 @@ dependencies = [
  "lemmy_db_queries",
  "lemmy_db_schema",
  "lemmy_db_views",
- "lemmy_rate_limit",
+ "lemmy_db_views_actor",
+ "lemmy_db_views_moderator",
  "lemmy_structs",
  "lemmy_utils",
  "lemmy_websocket",
@@ -1766,6 +1767,7 @@ dependencies = [
  "lemmy_db_queries",
  "lemmy_db_schema",
  "lemmy_db_views",
+ "lemmy_db_views_actor",
  "lemmy_structs",
  "lemmy_utils",
  "lemmy_websocket",
@@ -1785,17 +1787,6 @@ dependencies = [
  "uuid",
 ]
 
-[[package]]
-name = "lemmy_db_aggregates"
-version = "0.1.0"
-dependencies = [
- "chrono",
- "diesel",
- "lemmy_db_queries",
- "lemmy_db_schema",
- "serde 1.0.118",
-]
-
 [[package]]
 name = "lemmy_db_queries"
 version = "0.1.0"
@@ -1834,23 +1825,29 @@ name = "lemmy_db_views"
 version = "0.1.0"
 dependencies = [
  "diesel",
- "lemmy_db_aggregates",
  "lemmy_db_queries",
  "lemmy_db_schema",
  "serde 1.0.118",
 ]
 
 [[package]]
-name = "lemmy_rate_limit"
+name = "lemmy_db_views_actor"
 version = "0.1.0"
 dependencies = [
- "actix-web",
- "futures",
- "lemmy_utils",
- "log",
- "strum",
- "strum_macros",
- "tokio 0.3.6",
+ "diesel",
+ "lemmy_db_queries",
+ "lemmy_db_schema",
+ "serde 1.0.118",
+]
+
+[[package]]
+name = "lemmy_db_views_moderator"
+version = "0.1.0"
+dependencies = [
+ "diesel",
+ "lemmy_db_queries",
+ "lemmy_db_schema",
+ "serde 1.0.118",
 ]
 
 [[package]]
@@ -1874,11 +1871,11 @@ dependencies = [
  "lazy_static",
  "lemmy_api",
  "lemmy_apub",
- "lemmy_db_aggregates",
  "lemmy_db_queries",
  "lemmy_db_schema",
  "lemmy_db_views",
- "lemmy_rate_limit",
+ "lemmy_db_views_actor",
+ "lemmy_db_views_moderator",
  "lemmy_structs",
  "lemmy_utils",
  "lemmy_websocket",
@@ -1904,6 +1901,8 @@ dependencies = [
  "lemmy_db_queries",
  "lemmy_db_schema",
  "lemmy_db_views",
+ "lemmy_db_views_actor",
+ "lemmy_db_views_moderator",
  "lemmy_utils",
  "log",
  "serde 1.0.118",
@@ -1920,6 +1919,7 @@ dependencies = [
  "chrono",
  "comrak",
  "config",
+ "futures",
  "itertools",
  "lazy_static",
  "lettre",
@@ -1931,7 +1931,10 @@ dependencies = [
  "reqwest",
  "serde 1.0.118",
  "serde_json",
+ "strum",
+ "strum_macros",
  "thiserror",
+ "tokio 0.3.6",
  "url",
 ]
 
@@ -1946,7 +1949,6 @@ dependencies = [
  "diesel",
  "lemmy_db_queries",
  "lemmy_db_schema",
- "lemmy_rate_limit",
  "lemmy_structs",
  "lemmy_utils",
  "log",
index f6234416b34f9bd1d9583f9f43062589b366f689..ca2d291c37c5a5ad51248dfc478862a5efdd351e 100644 (file)
@@ -13,8 +13,10 @@ members = [
     "lemmy_utils",
     "lemmy_db_queries",
     "lemmy_db_schema",
+    "lemmy_db_views",
+    "lemmy_db_views_actor",
+    "lemmy_db_views_actor",
     "lemmy_structs",
-    "lemmy_rate_limit",
     "lemmy_websocket",
 ]
 
@@ -25,9 +27,9 @@ lemmy_utils = { path = "./lemmy_utils" }
 lemmy_db_schema = { path = "./lemmy_db_schema" }
 lemmy_db_queries = { path = "lemmy_db_queries" }
 lemmy_db_views = { path = "./lemmy_db_views" }
-lemmy_db_aggregates = { path = "./lemmy_db_aggregates" }
+lemmy_db_views_moderator = { path = "./lemmy_db_views_moderator" }
+lemmy_db_views_actor = { path = "lemmy_db_views_actor" }
 lemmy_structs = { path = "./lemmy_structs" }
-lemmy_rate_limit = { path = "./lemmy_rate_limit" }
 lemmy_websocket = { path = "./lemmy_websocket" }
 diesel = "1.4.5"
 diesel_migrations = "1.4.0"
index b9bda5990bf488bfd899b732cb5ab32414d76dd6..e0766df3a54407c58e29934f655befc50ed988e9 100644 (file)
@@ -14,8 +14,9 @@ lemmy_utils = { path = "../lemmy_utils" }
 lemmy_db_queries = { path = "../lemmy_db_queries" }
 lemmy_db_schema = { path = "../lemmy_db_schema" }
 lemmy_db_views = { path = "../lemmy_db_views" }
+lemmy_db_views_moderator = { path = "../lemmy_db_views_moderator" }
+lemmy_db_views_actor = { path = "../lemmy_db_views_actor" }
 lemmy_structs = { path = "../lemmy_structs" }
-lemmy_rate_limit = { path = "../lemmy_rate_limit" }
 lemmy_websocket = { path = "../lemmy_websocket" }
 diesel = "1.4.5"
 bcrypt = "0.9.0"
index eb8d68b7c566be4bc87468e99c260e2f1f6e5b17..840600cbc9700c88cc3c6ae75809b6ff4fdcb33c 100644 (file)
@@ -10,7 +10,7 @@ use crate::{
 };
 use actix_web::web::Data;
 use lemmy_apub::{ApubLikeableType, ApubObjectType};
-use lemmy_db::{
+use lemmy_db_queries::{
   source::comment::Comment_,
   Crud,
   Likeable,
index 8c2d9ad5a9456a5c522414cf017525156486cc21..f01e07404b8d8f541ff297f8a303b739f8faca82 100644 (file)
@@ -9,7 +9,7 @@ use crate::{
 use actix_web::web::Data;
 use anyhow::Context;
 use lemmy_apub::ActorType;
-use lemmy_db::{
+use lemmy_db_queries::{
   diesel_option_overwrite,
   source::{
     comment::Comment_,
@@ -27,13 +27,11 @@ use lemmy_db_schema::{
   naive_now,
   source::{comment::Comment, community::*, moderator::*, post::Post, site::*},
 };
-use lemmy_db_views::{
-  comment_view::CommentQueryBuilder,
-  community::{
-    community_follower_view::CommunityFollowerView,
-    community_moderator_view::CommunityModeratorView,
-    community_view::{CommunityQueryBuilder, CommunityView},
-  },
+use lemmy_db_views::comment_view::CommentQueryBuilder;
+use lemmy_db_views_actor::{
+  community_follower_view::CommunityFollowerView,
+  community_moderator_view::CommunityModeratorView,
+  community_view::{CommunityQueryBuilder, CommunityView},
   user_view::UserViewSafe,
 };
 use lemmy_structs::{blocking, community::*};
index 72c2316de2bd6dade2b13bff7e11ae5d9d41659a..c1dee7aa362ca09a425d95f8c6125bc0b6dd937a 100644 (file)
@@ -1,6 +1,6 @@
 use crate::claims::Claims;
 use actix_web::{web, web::Data};
-use lemmy_db::{
+use lemmy_db_queries::{
   source::{
     community::{CommunityModerator_, Community_},
     site::Site_,
@@ -14,7 +14,7 @@ use lemmy_db_schema::source::{
   site::Site,
   user::User_,
 };
-use lemmy_db_views::community::{
+use lemmy_db_views_actor::{
   community_user_ban_view::CommunityUserBanView,
   community_view::CommunityView,
 };
index 6f51497026be9d0ad1fcd6b8f8e556d221881c41..07a39732d3bbda0f11877bd20805b198f6472f3f 100644 (file)
@@ -10,7 +10,15 @@ use crate::{
 };
 use actix_web::web::Data;
 use lemmy_apub::{ApubLikeableType, ApubObjectType};
-use lemmy_db::{source::post::Post_, Crud, Likeable, ListingType, Reportable, Saveable, SortType};
+use lemmy_db_queries::{
+  source::post::Post_,
+  Crud,
+  Likeable,
+  ListingType,
+  Reportable,
+  Saveable,
+  SortType,
+};
 use lemmy_db_schema::{
   naive_now,
   source::{
@@ -21,10 +29,10 @@ use lemmy_db_schema::{
 };
 use lemmy_db_views::{
   comment_view::CommentQueryBuilder,
-  community::community_moderator_view::CommunityModeratorView,
   post_report_view::{PostReportQueryBuilder, PostReportView},
   post_view::{PostQueryBuilder, PostView},
 };
+use lemmy_db_views_actor::community_moderator_view::CommunityModeratorView;
 use lemmy_structs::{blocking, post::*};
 use lemmy_utils::{
   apub::{make_apub_endpoint, EndpointType},
index dcf35c007e22a4f8d4b2bf0312b8eaaccd630b99..2f5f4a3a9fef92ec7fd94e86d1fba468fe967c07 100644 (file)
@@ -9,7 +9,7 @@ use crate::{
 use actix_web::web::Data;
 use anyhow::Context;
 use lemmy_apub::fetcher::search_by_apub_id;
-use lemmy_db::{
+use lemmy_db_queries::{
   diesel_option_overwrite,
   source::{category::Category_, site::Site_},
   Crud,
@@ -26,22 +26,24 @@ use lemmy_db_schema::{
 };
 use lemmy_db_views::{
   comment_view::CommentQueryBuilder,
-  community::community_view::CommunityQueryBuilder,
-  moderator::{
-    mod_add_community_view::ModAddCommunityView,
-    mod_add_view::ModAddView,
-    mod_ban_from_community_view::ModBanFromCommunityView,
-    mod_ban_view::ModBanView,
-    mod_lock_post_view::ModLockPostView,
-    mod_remove_comment_view::ModRemoveCommentView,
-    mod_remove_community_view::ModRemoveCommunityView,
-    mod_remove_post_view::ModRemovePostView,
-    mod_sticky_post_view::ModStickyPostView,
-  },
   post_view::PostQueryBuilder,
   site_view::SiteView,
+};
+use lemmy_db_views_actor::{
+  community_view::CommunityQueryBuilder,
   user_view::{UserQueryBuilder, UserViewSafe},
 };
+use lemmy_db_views_moderator::{
+  mod_add_community_view::ModAddCommunityView,
+  mod_add_view::ModAddView,
+  mod_ban_from_community_view::ModBanFromCommunityView,
+  mod_ban_view::ModBanView,
+  mod_lock_post_view::ModLockPostView,
+  mod_remove_comment_view::ModRemoveCommentView,
+  mod_remove_community_view::ModRemoveCommunityView,
+  mod_remove_post_view::ModRemovePostView,
+  mod_sticky_post_view::ModStickyPostView,
+};
 use lemmy_structs::{blocking, site::*, user::Register};
 use lemmy_utils::{
   location_info,
index 90891154635674eeec7fae43932d010848617d24..91c3b11adb4171c0f3b8ef4dcf6e5b17bd02dcc9 100644 (file)
@@ -14,7 +14,7 @@ use bcrypt::verify;
 use captcha::{gen, Difficulty};
 use chrono::Duration;
 use lemmy_apub::ApubObjectType;
-use lemmy_db::{
+use lemmy_db_queries::{
   diesel_option_overwrite,
   source::{
     comment::Comment_,
@@ -49,13 +49,13 @@ use lemmy_db_schema::{
 use lemmy_db_views::{
   comment_report_view::CommentReportView,
   comment_view::CommentQueryBuilder,
-  community::{
-    community_follower_view::CommunityFollowerView,
-    community_moderator_view::CommunityModeratorView,
-  },
   post_report_view::PostReportView,
   post_view::PostQueryBuilder,
   private_message_view::{PrivateMessageQueryBuilder, PrivateMessageView},
+};
+use lemmy_db_views_actor::{
+  community_follower_view::CommunityFollowerView,
+  community_moderator_view::CommunityModeratorView,
   user_mention_view::{UserMentionQueryBuilder, UserMentionView},
   user_view::{UserViewDangerous, UserViewSafe},
 };
index a912f4487ec6a8e27b002ddeff358f8df047c5c1..a524daf142b70a0b12afc2dd5902a1e81b87e351 100644 (file)
@@ -13,6 +13,7 @@ lemmy_utils = { path = "../lemmy_utils" }
 lemmy_db_queries = { path = "../lemmy_db_queries" }
 lemmy_db_schema = { path = "../lemmy_db_schema" }
 lemmy_db_views = { path = "../lemmy_db_views" }
+lemmy_db_views_actor = { path = "../lemmy_db_views_actor" }
 lemmy_structs = { path = "../lemmy_structs" }
 lemmy_websocket = { path = "../lemmy_websocket" }
 diesel = "1.4.5"
index 483ef54fe3a2e7bb2d965ba088e5c3a9557dda5b..7ba3a05ca9d5d34de792dcfaa856b4cbaf006d4a 100644 (file)
@@ -4,7 +4,7 @@ use activitystreams::{
   base::ExtendsExt,
 };
 use anyhow::Context;
-use lemmy_db::{source::comment::Comment_, Crud, Likeable};
+use lemmy_db_queries::{source::comment::Comment_, Crud, Likeable};
 use lemmy_db_schema::source::{
   comment::{Comment, CommentLike, CommentLikeForm},
   post::Post,
index 4f845523d2d120943fa9f6f6dc98f7fd1ba84b4e..5dc021ad3753cf951f80d1b7cd8ecbb536361a75 100644 (file)
@@ -1,6 +1,6 @@
 use crate::activities::receive::get_actor_as_user;
 use activitystreams::activity::{Dislike, Like};
-use lemmy_db::{source::comment::Comment_, Likeable};
+use lemmy_db_queries::{source::comment::Comment_, Likeable};
 use lemmy_db_schema::source::comment::{Comment, CommentLike};
 use lemmy_db_views::comment_view::CommentView;
 use lemmy_structs::{blocking, comment::CommentResponse};
index f493a56322c95f037c82de00fdf8c8da8970c2e0..7f5523773cc5f5effd6aea09e0ef4ca30c9ccbd1 100644 (file)
@@ -4,9 +4,9 @@ use activitystreams::{
   base::{AnyBase, ExtendsExt},
 };
 use anyhow::Context;
-use lemmy_db::{source::community::Community_, ApubObject};
+use lemmy_db_queries::{source::community::Community_, ApubObject};
 use lemmy_db_schema::source::community::Community;
-use lemmy_db_views::community::community_view::CommunityView;
+use lemmy_db_views_actor::community_view::CommunityView;
 use lemmy_structs::{blocking, community::CommunityResponse};
 use lemmy_utils::{location_info, LemmyError};
 use lemmy_websocket::{messages::SendCommunityRoomMessage, LemmyContext, UserOperation};
index 2b46cf54acbf902dd5c0f8a10e80cf883b50bb4e..c35a02818dbc9611ad6e0e1585c8957c972c8c01 100644 (file)
@@ -4,7 +4,7 @@ use activitystreams::{
   prelude::*,
 };
 use anyhow::Context;
-use lemmy_db::{source::post::Post_, Likeable};
+use lemmy_db_queries::{source::post::Post_, Likeable};
 use lemmy_db_schema::source::post::{Post, PostLike, PostLikeForm};
 use lemmy_db_views::post_view::PostView;
 use lemmy_structs::{blocking, post::PostResponse};
index bf188a9f694b2087cd2f3d6858baff44bc9a2dba..0b9d6f4a4e1d2b44e0350de6c62e768d890e959a 100644 (file)
@@ -1,6 +1,6 @@
 use crate::activities::receive::get_actor_as_user;
 use activitystreams::activity::{Dislike, Like};
-use lemmy_db::{source::post::Post_, Likeable};
+use lemmy_db_queries::{source::post::Post_, Likeable};
 use lemmy_db_schema::source::post::{Post, PostLike};
 use lemmy_db_views::post_view::PostView;
 use lemmy_structs::{blocking, post::PostResponse};
index d2755094a08655171de23c502fc7920b6380fe19..bd21f4c7fbf4d3842da63cfe50b2f49cda7297d1 100644 (file)
@@ -13,7 +13,7 @@ use activitystreams::{
   public,
 };
 use anyhow::{anyhow, Context};
-use lemmy_db::source::private_message::PrivateMessage_;
+use lemmy_db_queries::source::private_message::PrivateMessage_;
 use lemmy_db_schema::source::private_message::PrivateMessage;
 use lemmy_db_views::private_message_view::PrivateMessageView;
 use lemmy_structs::{blocking, user::PrivateMessageResponse};
index 4ddd2d3217c60d38232abacd5a0e965c56a1347d..3f7a59de3731001ea16480cea2ec2442955b906d 100644 (file)
@@ -26,7 +26,7 @@ use activitystreams::{
 };
 use anyhow::anyhow;
 use itertools::Itertools;
-use lemmy_db::{Crud, DbPool};
+use lemmy_db_queries::{Crud, DbPool};
 use lemmy_db_schema::source::{comment::Comment, community::Community, post::Post, user::User_};
 use lemmy_structs::{blocking, WebFingerResponse};
 use lemmy_utils::{
index 1a4a4a5720934fbf0dc43f4c60fac74df171839a..e148b4e94d47e3d7dc56bf7e878db09e5622422b 100644 (file)
@@ -23,9 +23,9 @@ use activitystreams::{
 };
 use anyhow::Context;
 use itertools::Itertools;
-use lemmy_db::DbPool;
+use lemmy_db_queries::DbPool;
 use lemmy_db_schema::source::community::Community;
-use lemmy_db_views::community::community_follower_view::CommunityFollowerView;
+use lemmy_db_views_actor::community_follower_view::CommunityFollowerView;
 use lemmy_structs::blocking;
 use lemmy_utils::{location_info, settings::Settings, LemmyError};
 use lemmy_websocket::LemmyContext;
index 732a53c33fecb188fb1dcb7e52e6cf3be8619a39..4af40de28b2d58206a92c1c1eaa2c683a47dbda1 100644 (file)
@@ -21,7 +21,7 @@ use activitystreams::{
   prelude::*,
   public,
 };
-use lemmy_db::Crud;
+use lemmy_db_queries::Crud;
 use lemmy_db_schema::source::{community::Community, post::Post, user::User_};
 use lemmy_structs::blocking;
 use lemmy_utils::LemmyError;
index bcbb303bc5f83d7197b552c7446be1e3c1c270c0..d920f3decc511c781d971f11a92d9cbbab07266c 100644 (file)
@@ -16,7 +16,7 @@ use activitystreams::{
   },
   prelude::*,
 };
-use lemmy_db::Crud;
+use lemmy_db_queries::Crud;
 use lemmy_db_schema::source::{private_message::PrivateMessage, user::User_};
 use lemmy_structs::blocking;
 use lemmy_utils::LemmyError;
index cad20e9d95edd7f65a4ed7ac08ae97936d51cea9..049496f73689634255bb1c0a0e1dab2e3f540eed 100644 (file)
@@ -13,7 +13,7 @@ use activitystreams::{
   base::{AnyBase, BaseExt, ExtendsExt},
   object::ObjectExt,
 };
-use lemmy_db::{ApubObject, DbPool, Followable};
+use lemmy_db_queries::{ApubObject, DbPool, Followable};
 use lemmy_db_schema::source::{
   community::{Community, CommunityFollower, CommunityFollowerForm},
   user::User_,
index fe70d8e8bdae6e412074056d770b7b2408b08ce6..0dd7776fbccf07da8ee172264f6141fd04c2a301 100644 (file)
@@ -19,7 +19,7 @@ use background_jobs::{
   WorkerConfig,
 };
 use itertools::Itertools;
-use lemmy_db::DbPool;
+use lemmy_db_queries::DbPool;
 use lemmy_db_schema::source::{community::Community, user::User_};
 use lemmy_utils::{location_info, settings::Settings, LemmyError};
 use lemmy_websocket::LemmyContext;
index 2d8cfe799afc0100835f9311aa4843add1cb95bf..b9790b2317b7eadf70a1d6b7eabcd9e08674288e 100644 (file)
@@ -1,7 +1,7 @@
 use activitystreams::unparsed::UnparsedMutExt;
 use activitystreams_ext::UnparsedExtension;
 use diesel::PgConnection;
-use lemmy_db::Crud;
+use lemmy_db_queries::Crud;
 use lemmy_db_schema::source::category::Category;
 use lemmy_utils::LemmyError;
 use serde::{Deserialize, Serialize};
index e67fbc9694c2f659b41256d80e3a20bfb8431c12..4e1fa98a65bc375f9ff052668dacf7b4a0e0245e 100644 (file)
@@ -12,7 +12,7 @@ use activitystreams::{base::BaseExt, collection::OrderedCollection, prelude::*};
 use anyhow::{anyhow, Context};
 use chrono::NaiveDateTime;
 use diesel::result::Error::NotFound;
-use lemmy_db::{source::user::User, ApubObject, Crud, Joinable, SearchType};
+use lemmy_db_queries::{source::user::User, ApubObject, Crud, Joinable, SearchType};
 use lemmy_db_schema::{
   naive_now,
   source::{
@@ -22,12 +22,8 @@ use lemmy_db_schema::{
     user::User_,
   },
 };
-use lemmy_db_views::{
-  comment_view::CommentView,
-  community::community_view::CommunityView,
-  post_view::PostView,
-  user_view::UserViewSafe,
-};
+use lemmy_db_views::{comment_view::CommentView, post_view::PostView};
+use lemmy_db_views_actor::{community_view::CommunityView, user_view::UserViewSafe};
 use lemmy_structs::{blocking, site::SearchResponse};
 use lemmy_utils::{
   location_info,
index f71d542b063f85fb957c08b01028af7abab0b6ca..44397db600b555309cadd756a32066a0803805ac 100644 (file)
@@ -4,7 +4,7 @@ use crate::{
 };
 use actix_web::{body::Body, web, web::Path, HttpResponse};
 use diesel::result::Error::NotFound;
-use lemmy_db::Crud;
+use lemmy_db_queries::Crud;
 use lemmy_db_schema::source::comment::Comment;
 use lemmy_structs::blocking;
 use lemmy_utils::LemmyError;
index 011f2d88986045a099a0af78dd04acf7258c4432..668c90a3a83c7e83b2de4fad84b1e6ac649ee55a 100644 (file)
@@ -9,9 +9,9 @@ use activitystreams::{
   collection::{CollectionExt, OrderedCollection, UnorderedCollection},
 };
 use actix_web::{body::Body, web, HttpResponse};
-use lemmy_db::source::{community::Community_, post::Post_};
+use lemmy_db_queries::source::{community::Community_, post::Post_};
 use lemmy_db_schema::source::{community::Community, post::Post};
-use lemmy_db_views::community::community_follower_view::CommunityFollowerView;
+use lemmy_db_views_actor::community_follower_view::CommunityFollowerView;
 use lemmy_structs::blocking;
 use lemmy_utils::LemmyError;
 use lemmy_websocket::LemmyContext;
index 5d45a725f3731f73291424f0c6554dd36b5792b7..0d77aed7775965d66d155997191b5d9df1527f80 100644 (file)
@@ -1,6 +1,6 @@
 use crate::APUB_JSON_CONTENT_TYPE;
 use actix_web::{body::Body, web, HttpResponse};
-use lemmy_db::source::activity::Activity_;
+use lemmy_db_queries::source::activity::Activity_;
 use lemmy_db_schema::source::activity::Activity;
 use lemmy_structs::blocking;
 use lemmy_utils::{settings::Settings, LemmyError};
index 8ade352960ca753525af8df68686a09c8c87f4be..66adae3ac2b41f58deca69364636770fb548ef6e 100644 (file)
@@ -4,7 +4,7 @@ use crate::{
 };
 use actix_web::{body::Body, web, HttpResponse};
 use diesel::result::Error::NotFound;
-use lemmy_db::Crud;
+use lemmy_db_queries::Crud;
 use lemmy_db_schema::source::post::Post;
 use lemmy_structs::blocking;
 use lemmy_utils::LemmyError;
index b01347e0d31f0e1f1297b6c32932434f62233b6d..d3b1b4d4b101a86a632dcc4fcc3059c5b4f3239a 100644 (file)
@@ -9,7 +9,7 @@ use activitystreams::{
   collection::{CollectionExt, OrderedCollection},
 };
 use actix_web::{body::Body, web, HttpResponse};
-use lemmy_db::source::user::User;
+use lemmy_db_queries::source::user::User;
 use lemmy_db_schema::source::user::User_;
 use lemmy_structs::blocking;
 use lemmy_utils::LemmyError;
index e6d7b29c717ffc3d91c794799b555a05041e1132..1e44254c2b8c2d83b9d0d0a34b858e038ee84af5 100644 (file)
@@ -26,12 +26,12 @@ use activitystreams::{
 };
 use actix_web::{web, HttpRequest, HttpResponse};
 use anyhow::{anyhow, Context};
-use lemmy_db::{source::community::Community_, ApubObject, DbPool, Followable};
+use lemmy_db_queries::{source::community::Community_, ApubObject, DbPool, Followable};
 use lemmy_db_schema::source::{
   community::{Community, CommunityFollower, CommunityFollowerForm},
   user::User_,
 };
-use lemmy_db_views::community::community_user_ban_view::CommunityUserBanView;
+use lemmy_db_views_actor::community_user_ban_view::CommunityUserBanView;
 use lemmy_structs::blocking;
 use lemmy_utils::{location_info, LemmyError};
 use lemmy_websocket::LemmyContext;
index 9b20093420cb842b660920bea0a6725af04958fb..a91dd48eb3bfc19f3c16a61d3c013c3fb64d7445 100644 (file)
@@ -12,7 +12,7 @@ use activitystreams::{
 };
 use actix_web::HttpRequest;
 use anyhow::{anyhow, Context};
-use lemmy_db::{source::activity::Activity_, ApubObject, DbPool};
+use lemmy_db_queries::{source::activity::Activity_, ApubObject, DbPool};
 use lemmy_db_schema::source::{activity::Activity, community::Community, user::User_};
 use lemmy_structs::blocking;
 use lemmy_utils::{location_info, settings::Settings, LemmyError};
index 31c5efba148df32cb3fc48baa678b25041d3c885..934404242ed0a65ff74c72ec7c8859fab4a11c42 100644 (file)
@@ -41,7 +41,7 @@ use activitystreams::{
 };
 use anyhow::Context;
 use diesel::result::Error::NotFound;
-use lemmy_db::{ApubObject, Crud};
+use lemmy_db_queries::{ApubObject, Crud};
 use lemmy_db_schema::source::{comment::Comment, post::Post, site::Site};
 use lemmy_structs::blocking;
 use lemmy_utils::{location_info, LemmyError};
index d6c08a3101533f5ad37a2aeefabd50a98edcf667..f9b9bfc01a00b620f1bb4f9f2983b260a92df70e 100644 (file)
@@ -15,7 +15,7 @@ use crate::{
 use activitystreams::{activity::ActorAndObject, prelude::*};
 use actix_web::{web, HttpRequest, HttpResponse};
 use anyhow::Context;
-use lemmy_db::{ApubObject, DbPool};
+use lemmy_db_queries::{ApubObject, DbPool};
 use lemmy_db_schema::source::community::Community;
 use lemmy_structs::blocking;
 use lemmy_utils::{location_info, LemmyError};
index a9ca4b9444a938c8861a222c05043f8c865ea87d..49c66dc7aa7b81676787a5f677c41abca45bd852 100644 (file)
@@ -48,7 +48,7 @@ use activitystreams::{
 use actix_web::{web, HttpRequest, HttpResponse};
 use anyhow::{anyhow, Context};
 use diesel::NotFound;
-use lemmy_db::{source::user::User, ApubObject, Followable};
+use lemmy_db_queries::{source::user::User, ApubObject, Followable};
 use lemmy_db_schema::source::{
   community::{Community, CommunityFollower},
   private_message::PrivateMessage,
index 44786d1713a25318c24fae836c6a63db99522ce7..6f0d41c8aed6b15e5d6a17155a10205f5fa14080 100644 (file)
@@ -22,7 +22,7 @@ use activitystreams::{
 };
 use activitystreams_ext::{Ext1, Ext2};
 use anyhow::{anyhow, Context};
-use lemmy_db::{source::activity::Activity_, DbPool};
+use lemmy_db_queries::{source::activity::Activity_, DbPool};
 use lemmy_db_schema::source::{activity::Activity, user::User_};
 use lemmy_structs::blocking;
 use lemmy_utils::{location_info, settings::Settings, LemmyError};
index e922724856be9b768e1c5ccf2d8a6b8d83fda88a..c02055c4534071c090a257c1cf3a0958574bf5b8 100644 (file)
@@ -23,7 +23,7 @@ use activitystreams::{
   prelude::*,
 };
 use anyhow::{anyhow, Context};
-use lemmy_db::{Crud, DbPool};
+use lemmy_db_queries::{Crud, DbPool};
 use lemmy_db_schema::source::{
   comment::{Comment, CommentForm},
   community::Community,
index f4910716a053adb9c0c2e3018f15f684e9bd7af2..39abcd1f31354425f0691d44f31e7bcb0771ba6a 100644 (file)
@@ -22,12 +22,12 @@ use activitystreams::{
 };
 use activitystreams_ext::Ext2;
 use anyhow::Context;
-use lemmy_db::DbPool;
+use lemmy_db_queries::DbPool;
 use lemmy_db_schema::{
   naive_now,
   source::community::{Community, CommunityForm},
 };
-use lemmy_db_views::community::community_moderator_view::CommunityModeratorView;
+use lemmy_db_views_actor::community_moderator_view::CommunityModeratorView;
 use lemmy_structs::blocking;
 use lemmy_utils::{
   location_info,
index 898c50f31421f122095e7875af7243d49789a4e9..9e13782c95c0caf85b3598fb079b5d86ee55a839 100644 (file)
@@ -11,7 +11,7 @@ use activitystreams::{
 };
 use anyhow::{anyhow, Context};
 use chrono::NaiveDateTime;
-use lemmy_db::{ApubObject, Crud, DbPool};
+use lemmy_db_queries::{ApubObject, Crud, DbPool};
 use lemmy_structs::blocking;
 use lemmy_utils::{location_info, settings::Settings, utils::convert_datetime, LemmyError};
 use lemmy_websocket::LemmyContext;
index 499ac8020a97ef5daed0511ae3296a78f6b1db19..fa1adfc8437bd8984ba2cc5ce15f6886813ee099 100644 (file)
@@ -20,7 +20,7 @@ use activitystreams::{
 };
 use activitystreams_ext::Ext1;
 use anyhow::Context;
-use lemmy_db::{Crud, DbPool};
+use lemmy_db_queries::{Crud, DbPool};
 use lemmy_db_schema::source::{
   community::Community,
   post::{Post, PostForm},
index 34f37c4cd1c6a2bbcfd412065823c1fe353566a6..db5a06109a83264e526e4c316c3118b171c8422b 100644 (file)
@@ -19,7 +19,7 @@ use activitystreams::{
   prelude::*,
 };
 use anyhow::Context;
-use lemmy_db::{Crud, DbPool};
+use lemmy_db_queries::{Crud, DbPool};
 use lemmy_db_schema::source::{
   private_message::{PrivateMessage, PrivateMessageForm},
   user::User_,
index 3ec1548d4a1b272d40a75ba948916fc88e89a88a..aad407f30bdf5dc6f27bcbea2eb53619fe9bd1d1 100644 (file)
@@ -18,7 +18,7 @@ use activitystreams::{
 };
 use activitystreams_ext::Ext1;
 use anyhow::Context;
-use lemmy_db::{ApubObject, DbPool};
+use lemmy_db_queries::{ApubObject, DbPool};
 use lemmy_db_schema::{
   naive_now,
   source::user::{UserForm, User_},
index eb633c7d1b1ca950cc7183b684b36abb278d5489..f39d89b02eab5622dbd66f59a87edfd437fd7687 100644 (file)
@@ -4,7 +4,7 @@ version = "0.1.0"
 edition = "2018"
 
 [lib]
-name = "lemmy_db"
+name = "lemmy_db_queries"
 path = "src/lib.rs"
 
 [dependencies]
similarity index 97%
rename from lemmy_db_aggregates/src/comment_aggregates.rs
rename to lemmy_db_queries/src/aggregates/comment_aggregates.rs
index 611ec287c3698d5004a5c01a479db35157f56ce2..f6da44b0ce0829a95d7844511361eea116ecbed6 100644 (file)
@@ -22,8 +22,14 @@ impl CommentAggregates {
 
 #[cfg(test)]
 mod tests {
-  use crate::comment_aggregates::CommentAggregates;
-  use lemmy_db::{establish_unpooled_connection, Crud, Likeable, ListingType, SortType};
+  use crate::{
+    aggregates::comment_aggregates::CommentAggregates,
+    establish_unpooled_connection,
+    Crud,
+    Likeable,
+    ListingType,
+    SortType,
+  };
   use lemmy_db_schema::source::{
     comment::{Comment, CommentForm, CommentLike, CommentLikeForm},
     community::{Community, CommunityForm},
similarity index 97%
rename from lemmy_db_aggregates/src/community_aggregates.rs
rename to lemmy_db_queries/src/aggregates/community_aggregates.rs
index d6491546ce8fc5eb4212098af0e9c8d9be126a1a..f34bd88b6429859c4d5758989996ed65bb8e6fe4 100644 (file)
@@ -22,8 +22,14 @@ impl CommunityAggregates {
 
 #[cfg(test)]
 mod tests {
-  use crate::community_aggregates::CommunityAggregates;
-  use lemmy_db::{establish_unpooled_connection, Crud, Followable, ListingType, SortType};
+  use crate::{
+    aggregates::community_aggregates::CommunityAggregates,
+    establish_unpooled_connection,
+    Crud,
+    Followable,
+    ListingType,
+    SortType,
+  };
   use lemmy_db_schema::source::{
     comment::{Comment, CommentForm},
     community::{Community, CommunityFollower, CommunityFollowerForm, CommunityForm},
similarity index 97%
rename from lemmy_db_aggregates/src/post_aggregates.rs
rename to lemmy_db_queries/src/aggregates/post_aggregates.rs
index e2d9140856f128f0ff64a4593e88821c098dc985..5cfe0fdc85c94068a24bc2f664185fa3e08c2351 100644 (file)
@@ -24,8 +24,14 @@ impl PostAggregates {
 
 #[cfg(test)]
 mod tests {
-  use crate::post_aggregates::PostAggregates;
-  use lemmy_db::{establish_unpooled_connection, Crud, Likeable, ListingType, SortType};
+  use crate::{
+    aggregates::post_aggregates::PostAggregates,
+    establish_unpooled_connection,
+    Crud,
+    Likeable,
+    ListingType,
+    SortType,
+  };
   use lemmy_db_schema::source::{
     comment::{Comment, CommentForm},
     community::{Community, CommunityForm},
similarity index 97%
rename from lemmy_db_aggregates/src/site_aggregates.rs
rename to lemmy_db_queries/src/aggregates/site_aggregates.rs
index 559c5b53da53331b99ed1ee14ba2572350189316..b12e2b60af45ed7ef6ef74821e9c993f741b916c 100644 (file)
@@ -21,8 +21,13 @@ impl SiteAggregates {
 
 #[cfg(test)]
 mod tests {
-  use crate::site_aggregates::SiteAggregates;
-  use lemmy_db::{establish_unpooled_connection, Crud, ListingType, SortType};
+  use crate::{
+    aggregates::site_aggregates::SiteAggregates,
+    establish_unpooled_connection,
+    Crud,
+    ListingType,
+    SortType,
+  };
   use lemmy_db_schema::source::{
     comment::{Comment, CommentForm},
     community::{Community, CommunityForm},
similarity index 97%
rename from lemmy_db_aggregates/src/user_aggregates.rs
rename to lemmy_db_queries/src/aggregates/user_aggregates.rs
index cf5dfe69e73438e9bc9067a25dab5bf291f203ea..f1170456745d0f6a65f6e531d2654d95379ffb63 100644 (file)
@@ -23,8 +23,14 @@ impl UserAggregates {
 
 #[cfg(test)]
 mod tests {
-  use crate::user_aggregates::UserAggregates;
-  use lemmy_db::{establish_unpooled_connection, Crud, Likeable, ListingType, SortType};
+  use crate::{
+    aggregates::user_aggregates::UserAggregates,
+    establish_unpooled_connection,
+    Crud,
+    Likeable,
+    ListingType,
+    SortType,
+  };
   use lemmy_db_schema::source::{
     comment::{Comment, CommentForm, CommentLike, CommentLikeForm},
     community::{Community, CommunityForm},
index 6f4c62c7fcad0e462401feefba59116452f3cca8..b9dbc09d52b5da22f6fed0d40de199b51c212b52 100644 (file)
@@ -14,6 +14,7 @@ use regex::Regex;
 use serde::{Deserialize, Serialize};
 use std::{env, env::VarError};
 
+pub mod aggregates;
 pub mod source;
 
 pub type DbPool = diesel::r2d2::Pool<diesel::r2d2::ConnectionManager<diesel::PgConnection>>;
@@ -136,6 +137,13 @@ pub trait ToSafe {
   fn safe_columns_tuple() -> Self::SafeColumns;
 }
 
+pub trait ViewToVec {
+  type DbTuple;
+  fn to_vec(tuple: Vec<Self::DbTuple>) -> Vec<Self>
+  where
+    Self: Sized;
+}
+
 pub fn get_database_url_from_env() -> Result<String, VarError> {
   env::var("LEMMY_DATABASE_URL")
 }
index d94fed578cc38bbc35b35471e16a82d2bc0fa41e..ec53408d125a13e677a8df257d7e9af856418695 100644 (file)
@@ -1,7 +1,9 @@
 use crate::{schema::comment_report, source::comment::Comment};
 use serde::{Deserialize, Serialize};
 
-#[derive(Identifiable, Queryable, Associations, PartialEq, Serialize, Deserialize, Debug, Clone)]
+#[derive(
+  Identifiable, Queryable, Associations, PartialEq, Serialize, Deserialize, Debug, Clone,
+)]
 #[belongs_to(Comment)]
 #[table_name = "comment_report"]
 pub struct CommentReport {
index 608104dbc90dcf14bf8796f54d1de1919a6ea98a..b75fb954a078cc1a6bc77b01d8a2836523d68298 100644 (file)
@@ -1,7 +1,9 @@
 use crate::{schema::post_report, source::post::Post};
 use serde::{Deserialize, Serialize};
 
-#[derive(Identifiable, Queryable, Associations, PartialEq, Serialize, Deserialize, Debug, Clone)]
+#[derive(
+  Identifiable, Queryable, Associations, PartialEq, Serialize, Deserialize, Debug, Clone,
+)]
 #[belongs_to(Post)]
 #[table_name = "post_report"]
 pub struct PostReport {
index 86c7ada158c92525924ef8c329dfd7a1189a2430..1353ddf3a610742cc5bbebeab35f829bba04859b 100644 (file)
@@ -6,6 +6,5 @@ edition = "2018"
 [dependencies]
 lemmy_db_queries = { path = "../lemmy_db_queries" }
 lemmy_db_schema = { path = "../lemmy_db_schema" }
-lemmy_db_aggregates = { path = "../lemmy_db_aggregates" }
 diesel = { version = "1.4.5", features = ["postgres","chrono","r2d2","serde_json"] }
 serde = { version = "1.0.118", features = ["derive"] }
\ No newline at end of file
index fa795a0bfa086b035fb4aadeeb0c5d7961821560..8e974f16e004668036d895422070f01f1cfbe9c1 100644 (file)
@@ -1,6 +1,5 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{limit_and_offset, MaybeOptional, ToSafe};
+use lemmy_db_queries::{limit_and_offset, MaybeOptional, ToSafe, ViewToVec};
 use lemmy_db_schema::{
   schema::{comment, comment_report, community, post, user_, user_alias_1, user_alias_2},
   source::{
index 3101fcea81cff9803bd802c6969485fa186e4c42..064a8d4fa0ec74510c15da713a98f8e95ba11009 100644 (file)
@@ -1,6 +1,6 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{
+use lemmy_db_queries::{
+  aggregates::comment_aggregates::CommentAggregates,
   functions::hot_rank,
   fuzzy_search,
   limit_and_offset,
@@ -8,8 +8,8 @@ use lemmy_db::{
   MaybeOptional,
   SortType,
   ToSafe,
+  ViewToVec,
 };
-use lemmy_db_aggregates::comment_aggregates::CommentAggregates;
 use lemmy_db_schema::{
   schema::{
     comment,
@@ -419,8 +419,14 @@ impl ViewToVec for CommentView {
 #[cfg(test)]
 mod tests {
   use crate::comment_view::*;
-  use lemmy_db::{establish_unpooled_connection, Crud, Likeable, ListingType, SortType};
-  use lemmy_db_aggregates::comment_aggregates::CommentAggregates;
+  use lemmy_db_queries::{
+    aggregates::comment_aggregates::CommentAggregates,
+    establish_unpooled_connection,
+    Crud,
+    Likeable,
+    ListingType,
+    SortType,
+  };
   use lemmy_db_schema::source::{comment::*, community::*, post::*, user::*};
 
   #[test]
index 3cac0bd3d8f250e827b74c3838ffad9b082a5f3b..b46ec5a4645f32f852ae4902c4ea830a3d1f6860 100644 (file)
@@ -1,17 +1,6 @@
 pub mod comment_report_view;
 pub mod comment_view;
-pub mod community;
-pub mod moderator;
 pub mod post_report_view;
 pub mod post_view;
 pub mod private_message_view;
 pub mod site_view;
-pub mod user_mention_view;
-pub mod user_view;
-
-pub(crate) trait ViewToVec {
-  type DbTuple;
-  fn to_vec(tuple: Vec<Self::DbTuple>) -> Vec<Self>
-  where
-    Self: Sized;
-}
index 3e0ef3d68915e9f848647f48e7fd498e829d6a17..4f2db6bd275842b6f59de1af7482079a7e5172f9 100644 (file)
@@ -1,6 +1,5 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{limit_and_offset, MaybeOptional, ToSafe};
+use lemmy_db_queries::{limit_and_offset, MaybeOptional, ToSafe, ViewToVec};
 use lemmy_db_schema::{
   schema::{community, post, post_report, user_, user_alias_1, user_alias_2},
   source::{
index fe11592742516ad4bf590b79b3bad3266062d9e0..9ce1af72ee52a5517693d438ca80e7f59a688f5c 100644 (file)
@@ -1,6 +1,6 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{
+use lemmy_db_queries::{
+  aggregates::post_aggregates::PostAggregates,
   functions::hot_rank,
   fuzzy_search,
   limit_and_offset,
@@ -8,8 +8,8 @@ use lemmy_db::{
   MaybeOptional,
   SortType,
   ToSafe,
+  ViewToVec,
 };
-use lemmy_db_aggregates::post_aggregates::PostAggregates;
 use lemmy_db_schema::{
   schema::{
     community,
@@ -407,8 +407,14 @@ impl ViewToVec for PostView {
 #[cfg(test)]
 mod tests {
   use crate::post_view::{PostQueryBuilder, PostView};
-  use lemmy_db::{establish_unpooled_connection, Crud, Likeable, ListingType, SortType};
-  use lemmy_db_aggregates::post_aggregates::PostAggregates;
+  use lemmy_db_queries::{
+    aggregates::post_aggregates::PostAggregates,
+    establish_unpooled_connection,
+    Crud,
+    Likeable,
+    ListingType,
+    SortType,
+  };
   use lemmy_db_schema::source::{community::*, post::*, user::*};
 
   #[test]
index 62cb78987eab121d522f582ecb3fbb6afd4c12ad..945a46295f30c51f4511b237ce44a6078be811d8 100644 (file)
@@ -1,6 +1,5 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{limit_and_offset, MaybeOptional, ToSafe};
+use lemmy_db_queries::{limit_and_offset, MaybeOptional, ToSafe, ViewToVec};
 use lemmy_db_schema::{
   schema::{private_message, user_, user_alias_1},
   source::{
index a4c533e05ece1aba0a5d60857b968b0501d21f04..c04e85e9c8cf079e007ce8c670301e880b631080 100644 (file)
@@ -1,6 +1,5 @@
 use diesel::{result::Error, *};
-use lemmy_db::ToSafe;
-use lemmy_db_aggregates::site_aggregates::SiteAggregates;
+use lemmy_db_queries::{aggregates::site_aggregates::SiteAggregates, ToSafe};
 use lemmy_db_schema::{
   schema::{site, site_aggregates, user_},
   source::{
similarity index 78%
rename from lemmy_db_aggregates/Cargo.toml
rename to lemmy_db_views_actor/Cargo.toml
index 6fdd77fded9cc703b9ea7f9fbc759eeb347da2e2..92c2aafe9a909aac4457c2dcf94614c65285412a 100644 (file)
@@ -1,11 +1,10 @@
 [package]
-name = "lemmy_db_aggregates"
+name = "lemmy_db_views_actor"
 version = "0.1.0"
 edition = "2018"
 
 [dependencies]
-lemmy_db_schema = { path = "../lemmy_db_schema" }
 lemmy_db_queries = { path = "../lemmy_db_queries" }
+lemmy_db_schema = { path = "../lemmy_db_schema" }
 diesel = { version = "1.4.5", features = ["postgres","chrono","r2d2","serde_json"] }
 serde = { version = "1.0.118", features = ["derive"] }
-chrono = { version = "0.4.19", features = ["serde"] }
similarity index 97%
rename from lemmy_db_views/src/community/community_follower_view.rs
rename to lemmy_db_views_actor/src/community_follower_view.rs
index 9837624cbd0b2ec022e5a7a5d1d2afada213e3a7..a281a3feb9e133eb62afca0ed282625fc380f56e 100644 (file)
@@ -1,6 +1,5 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::ToSafe;
+use lemmy_db_queries::{ToSafe, ViewToVec};
 use lemmy_db_schema::{
   schema::{community, community_follower, user_},
   source::{
similarity index 97%
rename from lemmy_db_views/src/community/community_moderator_view.rs
rename to lemmy_db_views_actor/src/community_moderator_view.rs
index 490105d8bbad7bbf8d2a6ddc9dfd20606bddd0ae..30cbeb211f840a08ebc5a2d22e3c6fd52edc6780 100644 (file)
@@ -1,6 +1,5 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::ToSafe;
+use lemmy_db_queries::{ToSafe, ViewToVec};
 use lemmy_db_schema::{
   schema::{community, community_moderator, user_},
   source::{
similarity index 97%
rename from lemmy_db_views/src/community/community_user_ban_view.rs
rename to lemmy_db_views_actor/src/community_user_ban_view.rs
index ddc902766737b50006cbc43399c9582a1952dcb3..d0a925848f9ec38d2ae4d6458f8f751d2e5995ba 100644 (file)
@@ -1,5 +1,5 @@
 use diesel::{result::Error, *};
-use lemmy_db::ToSafe;
+use lemmy_db_queries::ToSafe;
 use lemmy_db_schema::{
   schema::{community, community_user_ban, user_},
   source::{
similarity index 97%
rename from lemmy_db_views/src/community/community_view.rs
rename to lemmy_db_views_actor/src/community_view.rs
index fe87e2c786888d2204d7fbb75bbcad5b353ef78d..d96b3aa995b4a3bc252b0bdb357f5993a5289673 100644 (file)
@@ -1,18 +1,15 @@
-use crate::{
-  community::community_moderator_view::CommunityModeratorView,
-  user_view::UserViewSafe,
-  ViewToVec,
-};
+use crate::{community_moderator_view::CommunityModeratorView, user_view::UserViewSafe};
 use diesel::{result::Error, *};
-use lemmy_db::{
+use lemmy_db_queries::{
+  aggregates::community_aggregates::CommunityAggregates,
   functions::hot_rank,
   fuzzy_search,
   limit_and_offset,
   MaybeOptional,
   SortType,
   ToSafe,
+  ViewToVec,
 };
-use lemmy_db_aggregates::community_aggregates::CommunityAggregates;
 use lemmy_db_schema::{
   schema::{category, community, community_aggregates, community_follower, user_},
   source::{
similarity index 72%
rename from lemmy_db_views/src/community/mod.rs
rename to lemmy_db_views_actor/src/lib.rs
index 491dde7f5898285d62ba74988d04cbd85935f300..a2ac31937cb12da1f59887e80ff3ce043136ff31 100644 (file)
@@ -2,3 +2,5 @@ pub mod community_follower_view;
 pub mod community_moderator_view;
 pub mod community_user_ban_view;
 pub mod community_view;
+pub mod user_mention_view;
+pub mod user_view;
similarity index 98%
rename from lemmy_db_views/src/user_mention_view.rs
rename to lemmy_db_views_actor/src/user_mention_view.rs
index f6afd298a15bec143aad939c0ce7236283e28829..fd870c0582e97646a6b51fea1b768e045b2831df 100644 (file)
@@ -1,7 +1,13 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{functions::hot_rank, limit_and_offset, MaybeOptional, SortType, ToSafe};
-use lemmy_db_aggregates::comment_aggregates::CommentAggregates;
+use lemmy_db_queries::{
+  aggregates::comment_aggregates::CommentAggregates,
+  functions::hot_rank,
+  limit_and_offset,
+  MaybeOptional,
+  SortType,
+  ToSafe,
+  ViewToVec,
+};
 use lemmy_db_schema::{
   schema::{
     comment,
similarity index 96%
rename from lemmy_db_views/src/user_view.rs
rename to lemmy_db_views_actor/src/user_view.rs
index 5e5e7f2c1713985ee1ae4d863e96bd5da02d68ba..4412b4fe66dc4d318ced08db1dc1f3bccb43a305 100644 (file)
@@ -1,7 +1,13 @@
-use crate::ViewToVec;
 use diesel::{dsl::*, result::Error, *};
-use lemmy_db::{fuzzy_search, limit_and_offset, MaybeOptional, SortType, ToSafe};
-use lemmy_db_aggregates::user_aggregates::UserAggregates;
+use lemmy_db_queries::{
+  aggregates::user_aggregates::UserAggregates,
+  fuzzy_search,
+  limit_and_offset,
+  MaybeOptional,
+  SortType,
+  ToSafe,
+  ViewToVec,
+};
 use lemmy_db_schema::{
   schema::{user_, user_aggregates},
   source::user::{UserSafe, User_},
diff --git a/lemmy_db_views_moderator/Cargo.toml b/lemmy_db_views_moderator/Cargo.toml
new file mode 100644 (file)
index 0000000..7df6844
--- /dev/null
@@ -0,0 +1,10 @@
+[package]
+name = "lemmy_db_views_moderator"
+version = "0.1.0"
+edition = "2018"
+
+[dependencies]
+lemmy_db_queries = { path = "../lemmy_db_queries" }
+lemmy_db_schema = { path = "../lemmy_db_schema" }
+diesel = { version = "1.4.5", features = ["postgres","chrono","r2d2","serde_json"] }
+serde = { version = "1.0.118", features = ["derive"] }
similarity index 97%
rename from lemmy_db_views/src/moderator/mod_add_community_view.rs
rename to lemmy_db_views_moderator/src/mod_add_community_view.rs
index 606ee51e8badc465dbf2a62a102fbab1e5a397a1..a95785834cb0e9444065947caf32715f278e0275 100644 (file)
@@ -1,6 +1,5 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{limit_and_offset, ToSafe};
+use lemmy_db_queries::{limit_and_offset, ToSafe, ViewToVec};
 use lemmy_db_schema::{
   schema::{community, mod_add_community, user_, user_alias_1},
   source::{
similarity index 96%
rename from lemmy_db_views/src/moderator/mod_add_view.rs
rename to lemmy_db_views_moderator/src/mod_add_view.rs
index efe33fd3c79b2c23963d3b3075ff02233e496280..9e2507b28ea79f2ebd033681cddf5f5669fbfe6d 100644 (file)
@@ -1,6 +1,5 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{limit_and_offset, ToSafe};
+use lemmy_db_queries::{limit_and_offset, ToSafe, ViewToVec};
 use lemmy_db_schema::{
   schema::{mod_add, user_, user_alias_1},
   source::{
similarity index 97%
rename from lemmy_db_views/src/moderator/mod_ban_from_community_view.rs
rename to lemmy_db_views_moderator/src/mod_ban_from_community_view.rs
index 430259a41795d936c1493bdbc8072b1e2f3cd6d1..b914127b8c8a32ae6ed1c51d14f32401d86ff0be 100644 (file)
@@ -1,6 +1,5 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{limit_and_offset, ToSafe};
+use lemmy_db_queries::{limit_and_offset, ToSafe, ViewToVec};
 use lemmy_db_schema::{
   schema::{community, mod_ban_from_community, user_, user_alias_1},
   source::{
similarity index 96%
rename from lemmy_db_views/src/moderator/mod_ban_view.rs
rename to lemmy_db_views_moderator/src/mod_ban_view.rs
index f61a04219dee381ed4c576ced966fe6f37ed2285..730212fa1923afa081047e08eb1d5edb462e8077 100644 (file)
@@ -1,6 +1,5 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{limit_and_offset, ToSafe};
+use lemmy_db_queries::{limit_and_offset, ToSafe, ViewToVec};
 use lemmy_db_schema::{
   schema::{mod_ban, user_, user_alias_1},
   source::{
similarity index 96%
rename from lemmy_db_views/src/moderator/mod_lock_post_view.rs
rename to lemmy_db_views_moderator/src/mod_lock_post_view.rs
index 11521329e425333f9343ad609a3a7bd2c3f8da8d..2feea8319bc045ace1e4730586b132baaeb92ace 100644 (file)
@@ -1,6 +1,5 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{limit_and_offset, ToSafe};
+use lemmy_db_queries::{limit_and_offset, ToSafe, ViewToVec};
 use lemmy_db_schema::{
   schema::{community, mod_lock_post, post, user_},
   source::{
similarity index 97%
rename from lemmy_db_views/src/moderator/mod_remove_comment_view.rs
rename to lemmy_db_views_moderator/src/mod_remove_comment_view.rs
index 0c52be2f9581d071bbb9cdaffd139b24d4af2e8c..87715c7574e514a9f56e74bcc5bb117c22798168 100644 (file)
@@ -1,6 +1,5 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{limit_and_offset, ToSafe};
+use lemmy_db_queries::{limit_and_offset, ToSafe, ViewToVec};
 use lemmy_db_schema::{
   schema::{comment, community, mod_remove_comment, post, user_, user_alias_1},
   source::{
similarity index 96%
rename from lemmy_db_views/src/moderator/mod_remove_community_view.rs
rename to lemmy_db_views_moderator/src/mod_remove_community_view.rs
index 86fcf1954f9adb2e09efe32ad37db1371cb9ce3b..491827bfbadab708118a9f7e0fe6f74bf7bba1b1 100644 (file)
@@ -1,6 +1,5 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{limit_and_offset, ToSafe};
+use lemmy_db_queries::{limit_and_offset, ToSafe, ViewToVec};
 use lemmy_db_schema::{
   schema::{community, mod_remove_community, user_},
   source::{
similarity index 96%
rename from lemmy_db_views/src/moderator/mod_remove_post_view.rs
rename to lemmy_db_views_moderator/src/mod_remove_post_view.rs
index d4332918ff3cedc91d065ec020a84e40bb0bddce..b524206bac6d0efea9e2646c810101447cfb1598 100644 (file)
@@ -1,6 +1,5 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{limit_and_offset, ToSafe};
+use lemmy_db_queries::{limit_and_offset, ToSafe, ViewToVec};
 use lemmy_db_schema::{
   schema::{community, mod_remove_post, post, user_},
   source::{
similarity index 96%
rename from lemmy_db_views/src/moderator/mod_sticky_post_view.rs
rename to lemmy_db_views_moderator/src/mod_sticky_post_view.rs
index ec785ce1b2c4b6f3b0dcd67a767883a4843f41b0..4053b8ab3dc4faf62e86aec29f159dde04b7cdc3 100644 (file)
@@ -1,6 +1,5 @@
-use crate::ViewToVec;
 use diesel::{result::Error, *};
-use lemmy_db::{limit_and_offset, ToSafe};
+use lemmy_db_queries::{limit_and_offset, ToSafe, ViewToVec};
 use lemmy_db_schema::{
   schema::{community, mod_sticky_post, post, user_},
   source::{
diff --git a/lemmy_rate_limit/Cargo.toml b/lemmy_rate_limit/Cargo.toml
deleted file mode 100644 (file)
index 5574efa..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-[package]
-name = "lemmy_rate_limit"
-version = "0.1.0"
-authors = ["Felix Ableitner <me@nutomic.com>"]
-edition = "2018"
-
-[lib]
-name = "lemmy_rate_limit"
-path = "src/lib.rs"
-
-[dependencies]
-lemmy_utils = { path = "../lemmy_utils" }
-tokio = { version = "0.3.6", features = ["sync"] }
-strum = "0.20.0"
-strum_macros = "0.20.1"
-futures = "0.3.8"
-actix-web = { version = "3.3.2", default-features = false, features = ["rustls"] }
-log = "0.4.11"
index d4f013b92f2e2f40c5190c3862f28533a2d01d00..b6ecade5181275abcc2d79e243082a6dd624b625 100644 (file)
@@ -11,6 +11,8 @@ path = "src/lib.rs"
 [dependencies]
 lemmy_db_queries = { path = "../lemmy_db_queries" }
 lemmy_db_views = { path = "../lemmy_db_views" }
+lemmy_db_views_moderator = { path = "../lemmy_db_views_moderator" }
+lemmy_db_views_actor = { path = "../lemmy_db_views_actor" }
 lemmy_db_schema = { path = "../lemmy_db_schema" }
 lemmy_utils = { path = "../lemmy_utils" }
 serde = { version = "1.0.118", features = ["derive"] }
index 74f7a4e4279c141760db5c01d48d81b7e9379b1c..8c45cc9f3ddb5d6f21aafac85b9c3a203baf6aea 100644 (file)
@@ -1,9 +1,7 @@
-use lemmy_db_views::{
-  community::{
-    community_follower_view::CommunityFollowerView,
-    community_moderator_view::CommunityModeratorView,
-    community_view::CommunityView,
-  },
+use lemmy_db_views_actor::{
+  community_follower_view::CommunityFollowerView,
+  community_moderator_view::CommunityModeratorView,
+  community_view::CommunityView,
   user_view::UserViewSafe,
 };
 use serde::{Deserialize, Serialize};
index 080cb38521618761c8c1bdef1587747a99ba4cc9..546eb4ee13305ad303116bdca4a96ed3d77f9ca4 100644 (file)
@@ -5,7 +5,7 @@ pub mod site;
 pub mod user;
 
 use diesel::PgConnection;
-use lemmy_db::{source::user::User, Crud, DbPool};
+use lemmy_db_queries::{source::user::User, Crud, DbPool};
 use lemmy_db_schema::source::{
   comment::Comment,
   post::Post,
index 5a35fa37ed92aa6e29a429ec13b90ff9cc419ac4..0410b1b82c32c0990083f2faf82235b3b7a94d73 100644 (file)
@@ -1,9 +1,9 @@
 use lemmy_db_views::{
   comment_view::CommentView,
-  community::community_moderator_view::CommunityModeratorView,
   post_report_view::PostReportView,
   post_view::PostView,
 };
+use lemmy_db_views_actor::community_moderator_view::CommunityModeratorView;
 use serde::{Deserialize, Serialize};
 
 #[derive(Deserialize, Debug)]
index fbb295d51cfda76b6b04f3e0f285586ee518f6fc..e30523464190a73cec15f4ca33a5714a3b1e48f1 100644 (file)
@@ -1,21 +1,16 @@
 use lemmy_db_schema::source::{category::*, user::User_};
-use lemmy_db_views::{
-  comment_view::CommentView,
-  community::community_view::CommunityView,
-  moderator::{
-    mod_add_community_view::ModAddCommunityView,
-    mod_add_view::ModAddView,
-    mod_ban_from_community_view::ModBanFromCommunityView,
-    mod_ban_view::ModBanView,
-    mod_lock_post_view::ModLockPostView,
-    mod_remove_comment_view::ModRemoveCommentView,
-    mod_remove_community_view::ModRemoveCommunityView,
-    mod_remove_post_view::ModRemovePostView,
-    mod_sticky_post_view::ModStickyPostView,
-  },
-  post_view::PostView,
-  site_view::SiteView,
-  user_view::UserViewSafe,
+use lemmy_db_views::{comment_view::CommentView, post_view::PostView, site_view::SiteView};
+use lemmy_db_views_actor::{community_view::CommunityView, user_view::UserViewSafe};
+use lemmy_db_views_moderator::{
+  mod_add_community_view::ModAddCommunityView,
+  mod_add_view::ModAddView,
+  mod_ban_from_community_view::ModBanFromCommunityView,
+  mod_ban_view::ModBanView,
+  mod_lock_post_view::ModLockPostView,
+  mod_remove_comment_view::ModRemoveCommentView,
+  mod_remove_community_view::ModRemoveCommunityView,
+  mod_remove_post_view::ModRemovePostView,
+  mod_sticky_post_view::ModStickyPostView,
 };
 use serde::{Deserialize, Serialize};
 
index 4b4d6a886d09b8e09ec4255630402ec6649d592e..a3836f11fcdb7d140a24733a2f6488cf7a901efa 100644 (file)
@@ -1,11 +1,11 @@
 use lemmy_db_views::{
   comment_view::CommentView,
-  community::{
-    community_follower_view::CommunityFollowerView,
-    community_moderator_view::CommunityModeratorView,
-  },
   post_view::PostView,
   private_message_view::PrivateMessageView,
+};
+use lemmy_db_views_actor::{
+  community_follower_view::CommunityFollowerView,
+  community_moderator_view::CommunityModeratorView,
   user_mention_view::UserMentionView,
   user_view::{UserViewDangerous, UserViewSafe},
 };
index fe810a79f113b6dd3d1b9da6f0d20591b0ccd6db..df4ae1b2bc4818573aa8f36bcc8326971e53f0f7 100644 (file)
@@ -27,3 +27,7 @@ actix-web = { version = "3.3.2", default-features = false, features = ["rustls"]
 actix-rt = { version = "1.1.1", default-features = false }
 anyhow = "1.0.36"
 reqwest = { version = "0.10.10", features = ["json"] }
+tokio = { version = "0.3.6", features = ["sync"] }
+strum = "0.20.0"
+strum_macros = "0.20.1"
+futures = "0.3.8"
index eecb7b2d7fc3e4c51dd52223769931a7f94e486d..e0b8e3aa1dcc6186c749ac2e973266ebaafa43d7 100644 (file)
@@ -1,8 +1,11 @@
 #[macro_use]
 extern crate lazy_static;
+#[macro_use]
+extern crate strum_macros;
 
 pub mod apub;
 pub mod email;
+pub mod rate_limit;
 pub mod request;
 pub mod settings;
 #[cfg(test)]
similarity index 98%
rename from lemmy_rate_limit/src/lib.rs
rename to lemmy_utils/src/rate_limit/mod.rs
index ecb812af85cea24c459f79af7f174f7b8324a57c..5a18ffd5494943bb32c141d23737d76b42ad38b6 100644 (file)
@@ -1,13 +1,10 @@
-#[macro_use]
-extern crate strum_macros;
-
-use actix_web::dev::{Service, ServiceRequest, ServiceResponse, Transform};
-use futures::future::{ok, Ready};
-use lemmy_utils::{
+use crate::{
   settings::{RateLimitConfig, Settings},
   utils::get_ip,
   LemmyError,
 };
+use actix_web::dev::{Service, ServiceRequest, ServiceResponse, Transform};
+use futures::future::{ok, Ready};
 use rate_limiter::{RateLimitType, RateLimiter};
 use std::{
   future::Future,
similarity index 98%
rename from lemmy_rate_limit/src/rate_limiter.rs
rename to lemmy_utils/src/rate_limit/rate_limiter.rs
index bd089febdc5931dafa1619ec27b0edbcc934672e..5bb02f596996fc54d0fed01c35546ee8cb0fbaf3 100644 (file)
@@ -1,4 +1,4 @@
-use lemmy_utils::{APIError, IPAddr, LemmyError};
+use crate::{APIError, IPAddr, LemmyError};
 use log::debug;
 use std::{collections::HashMap, time::SystemTime};
 use strum::IntoEnumIterator;
index 4f036ae5293058d9bfed8c30a7ce8284b1f386aa..944760c2dd575f35a71bf3bd29a6f8bce2f9cc92 100644 (file)
@@ -13,7 +13,6 @@ lemmy_utils = { path = "../lemmy_utils" }
 lemmy_structs = { path = "../lemmy_structs" }
 lemmy_db_queries = { path = "../lemmy_db_queries" }
 lemmy_db_schema = { path = "../lemmy_db_schema" }
-lemmy_rate_limit = { path = "../lemmy_rate_limit" }
 reqwest = { version = "0.10.10", features = ["json"] }
 log = "0.4.11"
 rand = "0.8.0"
index ece5d3534fccec3e423b6c997bbd81b25689b885..f149d6e1e7dc12ac8c20817a704b78700bd6cf33 100644 (file)
@@ -6,10 +6,10 @@ use diesel::{
   r2d2::{ConnectionManager, Pool},
   PgConnection,
 };
-use lemmy_rate_limit::RateLimit;
 use lemmy_structs::{comment::*, post::*};
 use lemmy_utils::{
   location_info,
+  rate_limit::RateLimit,
   APIError,
   CommunityId,
   ConnectionId,
index d789efdd1bfe6c98a9b17b1cb27cfd0d542a7cda..72e72b52f9b8c2df8925c38e08fba39938099c15 100644 (file)
@@ -4,7 +4,7 @@ extern crate strum_macros;
 use crate::chat_server::ChatServer;
 use actix::Addr;
 use background_jobs::QueueHandle;
-use lemmy_db::DbPool;
+use lemmy_db_queries::DbPool;
 use lemmy_utils::LemmyError;
 use reqwest::Client;
 use serde::Serialize;
index 73b030cb22dc2f39e53165b1247b2bb6419acafc..d2928244e46586a3872f0a6a7431d848b0e79802 100644 (file)
@@ -3,7 +3,7 @@ use diesel::{
   sql_types::{Nullable, Text},
   *,
 };
-use lemmy_db::{
+use lemmy_db_queries::{
   source::{comment::Comment_, post::Post_, private_message::PrivateMessage_},
   Crud,
 };
index c55c3655d586e565718ef200ab8fa8b40369f365..fad3680bba12bacb1adc6a6ac30afcd0179da067 100644 (file)
@@ -9,11 +9,14 @@ use diesel::{
 };
 use lemmy_api::match_websocket_operation;
 use lemmy_apub::activity_queue::create_activity_queue;
-use lemmy_db::get_database_url_from_env;
-use lemmy_rate_limit::{rate_limiter::RateLimiter, RateLimit};
+use lemmy_db_queries::get_database_url_from_env;
 use lemmy_server::{code_migrations::run_advanced_migrations, routes::*};
 use lemmy_structs::blocking;
-use lemmy_utils::{settings::Settings, LemmyError};
+use lemmy_utils::{
+  rate_limit::{rate_limiter::RateLimiter, RateLimit},
+  settings::Settings,
+  LemmyError,
+};
 use lemmy_websocket::{chat_server::ChatServer, LemmyContext};
 use reqwest::Client;
 use std::sync::Arc;
index 199e14ac9b391dd561f1b21d33e86d1006d6215a..2a91b2c5f43ebaf0fffd7cf814560106a617ec84 100644 (file)
@@ -1,7 +1,7 @@
 use actix_web::{error::ErrorBadRequest, *};
 use lemmy_api::Perform;
-use lemmy_rate_limit::RateLimit;
 use lemmy_structs::{comment::*, community::*, post::*, site::*, user::*};
+use lemmy_utils::rate_limit::RateLimit;
 use lemmy_websocket::LemmyContext;
 use serde::Deserialize;
 
index d7862dcd5114003f7c6d441dcfe6abb4ecbcd334..5065390c2eb1457ce88880ce50e07df2d282998f 100644 (file)
@@ -3,7 +3,7 @@ use anyhow::anyhow;
 use chrono::{DateTime, NaiveDateTime, Utc};
 use diesel::PgConnection;
 use lemmy_api::claims::Claims;
-use lemmy_db::{
+use lemmy_db_queries::{
   source::{community::Community_, user::User},
   ListingType,
   SortType,
@@ -13,8 +13,8 @@ use lemmy_db_views::{
   comment_view::{CommentQueryBuilder, CommentView},
   post_view::{PostQueryBuilder, PostView},
   site_view::SiteView,
-  user_mention_view::{UserMentionQueryBuilder, UserMentionView},
 };
+use lemmy_db_views_actor::user_mention_view::{UserMentionQueryBuilder, UserMentionView};
 use lemmy_structs::blocking;
 use lemmy_utils::{settings::Settings, utils::markdown_to_html, LemmyError};
 use lemmy_websocket::LemmyContext;
index e6f32b41009c153071e92765880f2cfc51e3e2e3..c9937ee689cd123b64b5ca5820513d5c18eacf58 100644 (file)
@@ -2,8 +2,7 @@ use actix::clock::Duration;
 use actix_web::{body::BodyStream, http::StatusCode, *};
 use awc::Client;
 use lemmy_api::claims::Claims;
-use lemmy_rate_limit::RateLimit;
-use lemmy_utils::settings::Settings;
+use lemmy_utils::{rate_limit::RateLimit, settings::Settings};
 use serde::{Deserialize, Serialize};
 
 pub fn config(cfg: &mut web::ServiceConfig, rate_limit: &RateLimit) {
index 2a03f5e2a6f1da28a41f88fb4abd49d33f708ab4..0e4d7f948629373ed5821e82e526a62f4eb3fd84 100644 (file)
@@ -1,6 +1,6 @@
 use actix_web::{error::ErrorBadRequest, web::Query, *};
 use anyhow::anyhow;
-use lemmy_db::source::{community::Community_, user::User};
+use lemmy_db_queries::source::{community::Community_, user::User};
 use lemmy_db_schema::source::{community::Community, user::User_};
 use lemmy_structs::{blocking, WebFingerLink, WebFingerResponse};
 use lemmy_utils::{
index c507af0670133117ac9c50e9f1d880c3303d602b..d97cb72f2850757ce2b94fd3e5b66773f1812ce0 100644 (file)
@@ -28,13 +28,16 @@ use lemmy_apub::{
     user_inbox::user_inbox,
   },
 };
-use lemmy_db::{Crud, ListingType, SortType};
+use lemmy_db_queries::{Crud, ListingType, SortType};
 use lemmy_db_schema::source::{
   community::{Community, CommunityForm},
   user::{UserForm, User_},
 };
-use lemmy_rate_limit::{rate_limiter::RateLimiter, RateLimit};
-use lemmy_utils::{apub::generate_actor_keypair, settings::Settings};
+use lemmy_utils::{
+  apub::generate_actor_keypair,
+  rate_limit::{rate_limiter::RateLimiter, RateLimit},
+  settings::Settings,
+};
 use lemmy_websocket::{chat_server::ChatServer, LemmyContext};
 use reqwest::Client;
 use serde::{Deserialize, Serialize};