classColumnTyping
final class ColumnTyping
Answers the type a column definition declares.
Rule: PG-COLUMN-TYPE-001. A column has the type its type name denotes (PG-TYPE-LOOKUP-001). The serial pseudo-types are expanded first, as transformColumnDefinition does for a one-part type name without array bounds: smallserial/serial2 is int2, serial/serial4 is int4, bigserial/serial8 is int8, and the column is NOT NULL with a sequence default. An array of a serial type is an error. A type name the context cannot identify, a user type or a pg_catalog name an undeclared type of an earlier schema may hide, declares the column with the type that name denotes on the search path (NamedOnPath). A type name that is an error has no descriptor, and the declaration stops there. Source: https://www.postgresql.org/docs/17/datatype-numeric.html#DATATYPE-SERIAL. Status: Implemented.
Methods§
Answers the integer type a serial type name stands for, or null when the name is not a serial type.
Parameters
$type | TypeName |
Returns
Test cases 1
Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\ColumnTyping::descriptor() packages/sql-semantics-postgres/src/Rules/Table/Definition/ColumnTyping.php:64
- method-call SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Declarations::listed() packages/sql-semantics-postgres/src/Rules/Table/Definition/Declarations.php:97
- method-call SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Definitions::report() packages/sql-semantics-postgres/src/Rules/Table/Definition/Definitions.php:165
Calls 2
- function-call
countline 52 - class-const ColumnTyping::SERIAL() line 56
public function descriptor(TypeName $type, AnalysisContext $context): ?TypeDescriptorAnswers the declared type of a column, or null when the type name is an error.
Parameters
$type | TypeName | |
$context | AnalysisContext |
Returns
Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Rules\Table\Command\Alterations::widened() packages/sql-semantics-postgres/src/Rules/Table/Command/Alterations.php:125
- method-call SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Declarations::listed() packages/sql-semantics-postgres/src/Rules/Table/Definition/Declarations.php:93
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Element\ColumnDefinition::deriveClause() packages/sql-semantics-postgres/src/Statement/Table/Element/ColumnDefinition.php:80
Calls 4
- method-call ColumnTyping::serial() line 64
- method-call TypeName::typeFact() line 68
- new NamedOnPath line 76
- new ArrayOf line 78
Private surface 1§
Implementation details, listed for orientation only.
private const SERIAL = ['smallserial' => \SqlSemantics\Platform\PostgreSql\Statement\Type\Descriptor\B…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 4
- new SqlSemantics\Platform\PostgreSql\Rules\Table\Command\Alterations::widened() packages/sql-semantics-postgres/src/Rules/Table/Command/Alterations.php:125
- new SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Declarations::listed() packages/sql-semantics-postgres/src/Rules/Table/Definition/Declarations.php:88
- new SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Definitions::report() packages/sql-semantics-postgres/src/Rules/Table/Definition/Definitions.php:165
- new SqlSemantics\Platform\PostgreSql\Statement\Table\Element\ColumnDefinition::deriveClause() packages/sql-semantics-postgres/src/Statement/Table/Element/ColumnDefinition.php:80
Method calls 5
- method-call SqlSemantics\Platform\PostgreSql\Rules\Table\Command\Alterations::widened() packages/sql-semantics-postgres/src/Rules/Table/Command/Alterations.php:125
- method-call SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Declarations::listed() packages/sql-semantics-postgres/src/Rules/Table/Definition/Declarations.php:93
- method-call SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Declarations::listed() packages/sql-semantics-postgres/src/Rules/Table/Definition/Declarations.php:97
- method-call SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\Definitions::report() packages/sql-semantics-postgres/src/Rules/Table/Definition/Definitions.php:165
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Element\ColumnDefinition::deriveClause() packages/sql-semantics-postgres/src/Statement/Table/Element/ColumnDefinition.php:80