You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/src/db/database.rs
+33
Original file line number
Diff line number
Diff line change
@@ -4858,6 +4858,39 @@ impl Database {
4858
4858
4859
4859
Ok((total_scopes asusize, scopes))
4860
4860
}
4861
+
4862
+
pubasyncfnget_recent_packages_by_user(
4863
+
&self,
4864
+
user_id:&uuid::Uuid,
4865
+
) -> Result<Vec<Package>>{
4866
+
let packages = sqlx::query_as!(
4867
+
Package,
4868
+
r#"
4869
+
SELECT DISTINCT ON (packages.scope, packages.name)
4870
+
packages.scope as "scope: ScopeName",
4871
+
packages.name as "name: PackageName",
4872
+
packages.description,
4873
+
packages.github_repository_id,
4874
+
packages.runtime_compat as "runtime_compat: RuntimeCompat",
4875
+
packages.when_featured,
4876
+
packages.is_archived,
4877
+
packages.updated_at,
4878
+
packages.created_at,
4879
+
(SELECT COUNT(created_at) FROM package_versions WHERE scope = packages.scope AND name = packages.name) as "version_count!",
4880
+
(SELECT version FROM package_versions WHERE scope = packages.scope AND name = packages.name AND version NOT LIKE '%-%' AND is_yanked = false ORDER BY version DESC LIMIT 1) as "latest_version"
4881
+
FROM packages
4882
+
JOIN scope_members ON packages.scope = scope_members.scope
4883
+
WHERE scope_members.user_id = $1
4884
+
ORDER BY packages.scope, packages.name, packages.created_at DESC
0 commit comments