mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 09:16:38 -04:00
Add search_cards_of_notes_into_table.sql
This commit is contained in:
parent
f03df4ac3a
commit
20322fb753
2 changed files with 8 additions and 5 deletions
|
@ -502,11 +502,7 @@ impl super::SqliteStorage {
|
||||||
pub(crate) fn search_cards_of_notes_into_table(&self) -> Result<usize> {
|
pub(crate) fn search_cards_of_notes_into_table(&self) -> Result<usize> {
|
||||||
self.setup_searched_cards_table()?;
|
self.setup_searched_cards_table()?;
|
||||||
self.db
|
self.db
|
||||||
.prepare(concat!(
|
.prepare(include_str!("search_cards_of_notes_into_table.sql"))?
|
||||||
"INSERT INTO search_cids",
|
|
||||||
" SELECT id FROM cards WHERE nid IN",
|
|
||||||
" (SELECT nid FROM search_nids)",
|
|
||||||
))?
|
|
||||||
.execute([])
|
.execute([])
|
||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
INSERT INTO search_cids
|
||||||
|
SELECT id
|
||||||
|
FROM cards
|
||||||
|
WHERE nid IN (
|
||||||
|
SELECT nid
|
||||||
|
FROM search_nids
|
||||||
|
)
|
Loading…
Reference in a new issue