classComment
final class Comment
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.COMMENT ON kind object IS 'text' | NULL: sets or removes the comment of an object.
Mirrors PostgreSQL's CommentStmt. NULL, like an empty string, removes the comment. A commented relation or column is resolved. Source: https://www.postgresql.org/docs/17/sql-comment.html.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("COMMENT ON COLUMN t.a IS 'key'");
[$operation->statement->kind->value, $operation->statement->comment?->value] // => ['COLUMN', 'key']Properties§
public ObjectKind $kindpublic ObjectReference $objectpublic StringConstant|null $commentMethods§
public function __construct(
public ObjectKind $kind,
public ObjectReference $object,
public StringConstant|null $comment,
)Parameters
$kind | ObjectKind | The kind of the object |
$object | ObjectReference | The object, named as COMMENT names objects of the kind |
$comment | StringConstant|null | The comment; null for NULL |
Calls 5
- new ObjectForms line 43
- static-call Check::input() line 44
- function-call
in_arrayline 44 - method-call ObjectForms::form() line 44
- method-call ObjectForms::comment() line 44
public function deriveStatement(Derivation $derivation): voidDerives the object.
Parameters
$derivation | Derivation |
Calls 4
- method-call ObjectFacts::derive() line 52
- new ObjectFacts line 52
- method-call RelationKinds::named() line 53
- new RelationKinds line 53
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 61
- method-call ObjectSpelling::kind() line 62
- new ObjectSpelling line 62
- method-call Output::node() line 63
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.