enumQueryMisuseRule
enum QueryMisuseRule: string
Public API: explicitly declared with
@visibility public.The rules of PostgreSQL a grammatical query can break, in the words of the server.
A %s in a message stands for the name the problem is about. Source: https://www.postgresql.org/docs/17/sql-select.html.
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT *');
$query->facts->diagnostics[0]->rule // => \SqlSemantics\Platform\PostgreSql\Statement\Query\Problem\QueryMisuseRule::StarWithoutTablesCases§
case StarWithoutTables = 'SELECT * with no tables specified is not valid'case NotComposite = 'type %s is not composite'case MultipleOrderBy = 'multiple ORDER BY clauses not allowed'case MultipleLimit = 'multiple LIMIT clauses not allowed'case MultipleOffset = 'multiple OFFSET clauses not allowed'case MultipleWith = 'multiple WITH clauses not allowed'case CommaLimit = 'LIMIT #,# syntax is not supported'case TiesWithoutOrderBy = 'WITH TIES cannot be specified without ORDER BY clause'case TiesWithSkipLocked = 'SKIP LOCKED and WITH TIES options cannot be used together'case LockingWithSetOperation = 'FOR UPDATE is not allowed with UNION/INTERSECT/EXCEPT'case LockingWithDistinct = 'FOR UPDATE is not allowed with DISTINCT clause'case LockingWithGroupBy = 'FOR UPDATE is not allowed with GROUP BY clause'case LockingWithHaving = 'FOR UPDATE is not allowed with HAVING clause'case LockingOnValues = 'FOR UPDATE cannot be applied to VALUES'case LockingOnJoin = '%s cannot be applied to a join'case LockingOnFunction = '%s cannot be applied to a function'case LockingOnTableFunction = '%s cannot be applied to a table function'case LockingOnCommonTable = '%s cannot be applied to a WITH query'case LockingNullableSide = '%s cannot be applied to the nullable side of an outer join'case LockedRelationNotInFrom = 'relation "%s" in FOR UPDATE clause not found in FROM clause'case NonIntegerConstant = 'non-integer constant in %s'case LockedRelationQualified = 'SELECT FOR UPDATE/SHARE must specify unqualified relation names'case MutualRecursion = 'mutual recursion between WITH items is not implemented'case RepeatedCommonColumn = 'common column name "%s" appears more than once in left or right table'case SetOperationOrderByExpression = 'invalid UNION/INTERSECT/EXCEPT ORDER BY clause'case DistinctOnOrderBy = 'SELECT DISTINCT ON expressions must match initial ORDER BY expressions'case IntoNotAllowed = 'SELECT ... INTO is not allowed here'case DuplicateCommonTable = 'WITH query name "%s" specified more than once'case RecursiveForm = 'recursive query "%s" does not have the form non-recursive-term UNION [ALL] rec…case SearchOrCycleNotRecursive = 'WITH query "%s" is not recursive but has a SEARCH or CYCLE clause'case MergeInWith = 'MERGE not supported in WITH query'case NestedModification = 'WITH clause containing a data-modifying statement must be at the top level'case WithoutReturning = 'WITH query "%s" does not have a RETURNING clause'case UsingColumnRepeated = 'column name "%s" appears more than once in USING clause'case UsingColumnNotInLeft = 'column "%s" specified in USING clause does not exist in left table'case UsingColumnNotInRight = 'column "%s" specified in USING clause does not exist in right table'case RecordWithoutDefinitions = 'a column definition list is required for functions returning "record"'case RowsFromDefinitions = 'ROWS FROM() with multiple functions cannot have a column definition list'case RepeatedDefinitions = 'multiple column definition lists are not allowed for the same function'case DefinitionsForBaseType = 'a column definition list is only allowed for functions returning "record"'case UnrecognizedColumnOption = 'unrecognized column option "%s"'case RedundantNullability = 'conflicting or redundant NULL / NOT NULL declarations for column "%s"'case RepeatedDefault = 'only one DEFAULT value is allowed'case RepeatedPath = 'only one PATH value per column is allowed'case RepeatedOrdinality = 'only one FOR ORDINALITY column is allowed'case PathNotConstant = 'only string constants are supported in JSON_TABLE path specification'case SearchColumnMissing = 'search column "%s" not in WITH query column list'case CycleColumnMissing = 'cycle column "%s" not in WITH query column list'case TablesampleTarget = 'TABLESAMPLE clause can only be applied to tables and materialized views'case LateralJoinType = 'invalid reference to FROM-clause entry for table "%s"'Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 1
Relations§
Constant reads 52
- class-const SqlSemantics\Platform\PostgreSql\Rules\Manipulation\Placement::into() packages/sql-semantics-postgres/src/Rules/Manipulation/Placement.php:110
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\DistinctOrdering::check() packages/sql-semantics-postgres/src/Rules/Query/DistinctOrdering.php:57
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\DistinctOrdering::check() packages/sql-semantics-postgres/src/Rules/Query/DistinctOrdering.php:65
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\CommonTableFacts::bind() packages/sql-semantics-postgres/src/Rules/Query/Facts/CommonTableFacts.php:72
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\CommonTableFacts::bind() packages/sql-semantics-postgres/src/Rules/Query/Facts/CommonTableFacts.php:83
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\CommonTableFacts::bind() packages/sql-semantics-postgres/src/Rules/Query/Facts/CommonTableFacts.php:86
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\CommonTableFacts::bind() packages/sql-semantics-postgres/src/Rules/Query/Facts/CommonTableFacts.php:89
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\CommonTableFacts::order() packages/sql-semantics-postgres/src/Rules/Query/Facts/CommonTableFacts.php:152
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\CommonTableFacts::shape() packages/sql-semantics-postgres/src/Rules/Query/Facts/CommonTableFacts.php:189
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\CommonTableFacts::shape() packages/sql-semantics-postgres/src/Rules/Query/Facts/CommonTableFacts.php:193
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\ModifyingCommonTables::check() packages/sql-semantics-postgres/src/Rules/Query/Facts/ModifyingCommonTables.php:46
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\QueryExpressionFacts::derive() packages/sql-semantics-postgres/src/Rules/Query/Facts/QueryExpressionFacts.php:60
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\QueryExpressionFacts::derive() packages/sql-semantics-postgres/src/Rules/Query/Facts/QueryExpressionFacts.php:60
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\QueryExpressionFacts::merged() packages/sql-semantics-postgres/src/Rules/Query/Facts/QueryExpressionFacts.php:89
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\QueryExpressionFacts::merged() packages/sql-semantics-postgres/src/Rules/Query/Facts/QueryExpressionFacts.php:90
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\QueryExpressionFacts::merged() packages/sql-semantics-postgres/src/Rules/Query/Facts/QueryExpressionFacts.php:91
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\QueryExpressionFacts::merged() packages/sql-semantics-postgres/src/Rules/Query/Facts/QueryExpressionFacts.php:92
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\QueryRoots::derive() packages/sql-semantics-postgres/src/Rules/Query/Facts/QueryRoots.php:53
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\SelectFacts::derive() packages/sql-semantics-postgres/src/Rules/Query/Facts/SelectFacts.php:91
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\SelectFacts::derive() packages/sql-semantics-postgres/src/Rules/Query/Facts/SelectFacts.php:91
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\SelectFacts::derive() packages/sql-semantics-postgres/src/Rules/Query/Facts/SelectFacts.php:91
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Limits::derive() packages/sql-semantics-postgres/src/Rules/Query/Limits.php:49
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Limits::ties() packages/sql-semantics-postgres/src/Rules/Query/Limits.php:84
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Limits::ties() packages/sql-semantics-postgres/src/Rules/Query/Limits.php:87
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Limits::locked() packages/sql-semantics-postgres/src/Rules/Query/Limits.php:103
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Limits::locked() packages/sql-semantics-postgres/src/Rules/Query/Limits.php:111
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Locking::check() packages/sql-semantics-postgres/src/Rules/Query/Locking.php:81
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Locking::refused() packages/sql-semantics-postgres/src/Rules/Query/Locking.php:139
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Locking::refused() packages/sql-semantics-postgres/src/Rules/Query/Locking.php:140
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Locking::refused() packages/sql-semantics-postgres/src/Rules/Query/Locking.php:141
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Locking::refused() packages/sql-semantics-postgres/src/Rules/Query/Locking.php:142
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Ordering::outputs() packages/sql-semantics-postgres/src/Rules/Query/Ordering.php:109
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Ordering::outputs() packages/sql-semantics-postgres/src/Rules/Query/Ordering.php:111
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\Ordering::term() packages/sql-semantics-postgres/src/Rules/Query/Ordering.php:130
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\StarExpansion::all() packages/sql-semantics-postgres/src/Rules/Query/StarExpansion.php:63
- class-const SqlSemantics\Platform\PostgreSql\Rules\Query\StarExpansion::composite() packages/sql-semantics-postgres/src/Rules/Query/StarExpansion.php:108
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\FunctionShapes::derive() packages/sql-semantics-postgres/src/Rules/Resolution/FunctionShapes.php:63
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\FunctionShapes::derive() packages/sql-semantics-postgres/src/Rules/Resolution/FunctionShapes.php:63
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\FunctionShapes::defined() packages/sql-semantics-postgres/src/Rules/Resolution/FunctionShapes.php:111
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\Joining::join() packages/sql-semantics-postgres/src/Rules/Resolution/Joining.php:59
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\Joining::join() packages/sql-semantics-postgres/src/Rules/Resolution/Joining.php:60
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\Joining::names() packages/sql-semantics-postgres/src/Rules/Resolution/Joining.php:112
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\Joining::locate() packages/sql-semantics-postgres/src/Rules/Resolution/Joining.php:154
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\LateralReach::report() packages/sql-semantics-postgres/src/Rules/Resolution/LateralReach.php:111
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableFunctionShapes::xml() packages/sql-semantics-postgres/src/Rules/Resolution/TableFunctionShapes.php:76
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableFunctionShapes::options() packages/sql-semantics-postgres/src/Rules/Resolution/TableFunctionShapes.php:102
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableFunctionShapes::options() packages/sql-semantics-postgres/src/Rules/Resolution/TableFunctionShapes.php:107
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableFunctionShapes::options() packages/sql-semantics-postgres/src/Rules/Resolution/TableFunctionShapes.php:107
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableFunctionShapes::options() packages/sql-semantics-postgres/src/Rules/Resolution/TableFunctionShapes.php:107
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableFunctionShapes::json() packages/sql-semantics-postgres/src/Rules/Resolution/TableFunctionShapes.php:128
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableShapes::input() packages/sql-semantics-postgres/src/Rules/Resolution/TableShapes.php:60
- class-const SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableShapes::input() packages/sql-semantics-postgres/src/Rules/Resolution/TableShapes.php:74
Type declarations 4
- type SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\CommonTableFacts packages/sql-semantics-postgres/src/Rules/Query/Facts/CommonTableFacts.php:225
- type SqlSemantics\Platform\PostgreSql\Rules\Query\Locking packages/sql-semantics-postgres/src/Rules/Query/Locking.php:136
- type SqlSemantics\Platform\PostgreSql\Rules\Resolution\Joining packages/sql-semantics-postgres/src/Rules/Resolution/Joining.php:145
- type SqlSemantics\Platform\PostgreSql\Statement\Query\Problem\QueryMisuse packages/sql-semantics-postgres/src/Statement/Query/Problem/QueryMisuse.php:26