tweaks
This commit is contained in:
parent
c1bea8284c
commit
61ad0a17e8
2 changed files with 2 additions and 2 deletions
|
@ -38,7 +38,6 @@ pub fn get_db_pool() -> SqlitePool {
|
||||||
|
|
||||||
let conn_opts = SqliteConnectOptions::new()
|
let conn_opts = SqliteConnectOptions::new()
|
||||||
.foreign_keys(true)
|
.foreign_keys(true)
|
||||||
.auto_vacuum(sqlx::sqlite::SqliteAutoVacuum::Incremental)
|
|
||||||
.journal_mode(SqliteJournalMode::Wal)
|
.journal_mode(SqliteJournalMode::Wal)
|
||||||
.synchronous(sqlx::sqlite::SqliteSynchronous::Normal)
|
.synchronous(sqlx::sqlite::SqliteSynchronous::Normal)
|
||||||
.filename(&db_filename)
|
.filename(&db_filename)
|
||||||
|
@ -46,6 +45,7 @@ pub fn get_db_pool() -> SqlitePool {
|
||||||
.extension("./libjulid")
|
.extension("./libjulid")
|
||||||
.busy_timeout(Duration::from_secs(TIMEOUT))
|
.busy_timeout(Duration::from_secs(TIMEOUT))
|
||||||
.create_if_missing(true)
|
.create_if_missing(true)
|
||||||
|
.optimize_on_close(true, None)
|
||||||
.pragma("mmap_size", "3000000000");
|
.pragma("mmap_size", "3000000000");
|
||||||
|
|
||||||
let pool = SqlitePoolOptions::new()
|
let pool = SqlitePoolOptions::new()
|
||||||
|
|
|
@ -251,7 +251,7 @@ pub async fn get_search_watch(
|
||||||
query_as(DEFAULT_WATCHES_QUERY)
|
query_as(DEFAULT_WATCHES_QUERY)
|
||||||
} else if let Some(title) = search_query.title {
|
} else if let Some(title) = search_query.title {
|
||||||
query_as(
|
query_as(
|
||||||
"select * from watches where id in (select id from watch_search where title match ?)",
|
"select * from watches where id in (select id from watch_search where title match ? order by rank)",
|
||||||
)
|
)
|
||||||
.bind(title)
|
.bind(title)
|
||||||
} else if let Some(ref search) = search_query.search {
|
} else if let Some(ref search) = search_query.search {
|
||||||
|
|
Loading…
Reference in a new issue