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
var stringValue: StringThe version represented as aString.
Instance Methods
func isEqual(to: any SQLDatabaseReportedVersion) -> BoolReturnstrueif the provided version is the same version asself.func isNewer(than: any SQLDatabaseReportedVersion) -> BoolCheck whether the current version (i.e.self) is newer than the one given.func isNotNewer(than: any SQLDatabaseReportedVersion) -> BoolCheck whether the current version (i.e.self) is older than or equal to the one given.func isNotOlder(than: any SQLDatabaseReportedVersion) -> BoolCheck whether the current version (i.e.self) is newer than or equal to the one given.func isOlder(than: any SQLDatabaseReportedVersion) -> BoolReturnstrueif the provided version is newer than the version represented byself.
Default Implementations
Relationships
Inherits From
Swift.ComparableSwift.EquatableSwift.SendableSwift.SendableMetatype
See Also
Drivers
protocol SQLDialectAn abstract definition of a specific dialect of SQL.struct SQLAlterTableSyntaxEncapsulates a dialect’s support forALTER TABLEsyntax.struct SQLTriggerSyntaxEncapsulates a dialect’s support forCREATE TRIGGERandDROP TRIGGERsyntax.struct SQLUnionFeaturesA set of feature support flags forUNIONqueries.enum SQLEnumSyntaxPossible values for a dialect’s strongly-typed enumeration support.enum SQLUpsertSyntaxThe supported syntax variants which a SQL dialect can use to to specify conflict resolution clauses.