Skip to content

Commit

Permalink
allow processing Fqn with %column modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Mar 19, 2024
1 parent f04e07b commit 4f2d3a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/SqlProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions tests/cases/unit/SqlProcessorTest.identifiers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')]),
);
}


Expand Down

0 comments on commit 4f2d3a3

Please sign in to comment.