mirror of
https://github.com/YGGverse/rssto.git
synced 2026-03-31 17:15:29 +00:00
implement channel_item getter
This commit is contained in:
parent
4af10ee153
commit
6d3aac409a
1 changed files with 19 additions and 0 deletions
|
|
@ -42,6 +42,25 @@ impl Mysql {
|
||||||
Ok(self.connection.last_insert_id())
|
Ok(self.connection.last_insert_id())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn channel_item(&mut self, channel_item_id: u64) -> Result<Option<ChannelItem>, 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(
|
pub fn channel_items_by_channel_id_guid(
|
||||||
&mut self,
|
&mut self,
|
||||||
channel_id: u64,
|
channel_id: u64,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue