classColumnDefinition
final class ColumnDefinition
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Column definition operations for PostgreSQL definition.
Methods§
public function parseColumnDefinition(string $entry): array{name: string, type: string, columnType: ColumnDeclaration, notNull: bool, primaryKey: bool, unique: bool, default: string|null, identity: bool, generatedExpression: string|null}|nullParameters
$entry | string |
Returns
array{name: string, type: string, columnType: ColumnDeclaration, notNull: bool, primaryKey: bool, unique: bool, default: string|null, identity: bool, generatedExpression: string|null}|nullTest cases 2
Called from 1
Calls 16
- function-call
preg_matchline 24 - method-call TableConstraint::unquoteIdentifier() line 28
- new TableConstraint line 28
- function-call
trimline 29 - method-call ColumnTypeDeclaration::extractType() line 31
- new ColumnTypeDeclaration line 31
- static-call SqlTokenStream::tokenize() line 42
- static-call PgSqlLexerProfile::create() line 42
- static-call ColumnDefinition::isSerialType() line 49
- static-call ColumnDefinition::isSequenceDefault() line 50
- static-call ColumnDefinition::hasGeneratedIdentity() line 51
- method-call ColumnDefinition::generatedExpression() line 52
- function-call
str_containsline 54 - function-call
strtoupperline 54 - method-call PgSqlColumnTypeMapper::map() line 55
- new PgSqlColumnTypeMapper line 55
public static function isSequenceDefault(string $expression): boolIs sequence default.
Parameters
$expression | string |
Returns
boolTest cases 1
Called from 2
- static-call ZtdQuery\Platform\Postgres\Schema\Definition\ColumnDefinition::parseColumnDefinition() packages/ztd-query-postgres/src/Schema/Definition/ColumnDefinition.php:50
- static-call ZtdQuery\Platform\Postgres\Schema\Definition\TableFields::appendColumn() packages/ztd-query-postgres/src/Schema/Definition/TableFields.php:106
Calls 2
- static-call SqlTokenStream::tokenize() line 75
- static-call PgSqlLexerProfile::create() line 75
public static function isSerialType(string $nativeType): boolIs serial type.
Parameters
$nativeType | string |
Returns
boolTest cases 1
Called from 1
Calls 1
- function-call
strcasecmpline 92
public static function hasGeneratedIdentity(string $constraints): boolHas generated identity.
Parameters
$constraints | string |
Returns
boolTest cases 1
Called from 1
Calls 2
- static-call SqlTokenStream::tokenize() line 105
- static-call PgSqlLexerProfile::create() line 105
public function generatedExpression(string $afterType, bool $identity): ?stringReads a stored generated expression only for non-identity columns.
Parameters
$afterType | string | |
$identity | bool |
Returns
?stringTest cases 1
Called from 1
Calls 2
- static-call SqlTokenStream::tokenize() line 132
- static-call PgSqlLexerProfile::create() line 132
Test cases 15§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
Other tests reaching this symbol 10
PgSqlSessionFactoryTestcallsTableContextTestcallsPgSqlRewriterTestcallsStatementRewriterTestcallsTableFieldsTest::testAppendColumnRecordsGeneratedExpressionscallsPgSqlSchemaParserTestcallsSchemaInitializerTestcallsRowMutationResolverTestcallsTableMutationResolverTestcallsPgSqlMutationResolverTestcalls