Skip to content

Commit

Permalink
don't insert zero entries
Browse files Browse the repository at this point in the history
  • Loading branch information
zaknesler committed May 7, 2024
1 parent 59b395f commit 7afadae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/blend-db/src/repo/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ impl EntryRepo {
feed_uuid: &uuid::Uuid,
entries: &[CreateEntryParams],
) -> DbResult<Vec<uuid::Uuid>> {
if entries.is_empty() {
return Ok(vec![]);
}

let mut query = QueryBuilder::<Sqlite>::new("INSERT INTO entries (feed_uuid, uuid, id, url, title, summary, content_html, published_at, updated_at) ");
query.push_values(entries.iter(), |mut b, entry| {
b.push_bind(feed_uuid)
Expand Down

0 comments on commit 7afadae

Please sign in to comment.