Add search_cards_of_notes_into_table.sql

This commit is contained in:
RumovZ 2022-04-27 21:56:27 +02:00
parent f03df4ac3a
commit 20322fb753
2 changed files with 8 additions and 5 deletions

View file

@ -502,11 +502,7 @@ impl super::SqliteStorage {
pub(crate) fn search_cards_of_notes_into_table(&self) -> Result<usize> {
self.setup_searched_cards_table()?;
self.db
.prepare(concat!(
"INSERT INTO search_cids",
" SELECT id FROM cards WHERE nid IN",
" (SELECT nid FROM search_nids)",
))?
.prepare(include_str!("search_cards_of_notes_into_table.sql"))?
.execute([])
.map_err(Into::into)
}

View file

@ -0,0 +1,7 @@
INSERT INTO search_cids
SELECT id
FROM cards
WHERE nid IN (
SELECT nid
FROM search_nids
)