packages/sql-semantics-postgres/src/Statement/Expression/Problem/NotImplemented.php
1<?php
2
3declare(strict_types=1);
4
5namespace SqlSemantics\Platform\PostgreSql\Statement\Expression\Problem;
6
7use SqlSemantics\Platform\PostgreSql\Model\Statement\Fact\Diagnostic;
8use SqlSemantics\Platform\PostgreSql\Model\Statement\Snapshot;
9
10/**
11 * A construct the grammar accepts and the server rejects as not implemented.
12 *
13 * Source: https://www.postgresql.org/docs/17/unsupported-features-sql-standard.html.
14 *
15 * @visibility public
16 * @example Reading the message
17 * (new \SqlSemantics\Platform\PostgreSql\Statement\Expression\Problem\NotImplemented('UNIQUE predicate'))->message() // => 'UNIQUE predicate is not yet implemented.'
18 */
19final class NotImplemented implements Diagnostic
20{
21 use Snapshot;
22
23 /**
24 * @param string $feature The construct
25 */
26 public function __construct(public readonly string $feature)
27 {
28 }
29
30 /**
31 * Describes the problem.
32 */
33 public function message(): string
34 {
35 return $this->feature . ' is not yet implemented.';
36 }
37}
38