classArgumentText
final class ArgumentText
Reads a definition value the way the defGet* functions of PostgreSQL do.
Rule: PG-DEFINE-VALUE-001. The grammar gives a definition value as a type name (func_type), a reserved keyword or NONE (a string node holding the lower-case word), an operator (a name list), a number (an integer node when it fits in 32 bits, otherwise a float node) or a string. The names of a type name are its written parts, or pg_catalog and the internal name for a type keyword, as SystemTypeName builds them; its text is those names joined by dots with %TYPE and [] appended as TypeNameToString does; modifiers and SETOF are not part of either. The text of an integer node is its value, the text of a float node is the written text of the constant with the sign of NumericOnly. Terminates: no recursion. Source: defGetString, defGetQualifiedName and defGetInt32 in src/backend/commands/define.c, appendTypeNameToBuffer in src/backend/parser/parse_type.c and def_arg in src/backend/parser/gram.y of PostgreSQL 17. Status: Implemented.
Methods§
public function text(TypeName|KeywordWord|OperatorName|SignedNumber|StringConstant $value): stringAnswers the text the server reads from a value.
Parameters
Returns
stringTest cases 1
Called from 8
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::value() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:119
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::value() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:120
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::rejected() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:139
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::choice() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:142
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::length() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:155
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::boolean() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:176
- method-call SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\ChoiceArgument::__construct() packages/sql-semantics-postgres/src/Statement/Object/Attribute/ChoiceArgument.php:44
- method-call SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\LengthArgument::__construct() packages/sql-semantics-postgres/src/Statement/Object/Attribute/LengthArgument.php:41
Calls 3
- method-call ArgumentText::joined() line 44
- method-call ArgumentText::names() line 44
- method-call ArgumentText::number() line 47
Answers the names of a type name: its written parts, or pg_catalog and the internal name of a type keyword.
Parameters
$type | TypeName |
Returns
non-empty-list<Name>Test cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\ArgumentText::text() packages/sql-semantics-postgres/src/Rules/Routine/ArgumentText.php:44
- method-call SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\NameArgument::parts() packages/sql-semantics-postgres/src/Statement/Object/Attribute/NameArgument.php:70
public function integer(SignedNumber $number): ?intAnswers the value of a number the grammar reads as an integer node, or null for a float node.
Parameters
$number | SignedNumber |
Returns
?intTest cases 1
Called from 7
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::read() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:115
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::length() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:154
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::boolean() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:171
- method-call SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\IntegerArgument::__construct() packages/sql-semantics-postgres/src/Statement/Object/Attribute/IntegerArgument.php:39
- method-call SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\IntegerArgument::value() packages/sql-semantics-postgres/src/Statement/Object/Attribute/IntegerArgument.php:47
- method-call SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\LengthArgument::__construct() packages/sql-semantics-postgres/src/Statement/Object/Attribute/LengthArgument.php:41
- method-call SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\LengthArgument::bytes() packages/sql-semantics-postgres/src/Statement/Object/Attribute/LengthArgument.php:49
public function number(SignedNumber $number): stringAnswers the text of a number: the integer value, or the written text of a float.
Parameters
$number | SignedNumber |
Returns
stringTest cases 1
Called from 1
Calls 1
- method-call SignedNumber::text() line 85
Test cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
ArgumentTextTest::testIntegerAnswersOnlyThirtyTwoBitIntegerscallsArgumentTextTest::testJoinedSeparatesNamesWithDotscallsArgumentTextTest::testNamesAddsTheCatalogSchemaToATypeKeywordcallsArgumentTextTest::testNumberWritesTheTextOfAFloatAsWrittencallsArgumentTextTest::testTextReadsEachValueKindcalls
Relations§
Instantiated in 12
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::value() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:115
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::rejected() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:139
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::read() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:115
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::choice() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:142
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::length() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:152
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::boolean() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:170
- new SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\ChoiceArgument::__construct() packages/sql-semantics-postgres/src/Statement/Object/Attribute/ChoiceArgument.php:44
- new SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\IntegerArgument::__construct() packages/sql-semantics-postgres/src/Statement/Object/Attribute/IntegerArgument.php:39
- new SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\IntegerArgument::value() packages/sql-semantics-postgres/src/Statement/Object/Attribute/IntegerArgument.php:47
- new SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\LengthArgument::__construct() packages/sql-semantics-postgres/src/Statement/Object/Attribute/LengthArgument.php:40
- new SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\LengthArgument::bytes() packages/sql-semantics-postgres/src/Statement/Object/Attribute/LengthArgument.php:49
- new SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\NameArgument::parts() packages/sql-semantics-postgres/src/Statement/Object/Attribute/NameArgument.php:70
Method calls 16
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::value() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:119
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::value() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:120
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeChecks::rejected() packages/sql-semantics-postgres/src/Rules/Routine/AttributeChecks.php:139
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::read() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:115
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::choice() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:142
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::length() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:154
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::length() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:155
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::boolean() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:171
- method-call SqlSemantics\Platform\PostgreSql\Rules\Routine\AttributeReader::boolean() packages/sql-semantics-postgres/src/Rules/Routine/AttributeReader.php:176
- method-call SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\ChoiceArgument::__construct() packages/sql-semantics-postgres/src/Statement/Object/Attribute/ChoiceArgument.php:44
- method-call SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\IntegerArgument::__construct() packages/sql-semantics-postgres/src/Statement/Object/Attribute/IntegerArgument.php:39
- method-call SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\IntegerArgument::value() packages/sql-semantics-postgres/src/Statement/Object/Attribute/IntegerArgument.php:47
- method-call SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\LengthArgument::__construct() packages/sql-semantics-postgres/src/Statement/Object/Attribute/LengthArgument.php:41
- method-call SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\LengthArgument::__construct() packages/sql-semantics-postgres/src/Statement/Object/Attribute/LengthArgument.php:41
- method-call SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\LengthArgument::bytes() packages/sql-semantics-postgres/src/Statement/Object/Attribute/LengthArgument.php:49
- method-call SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\NameArgument::parts() packages/sql-semantics-postgres/src/Statement/Object/Attribute/NameArgument.php:70