♻️ fragments
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
JMARyA 2025-03-26 21:40:43 +01:00
parent 907ed2a2ef
commit 3e9808db80
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
4 changed files with 106 additions and 6 deletions

View file

@ -35,3 +35,14 @@ pub async fn get_fragments_of_domain(domain: &str) -> Vec<(String, String)> {
res.into_iter().map(|x| (x.0, x.1)).collect()
}
pub async fn get_domains_of_fragment(fragment: &str) -> Vec<(String, String, chrono::NaiveDate)> {
let res: Vec<(String, String, chrono::NaiveDate)> =
sqlx::query_as("SELECT domain, path, version FROM document_fragments WHERE fragment = $1")
.bind(fragment)
.fetch_all(get_pg!())
.await
.unwrap();
res.into_iter().map(|x| (x.0, x.1, x.2)).collect()
}