packages/sql-semantics/src/Query.php

1<?php
2
3declare(strict_types=1);
4
5namespace SqlSemantics;
6
7/**
8 * A checked result of analyzing SQL. The database implementation provides its structure and semantic facts.
9 *
10 * @visibility public
11 * @example Retrieving SQL from any database query result
12 *     $query = new class implements \SqlSemantics\Query { public function toString(): string { return 'SELECT 1'; } };
13 *     $query->toString() // => 'SELECT 1'
14 */
15interface Query
16{
17    /**
18     * Returns SQL rendered from the analyzed structure.
19     */
20    public function toString(): string;
21}
22