Catch all rss
This commit is contained in:
@@ -126,6 +126,25 @@ export function getAllChannels() {
|
||||
return results;
|
||||
}
|
||||
|
||||
export function getAllMessages(limit = 50) {
|
||||
const stmt = db.prepare(
|
||||
`SELECT * FROM messages
|
||||
ORDER BY created_at DESC
|
||||
LIMIT ?`
|
||||
);
|
||||
|
||||
stmt.bind([limit]);
|
||||
const results = [];
|
||||
|
||||
while (stmt.step()) {
|
||||
const row = stmt.getAsObject();
|
||||
results.push(row);
|
||||
}
|
||||
|
||||
stmt.free();
|
||||
return results;
|
||||
}
|
||||
|
||||
export function getLatestMessageTime(channelId) {
|
||||
const stmt = db.prepare(
|
||||
`SELECT MAX(created_at) as latest FROM messages WHERE channel_id = ?`
|
||||
|
||||
Reference in New Issue
Block a user