Skip to content

Commit

Permalink
Add a few more semver-sorting case/when's to version-matching.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob McWhirter committed Jul 23, 2024
1 parent b6085c8 commit 09fc823
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions migration/src/m0000480_create_rpmver_cmp_fns/version_matches.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,29 @@ declare
begin
return case
when range_p.version_scheme_id = 'semver'
-- Semver is semver
then semver_version_matches(version_p, range_p)
when range_p.version_scheme_id = 'gem'
-- RubyGems claims to be semver
then semver_version_matches(version_p, range_p)
when range_p.version_scheme_id = 'npm'
-- NPM claims to be semver
then semver_version_matches(version_p, range_p)
when range_p.version_scheme_id = 'golang'
-- Golang claims to be semver
then semver_version_matches(version_p, range_p)
when range_p.version_scheme_id = 'nuget'
-- NuGet claims to be semver
then semver_version_matches(version_p, range_p)
when range_p.version_scheme_id = 'rpm'
then rpmver_version_matches(version_p, range_p)
when range_p.version_scheme_id = 'generic'
-- Might was well try semver
then semver_version_matches(version_p, range_p)
when range_p.version_scheme_id = 'rpm'
-- Look at me! I'm an RPM! I'm special!
then rpmver_version_matches(version_p, range_p)
else
false
end;

end
$$
language 'plpgsql';

0 comments on commit 09fc823

Please sign in to comment.