package caqti
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=8f6c1724b59ac22a5c657c9e53b9a1706e39ecd462e82958b0cea88e43f0aba7
sha512=75b968ab37ae94cadcaabbcce0f91b1ffa4334ed69e441bdeb823077eb7675264282efb0fab3baaaad446582cfb427769e19f22c8c194a316ac2248c3fba5cf8
doc/caqti.template/Caqti_template/Version/index.html
Module Caqti_template.VersionSource
Opaque 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:
- A version provided by
Dialectmay 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_knowncan be used to distinugish it.
- A version provided by
Dialectmay 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:
- Groups of components are separated by
'-'. - Components are separated by
'.'. - Continuous sequences of digits are compared numerically, i.e. after skipping leading zeros, longer such sequences compare after shorter ones.
'~'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.