Condition could have more detailed fields
还没有人认领这个 Issue。
评估
调研方向
首先定位 parser 的 Condition 实例和现有的 expr 字段。比较所要求的 c.id = 2 和 customer.address_id IS NOT NULL 示例,然后定义必须公开哪些结构化的 operator 和 operand 信息;当 conditions 提供这些详细信息而不只是一个字符串时,工作就完成了。
由索引模型根据 Issue 内容生成。
描述
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
]
- 主要语言
- PHP
- 星标
- 485
- 派生
- 119
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
phpmyadmin/sql-parser 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
phpmyadmin/sql-parser#655 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 55/100
phpmyadmin/sql-parser#666 ·
-
难度 3/5 1-2 天 新手友好度 65/100
phpmyadmin/sql-parser#662 · 2 个 reaction ·
-
kind/support
难度 3/5 1-2 天 新手友好度 45/100
phpmyadmin/sql-parser#653 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 70/100
phpmyadmin/sql-parser#649 ·