From 4f2d3a39cd6e719cf21c33f5afead7e86bb6603d Mon Sep 17 00:00:00 2001 From: Jan Skrasek Date: Tue, 19 Mar 2024 13:18:09 +0100 Subject: [PATCH] allow processing Fqn with %column modifier --- src/SqlProcessor.php | 1 + tests/cases/unit/SqlProcessorTest.identifiers.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/SqlProcessor.php b/src/SqlProcessor.php index 653eb42..71141f3 100644 --- a/src/SqlProcessor.php +++ b/src/SqlProcessor.php @@ -297,6 +297,7 @@ public function processModifier(string $type, mixed $value): string } elseif ($value instanceof Fqn) { switch ($type) { + case 'column': case 'table': $schema = $this->identifierToSql($value->schema); $table = $this->identifierToSql($value->name); diff --git a/tests/cases/unit/SqlProcessorTest.identifiers.php b/tests/cases/unit/SqlProcessorTest.identifiers.php index 7451f2c..9e66490 100644 --- a/tests/cases/unit/SqlProcessorTest.identifiers.php +++ b/tests/cases/unit/SqlProcessorTest.identifiers.php @@ -55,6 +55,11 @@ public function testFqn() '`a`.`b`', $this->parser->process(['%table', new Fqn(schema: 'a', name: 'b')]), ); + + Assert::same( + '`a`.`b`', + $this->parser->process(['%column', new Fqn(schema: 'a', name: 'b')]), + ); }