File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -341,6 +341,24 @@ impl Crate {
341341 }
342342 }
343343
344+ /// Return both the newest (most recently updated) and
345+ /// highest version (in semver order) for the current crate,
346+ /// where all top versions are not yanked.
347+ pub async fn async_top_versions (
348+ & self ,
349+ conn : & mut AsyncPgConnection ,
350+ ) -> QueryResult < TopVersions > {
351+ use diesel_async:: RunQueryDsl ;
352+
353+ Ok ( TopVersions :: from_date_version_pairs (
354+ Version :: belonging_to ( self )
355+ . filter ( versions:: yanked. eq ( false ) )
356+ . select ( ( versions:: created_at, versions:: num) )
357+ . load ( conn)
358+ . await ?,
359+ ) )
360+ }
361+
344362 /// Return both the newest (most recently updated) and
345363 /// highest version (in semver order) for the current crate,
346364 /// where all top versions are not yanked.
You can’t perform that action at this time.
0 commit comments