IPM
Index Class Reference
Inheritance diagram for Index:
Inheritance graph

Static Public Member Functions

 DeleteIndex (_.Library.CacheString pID, _.Library.Binary pArg)
 This method is invoked when an existing instance of a class is deleted.
 
 InsertIndex (_.Library.CacheString pID, _.Library.Binary pArg)
 This method is invoked when a new instance of a class is inserted into the database.
 
 UpdateIndex (_.Library.CacheString pID, _.Library.Binary pArg)
 This method is invoked when an existing instance of a class is updated.
 

Detailed Description

Functional index on semantic versions. This serves two purposes:

  1. Enable searching based on module name and semantic version expression without scanning the whole extent
  2. Simplify ordering based on latest semantic version, properly handling major/minor/patch version numbers and prerelease designations.

To use this index in a class, define an index on a string property (the module name) and a property of type <class>IPM.General.SemanticVersion</class>. Index SemVer On (Name, Version) As IPM.General.SemanticVersion.Index; You must also define a property with the same name as that index, as follows: Property SemVer As String(MAXLEN = 512) [ SqlComputeCode = {set {*} = ##class(IPM.Repo.Filesystem.Cache).SemVerNode({Name},{Version})}, SqlComputed, SqlComputeOnChange = (%INSERT, %UPDATE) ];

For an example, see <class>IPM.Repo.Filesystem.Cache</class>.

To use the generated Find method and the IPM.General.SemanticVersion.Find (as in the example of IPM_PackageManager_Server._Module): SELECT Name,VersionString FROM IPM_PackageManager_Server._Module WHERE ID INSET IPM_PackageManager_Server.Module_SemVerFind('HS.JSON','0.x','snapshot') To facilitate ordering by semantic version, classes that define such indices may also implement class queries to wrap IPM.General.SemanticVersion.Find:Matches.