Caqti_template.VersionSourceOpaque version strings with comparison.
This version number module is intended for dispatching on details about an SQL intepreter or other relevant aspects of a relational database system. The only constructor is private, instead the Infix module provides direct comparison to strings for ideomatic usage in the query-returning callback of request templates.
Some care is needed to match ranges of versions correctly:
Dialect may by unknown. An unknown version compares like the empty string, meaning that it compares before any other (sensible) version. If another logic is desired, is_known can be used to distinugish it.Dialect may also include build numbers, distribution details, etc. Therefore it seldom makes sense to compare it agains the exact version of the software release. Such versions will instead compare between the version of the corresponding software release and the next possible version using a normal decimal-dotted versioning scheme.Compares two versions lexicographically group-by-group and component-by-component, using common conventions for comparing version numbers:
'-'.'.'.'~' compares before anything else, including the empty suffix.The ordering subject to change if we should encounter problematic differences with versioning schemes used by supported database systems.
Asymmetric infix oparator for testing version ranges. The first argument is a version number, typically obtained from the server_version fields of Dialect.t, and the second argument is a string representation of the version to compare against.