Skip to main content

Module semver

Module semver 

Source
Expand description

Semantic versioning validation for DuckDB community extensions.

validate_semver checks strict semantic versioning, validate_extension_version checks the (much looser) extension.version field of a community-extension description.yml, and classify_extension_version maps a version onto DuckDB’s stability tiers.

§DuckDB Extension Versioning Scheme

DuckDB core extensions use a three-tier versioning scheme:

LevelFormatExampleMeaning
UnstableShort git hash690bfc5No stability guarantees
Pre-releasev0.y.zv0.1.0Working toward stability, semver applies
Stablevx.y.z (x>0)v1.0.0Full semver, backwards-compatible API

DuckDB’s page writes the semver tiers with a leading v, and the version extension-ci-tools stamps into a binary is the git tag at HEAD (conventionally vX.Y.Z) or else the short hash, so classify_extension_version accepts the v as optional.

Use classify_extension_version to determine which tier a version falls into, or validate_extension_version to accept both semver and git-hash formats.

§Reference

Enums§

ExtensionStability
The stability level of a DuckDB extension version.

Functions§

classify_extension_version
Classifies an extension version into its stability level.
validate_extension_version
Validates an extension version string for a community-extension description.yml.
validate_semver
Validates that a version string is valid semantic versioning.