phpmyadmin / phpmyadmin/sql-parser
Condition could have more detailed fields
未关闭
还没有人认领这个 Issue。
enhancement
- 主要语言
- PHP
- 星标
- 485
- 派生
- 119
- PR 合并指标
- 30 天内没有已合并 PR
描述
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
]
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先定位 parser 的 Condition 实例和现有的 expr 字段。比较所要求的 c.id = 2 和 customer.address_id IS NOT NULL 示例,然后定义必须公开哪些结构化的 operator 和 operand 信息;当 conditions 提供这些详细信息而不只是一个字符串时,工作就完成了。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- php, sql
- 领域
- compilers
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 30/100