fix(db): edit add_selected_property fn to Insert URL if it does not exists.

This commit is contained in:
ryan 2025-03-06 14:32:52 +03:00
parent 04457fef62
commit 6c2442a82b

View file

@ -552,6 +552,12 @@ mod db_impl {
let mut conn = self.conn.lock().await;
let tx = conn.transaction()?;
// Insert URL if it does not exists
tx.execute(
"INSERT OR IGNORE INTO urls (url) VALUES (?)",
[url]
)?;
// Get URL ID
let url_id = tx.query_row(
"SELECT id FROM urls WHERE url = ?",