This commit is contained in:
parent
907ed2a2ef
commit
3e9808db80
4 changed files with 106 additions and 6 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue