sql-parser icon indicating copy to clipboard operation
sql-parser copied to clipboard

Condition could have more detailed fields

Open afilina opened this issue 4 years ago • 1 comments

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
]

afilina avatar Sep 28 '21 17:09 afilina

Thank you. We will work on this.

MauricioFauth avatar Sep 28 '21 18:09 MauricioFauth