Skip to content

Add ability to check version compatibility #430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jgebal opened this issue Jul 28, 2017 · 3 comments
Closed

Add ability to check version compatibility #430

jgebal opened this issue Jul 28, 2017 · 3 comments
Milestone

Comments

@jgebal
Copy link
Member

jgebal commented Jul 28, 2017

We need a way for the external APIs (like Java) to be able to check if it is compatible, when calling utPLSQL, so that the calling (Java) API can first check if the version that it is depending on is compatible with current version.
That could be done by providing a compatibility check.
ut_run.check_compatibility_with_version( a_version varchar2)
The function would return true/false depending on the result of check.
The check would execute the following pseudo-code:

begin
  l_result := false;
  l_version = current_version number (major.minor.bugfix);
  if a_version.major = l_version.major
     and (a_version.minor = l_version.minor 
          or a_version.minor = l_version.minor and a_version.bugfix <= l_version.bugfix) then
    l_result := true;
  end if;
  return l_result;
end if;

So versions are compatible:

  • if major is equal and framework minor >= requested
  • if major is equal and minor is equal and framework bugfix >= requested
@jgebal jgebal added this to the v3.1.0 milestone Jul 28, 2017
@Pazus
Copy link
Member

Pazus commented Jul 31, 2017

We could you the same approach Oracle implements with dbms_db_version

@jgebal
Copy link
Member Author

jgebal commented Aug 1, 2017

I'm not sure that the approach from dbms_db_version would work well, as we will have more versions and adding a constant for each version seems not right.
A rule-based check would be nice.
We could have constants/functions for version parts:

  • gc_major
  • gc_minor
  • gc_bugfix
  • gc_build

So that the calling side can either use rule-based version compatibility check or use the version parts individually.

@Pazus
Copy link
Member

Pazus commented Aug 2, 2017

We can introduce constants only for major versions and have 4 numeric constants as you said

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants