Skip to content

Protocol

SQLDatabaseReportedVersion

Provides a protocol for reporting and comparing database version numbers.
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

Instance Methods

  • isEqual(to:)
    Returns true if the provided version is the same version as self.
  • 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:)
    Returns true if the provided version is newer than the version represented by self.

Default Implementations

Relationships

Inherits From

  • Swift.Comparable
  • Swift.Equatable
  • Swift.Sendable
  • Swift.SendableMetatype

See Also

Drivers

  • SQLDialect
    An abstract definition of a specific dialect of SQL.
  • SQLAlterTableSyntax
    Encapsulates a dialect’s support for ALTER TABLE syntax.
  • SQLTriggerSyntax
    Encapsulates a dialect’s support for CREATE TRIGGER and DROP TRIGGER syntax.
  • SQLUnionFeatures
    A set of feature support flags for UNION queries.
  • SQLEnumSyntax
    Possible values for a dialect’s strongly-typed enumeration support.
  • SQLUpsertSyntax
    The supported syntax variants which a SQL dialect can use to to specify conflict resolution clauses.