Open eznix86 opened 5 months ago
Currently, keys are extracted from the where statement which intrinsically creates an AND statement.
To prevent breaking changes, the current behaviour will stay the same, but we can consider to have custom operators to extend the where functionally.
Theses operators can extend the functionally within where clause.
where
Example:
qb.query({ columns: 'id, name, status', where: { status: { equals: 'finished' }, $or: [ { name: { equals: 'Alice' } }, { city: { equals: 'New York' } } ] } })
This will be parsed to become:
[!NOTE] Between status and $or, the operation AND stays applicable. Example below:
status
$or
AND
select id,name,status from users where status AND ( name = "alice" OR city = "New York" )
This can resolve #43
This can open opportunity to $and
$and
Currently, keys are extracted from the where statement which intrinsically creates an AND statement.
To prevent breaking changes, the current behaviour will stay the same, but we can consider to have custom operators to extend the where functionally.
Introducing $ operators.
Theses operators can extend the functionally within
where
clause.Example:
This will be parsed to become:
This can resolve #43
This can open opportunity to
$and