Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Add redis caching to getting user notifications and projects [MOD-540] #723

Merged
merged 16 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 74 additions & 38 deletions sqlx-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -717,18 +717,6 @@
},
"query": "\n UPDATE mods\n SET webhook_sent = TRUE\n WHERE id = $1\n "
},
"127691940ca7e542e246dd2a1c9cb391041b30ddf0547d73b49c1dd9dc59d2ae": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int8Array"
]
}
},
"query": "\n UPDATE notifications\n SET read = TRUE\n WHERE id = ANY($1)\n "
},
"15fac93c76e72348b50f526e1acb183521d94be335ad8b9dfeb0398d4a8a2fc4": {
"describe": {
"columns": [],
Expand Down Expand Up @@ -2340,18 +2328,6 @@
},
"query": "\n SELECT id FROM threads\n WHERE report_id = $1\n "
},
"599df07263a2705e57fc70a7c4f5dc606e1730c281e3b573d2f2a2030bed04e0": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int8Array"
]
}
},
"query": "\n DELETE FROM notifications\n WHERE id = ANY($1)\n "
},
"59e95e832615c375753bfc9a56b07c02d916399adfa52fb11a79b8f7b56ecf8b": {
"describe": {
"columns": [
Expand Down Expand Up @@ -3439,6 +3415,20 @@
},
"query": "\n UPDATE mods\n SET icon_url = $1, color = $2\n WHERE (id = $3)\n "
},
"73eb05239e1abe32e0d7bc60e2a126fad0e353139bca2ffda0d23e4b70938067": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int8",
"Int8",
"Jsonb"
]
}
},
"query": "\n INSERT INTO notifications (\n id, user_id, body\n )\n VALUES (\n $1, $2, $3\n )\n "
},
"742f20f422361971c21b72c629c57a6c3870d8d6c41577496907290db5994f12": {
"describe": {
"columns": [],
Expand Down Expand Up @@ -4001,6 +3991,26 @@
},
"query": "\n UPDATE threads\n SET show_in_mod_inbox = FALSE\n WHERE id = $1\n "
},
"8f74918aa923e516b6b2967b7d1afbd02c8bde5466d22ad60ad735f8358cbf04": {
"describe": {
"columns": [
{
"name": "user_id",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
false
],
"parameters": {
"Left": [
"Int8"
]
}
},
"query": "\n DELETE FROM team_members\n WHERE team_id = $1\n RETURNING user_id\n "
},
"912250d37f13a98a21165c72bfc1eaa8a85b9952dd6750c117dca7fbb1bb8962": {
"describe": {
"columns": [],
Expand Down Expand Up @@ -5625,20 +5635,6 @@
},
"query": "\n DELETE FROM threads_messages\n WHERE thread_id = $1\n "
},
"d2c046d4bedeb7181ece4e94d7de90c97bd3dd1b0c16070704028923a0c2834a": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int8",
"Int8",
"Jsonb"
]
}
},
"query": "\n INSERT INTO notifications (\n id, user_id, body\n )\n VALUES (\n $1, $2, $3\n )\n "
},
"d331ca8f22da418cf654985c822ce4466824beaa00dea64cde90dc651a03024b": {
"describe": {
"columns": [],
Expand Down Expand Up @@ -6472,6 +6468,26 @@
},
"query": "SELECT id FROM users WHERE discord_id = $1"
},
"ee375e658423156a758cc372400961f627fa5a620a3f61e37ec09fee1d7bb4e3": {
"describe": {
"columns": [
{
"name": "user_id",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
false
],
"parameters": {
"Left": [
"Int8Array"
]
}
},
"query": "\n DELETE FROM notifications\n WHERE id = ANY($1)\n RETURNING user_id\n "
},
"eec6d4028d790e57a4d97fc5a200a9ae2b3d2cb60ee83c51fb05180b821558f5": {
"describe": {
"columns": [],
Expand Down Expand Up @@ -6625,6 +6641,26 @@
},
"query": "\n UPDATE users\n SET bio = $1\n WHERE (id = $2)\n "
},
"f775506213dbf4bf0ee05fd53c693412e3baae64b6dc0aead8082059f16755bc": {
"describe": {
"columns": [
{
"name": "user_id",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
false
],
"parameters": {
"Left": [
"Int8Array"
]
}
},
"query": "\n UPDATE notifications\n SET read = TRUE\n WHERE id = ANY($1)\n RETURNING user_id\n "
},
"f793e96499ff35f8dc2e420484c2a0cdb54f25ffa27caa081691779ab896a709": {
"describe": {
"columns": [],
Expand Down
4 changes: 2 additions & 2 deletions src/database/models/ids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ pub struct FileId(pub i64);
#[sqlx(transparent)]
pub struct PatId(pub i64);

#[derive(Copy, Clone, Debug, Type, Deserialize)]
#[derive(Copy, Clone, Debug, Type, Serialize, Deserialize)]
#[sqlx(transparent)]
pub struct NotificationId(pub i64);
#[derive(Copy, Clone, Debug, Type, Deserialize)]
#[derive(Copy, Clone, Debug, Type, Serialize, Deserialize)]
#[sqlx(transparent)]
pub struct NotificationActionId(pub i32);

Expand Down
Loading
Loading