Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Condition could have more detailed fields

Open
#357 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php, sql
Domain
compilers

Research direction

Start by locating the parser's Condition instances and the existing expr field. Compare the requested c.id = 2 and customer.address_id IS NOT NULL examples, then define what structured operator and operand information must be exposed; the work is done when conditions provide that detail instead of only a string.

Written by the indexing model from the issue text.

Description

enhancement

Currently, when I parse a query, I get WHERE as Condition instances. These have an expr field, which is just a string and not very useful when analyzing a query. It would be really nice if we could be able to get more detail from that, like the operator, operands, etc.

Examples:

// c.id = 2
[
    leftOperand: ColumnReference [ column: 'id', tableAlias: 'c' ] ,
    operator: Equals []
    rightOperand: Constant [ value: 2 ]
]
// customer.address_id IS NOT NULL
[
    leftOperand: ColumnReference [ column: 'address_id', tableName: 'customer' ] ,
    operator: IsNotNull
    rightOperand: null
]
Dominant language
PHP
Stars
485
Forks
119
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from phpmyadmin/sql-parser

All issues in phpmyadmin/sql-parser

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.