classCastRule
final class CastRule
Lowers the cast and transform commands.
Rule: PG-CAST-LOWER-001. Scope: CreateCastStmt, cast_context, DropCastStmt, CreateTransformStmt, transform_element_list, DropTransformStmt. Constructors: CreateCast, CreateTransform, TransformFunction, and the routine family's Drop with a CastObject or TransformObject, because the server represents DROP CAST and DROP TRANSFORM as DropStmt of kind OBJECT_CAST and OBJECT_TRANSFORM. Source: https://www.postgresql.org/docs/17/sql-createcast.html, https://www.postgresql.org/docs/17/sql-dropcast.html, https://www.postgresql.org/docs/17/sql-createtransform.html, https://www.postgresql.org/docs/17/sql-droptransform.html. Status: Implemented.
Methods§
Lowers a cast or transform command.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 14
- new CatalogFlags line 66
- new CreateCast line 69
- method-call CastRule::context() line 69
- class-const CastConversion::Binary() line 70
- class-const CastConversion::InOut() line 71
- new Drop line 72
- class-const ObjectKind::Cast() line 72
- new CastPair line 72
- method-call CatalogFlags::present() line 72
- new CreateTransform line 73
- method-call CastRule::functions() line 73
- class-const ObjectKind::Transform() line 74
- new TransformFor line 74
- static-call ImplementationGap::production() line 75
public function context(Node $context): ?CastContextLowers cast_context; no context is null.
Parameters
$context | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Catalog\CastRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/CastRule.php:69
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Catalog\CastRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/CastRule.php:70
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Catalog\CastRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/CastRule.php:71
Calls 3
- class-const CastContext::Implicit() line 89
- class-const CastContext::Assignment() line 90
- static-call ImplementationGap::production() line 92
public function functions(Form $form): list<TransformFunction>Lowers transform_element_list into its functions in the order written.
Parameters
$form | Form |
Returns
list<TransformFunction>Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 4
- class-const CastRule::TRANSFORMS() line 106
- static-call ImplementationGap::production() line 106
- new TransformFunction line 107
- method-call Form::node() line 107
Private surface 2§
Implementation details, listed for orientation only.
private const TRANSFORMS = ['transform_element_list: FROM SQL_P WITH FUNCTION function_with_argtypes , TO …private Lowering $loweringTest cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.