classExtensionVersion
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.
$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 $rolepublic Word|StringConstant $versionMethods§
public function __construct(public VersionRole $role, public Word|StringConstant $version)Parameters
$role | VersionRole | Whether this is the version to install or the old version |
$version | Word|StringConstant | The version |
public function option(): stringAnswers the option name the server receives.
Returns
stringTest cases 1
Calls 2
- class-const VersionRole::Target() line 41
- class-const VersionRole::Source() line 42
public function render(Output $out): voidWrites the keyword and the version.
Parameters
$out | Output |
Calls 1
- method-call Output::keyword() line 51
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
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\ExtensionRule::options() packages/sql-semantics-postgres/src/Lowering/Catalog/ExtensionRule.php:161
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\ExtensionRule::options() packages/sql-semantics-postgres/src/Lowering/Catalog/ExtensionRule.php:162