classSources
final class Sources
Tells which queries a statement may hold where the grammar writes SelectStmt.
Rule: PG-QUERY-SOURCE-001. A SelectStmt is a selection, TABLE, VALUES, a set operation, a query with WITH, ORDER BY, LIMIT or locking clauses, or one of these in parentheses. For INSERT, a VALUES list alone, in any number of parentheses, is the VALUES rows of the INSERT, not its query. Termination: one walk down the parentheses. Source: https://www.postgresql.org/docs/17/sql-insert.html. Status: Implemented.
Methods§
public function statement(Query $query): boolTells whether a query is written as a SelectStmt.
Parameters
$query | Query |
Returns
boolTest cases 2
Called from 4
- method-call SqlSemantics\Platform\PostgreSql\Rules\Manipulation\Sources::insertable() packages/sql-semantics-postgres/src/Rules/Manipulation/Sources.php:48
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Copy\CopyQuery::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Copy/CopyQuery.php:58
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Cursor\DeclareCursor::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Cursor/DeclareCursor.php:51
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Prepared\Prepare::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Prepared/Prepare.php:52
public function insertable(Query $query): boolTells whether a query can be the query of an INSERT: a SelectStmt that is not VALUES alone in parentheses or none.
Parameters
$query | Query |
Returns
boolTest cases 1
Called from 1
Calls 1
- method-call Sources::statement() line 48
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Relations§
Instantiated in 4
- new SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Copy\CopyQuery::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Copy/CopyQuery.php:58
- new SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Cursor\DeclareCursor::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Cursor/DeclareCursor.php:51
- new SqlSemantics\Platform\PostgreSql\Statement\Manipulation\InsertSelect::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/InsertSelect.php:76
- new SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Prepared\Prepare::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Prepared/Prepare.php:52
Method calls 4
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Copy\CopyQuery::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Copy/CopyQuery.php:58
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Cursor\DeclareCursor::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Cursor/DeclareCursor.php:51
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\InsertSelect::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/InsertSelect.php:76
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Prepared\Prepare::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Prepared/Prepare.php:52