interface QueryModelInterface
Public API: explicitly declared with @visibility public.

Converts a call and its derived inputs into SQL without performing derivation itself.

Compiling a statement from a core-derived inputdoctest
$model = new class implements \SqlCatalog\Core\Extension\Model\QueryModelInterface {
        public function inputs(\PhpParser\Node\Expr\CallLike $call): array { return [$call->getArgs()[0]->value]; }
        public function statements(\PhpParser\Node\Expr\CallLike $call, array $values): array {
            return [new \SqlCatalog\Core\Extension\Model\QueryOutput(\SqlCatalog\Core\Evaluation\Domain::literal('SELECT * FROM ')->concat($values[0]), \SqlCatalog\Core\Evaluation\Domain::literal(null))];
        }
    };
    $call = new \PhpParser\Node\Expr\FuncCall(new \PhpParser\Node\Name('read_table'));
    $model->statements($call, [\SqlCatalog\Core\Evaluation\Domain::literal('users')])[0]->sql->soleLiteral()->value // => 'SELECT * FROM users'

Methods§

public function inputs(CallLike $call): list<Expr>

Parameters

$callCallLike

Returns

list<Expr> Expressions to derive together, preserving their correspondence.
public function statements(CallLike $call, list<Domain> $values): list<QueryOutput>

Parameters

$callCallLike
$valueslist<Domain>The inputs derived by the core in the requested order.

Returns

list<QueryOutput> Statements or alternatives, including explicit model gaps.

Test cases 3§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 2
Other tests reaching this symbol 1

Relations§

Implemented by 1
Type declarations 1