final class ExtensionVersion
    implements ExtensionOption
    uses Snapshot
Public API: explicitly declared with @visibility public.

The VERSION or FROM option of CREATE EXTENSION.

A version is written as a word or as a string; the server receives its text either way. Source: https://www.postgresql.org/docs/17/sql-createextension.html.

Reading the version to installdoctest
$version = new \SqlSemantics\Platform\PostgreSql\Statement\Catalog\Extension\ExtensionVersion(\SqlSemantics\Platform\PostgreSql\Statement\Catalog\Extension\VersionRole::Target, new \SqlSemantics\Platform\PostgreSql\Statement\Literal\StringConstant('1.2'));
    $version->option() // => 'new_version'

Properties§

public VersionRole $role

Methods§

public function __construct(public VersionRole $role, public Word|StringConstant $version)

Parameters

$roleVersionRoleWhether this is the version to install or the old version
$versionWord|StringConstantThe version
public function option(): string

Answers the option name the server receives.

Returns

string
Test cases 1
Calls 2
public function render(Output $out): void

Writes the keyword and the version.

Parameters

$outOutput
Calls 1

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 2