core
: Allow querying meta objects grouped by parent
This commit is contained in:
parent
a5b9918c43
commit
a5b6485d11
1 changed files with 10 additions and 6 deletions
|
@ -89,21 +89,25 @@ impl MetaLink {
|
||||||
.load(conn)
|
.load(conn)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
}
|
||||||
pub async fn query_properties(&self, conn: &mut AsyncPgConnection) -> QueryResult<Vec<MetaLinkProperty>> {
|
|
||||||
|
impl MetaLinkProperty {
|
||||||
|
pub async fn query_by_link(conn: &mut AsyncPgConnection, links: &[MetaLink]) -> QueryResult<Vec<MetaLinkProperty>> {
|
||||||
use diesel::prelude::*;
|
use diesel::prelude::*;
|
||||||
use diesel_async::RunQueryDsl;
|
use diesel_async::RunQueryDsl;
|
||||||
|
|
||||||
MetaLinkProperty::belonging_to(self)
|
Self::belonging_to(links)
|
||||||
.load(conn)
|
.load(conn)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
}
|
||||||
pub async fn query_titles(&self, conn: &mut AsyncPgConnection) -> QueryResult<Vec<MetaLinkTitle>> {
|
|
||||||
|
impl MetaLinkTitle {
|
||||||
|
pub async fn query_by_link(conn: &mut AsyncPgConnection, links: &[MetaLink]) -> QueryResult<Vec<MetaLinkTitle>> {
|
||||||
use diesel::prelude::*;
|
use diesel::prelude::*;
|
||||||
use diesel_async::RunQueryDsl;
|
use diesel_async::RunQueryDsl;
|
||||||
|
|
||||||
MetaLinkTitle::belonging_to(self)
|
Self::belonging_to(links)
|
||||||
.load(conn)
|
.load(conn)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue