classIntoClause
final class IntoClause
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.The INTO clause of SELECT INTO: the new table the rows are stored in.
Mirrors PostgreSQL's IntoClause of a selection. The optional TABLE word changes nothing and is not kept. Source: https://www.postgresql.org/docs/17/sql-selectinto.html.
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT 1 AS a INTO TEMP TABLE t');
[$query->statement->into->table->name->value, $query->statement->into->persistence->value, $query->toString()] // => ['t', 'TEMP', 'SELECT 1 AS a INTO TEMP t']Properties§
public QualifiedName $tablepublic IntoPersistence $persistence = IntoPersistence::PermanentMethods§
public function __construct(
public QualifiedName $table,
public IntoPersistence $persistence = IntoPersistence::Permanent,
)Parameters
$table | QualifiedName | The name of the new table |
$persistence | IntoPersistence | The kind of table, as written |
Calls 1
- class-const IntoPersistence::Permanent() line 33
public function render(Output $out): voidWrites INTO, the persistence words and the table name.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 42
- method-call IntoPersistence::keywords() line 42
- method-call Spelling::qualified() line 43
- new Spelling line 43
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
IntoClauseTestcalls
Relations§
Instantiated in 1
Type declarations 3
- type SqlSemantics\Platform\PostgreSql\Lowering\Query\SelectRule packages/sql-semantics-postgres/src/Lowering/Query/SelectRule.php:280
- type SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\QueryRoots packages/sql-semantics-postgres/src/Rules/Query/Facts/QueryRoots.php:84
- type SqlSemantics\Platform\PostgreSql\Statement\Query\Select packages/sql-semantics-postgres/src/Statement/Query/Select.php:89