Protocol
SQLDatabaseReportedVersion
protocol SQLDatabaseReportedVersion : Comparable, Sendable
Overview
SQLKit allows databases to report their versions. As any given database implementation may have its own particular format for version numbers, the version is provided to SQLDatabase as a value of a type conforming to this protocol, which defines an interface for generically handling and comparing versions without needing to be aware of implementation-specific details.
The most common uses for database version information are disabling or enabling feature support in SQLDialect by version, tracking usage metrics by version, logging versions, and recording versions for debugging.
Each type implementing SQLDatabaseReportedVersion is responsible for providing definitions of equality and ordering semantics between versions which are meaningful in the versioning scheme of the underlying database.
Topics
Instance Properties
stringValueThe version represented as aString.
Instance Methods
isEqual(to:)Returnstrueif the provided version is the same version asself.isNewer(than:)Check whether the current version (i.e.self) is newer than the one given.isNotNewer(than:)Check whether the current version (i.e.self) is older than or equal to the one given.isNotOlder(than:)Check whether the current version (i.e.self) is newer than or equal to the one given.isOlder(than:)Returnstrueif the provided version is newer than the version represented byself.
Default Implementations
Relationships
Inherits From
Swift.ComparableSwift.EquatableSwift.SendableSwift.SendableMetatype
See Also
Drivers
SQLDialectAn abstract definition of a specific dialect of SQL.SQLAlterTableSyntaxEncapsulates a dialect’s support forALTER TABLEsyntax.SQLTriggerSyntaxEncapsulates a dialect’s support forCREATE TRIGGERandDROP TRIGGERsyntax.SQLUnionFeaturesA set of feature support flags forUNIONqueries.SQLEnumSyntaxPossible values for a dialect’s strongly-typed enumeration support.SQLUpsertSyntaxThe supported syntax variants which a SQL dialect can use to to specify conflict resolution clauses.