From 6d3aac409ac85aad62b237c6d81dce024e850191 Mon Sep 17 00:00:00 2001 From: yggverse Date: Wed, 7 Jan 2026 21:56:16 +0200 Subject: [PATCH] implement `channel_item` getter --- crates/mysql/src/lib.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/crates/mysql/src/lib.rs b/crates/mysql/src/lib.rs index b0fff0e..1b58530 100644 --- a/crates/mysql/src/lib.rs +++ b/crates/mysql/src/lib.rs @@ -42,6 +42,25 @@ impl Mysql { Ok(self.connection.last_insert_id()) } + pub fn channel_item(&mut self, channel_item_id: u64) -> Result, Error> { + self.connection.exec_first( + "SELECT `channel_item_id`, `channel_id`, `pub_date`, `guid`, `link`, `title`, `description` FROM `channel_item` WHERE `channel_item_id` = ?", + (channel_item_id,) + ).map(|row| { + row.map(|(channel_item_id, channel_id, pub_date, guid, link, title, description)| { + ChannelItem { + channel_item_id, + channel_id, + pub_date, + guid, + link, + title, + description, + } + }) + }) + } + pub fn channel_items_by_channel_id_guid( &mut self, channel_id: u64,