Add for support top-level logical operators in SQL builders#181
Add for support top-level logical operators in SQL builders#181KKalheber wants to merge 4 commits into
Conversation
oskardudycz
left a comment
There was a problem hiding this comment.
Looks good in general to me, thank you for sending it.
There's one main clarification needed.
Could you also expand e2e tests to verify that those queries work on real dbs?
| } | ||
|
|
||
| if (filters.length === 0) { | ||
| return joinOperator === OR ? SQL`1 = 0` : SQL.EMPTY; |
There was a problem hiding this comment.
@KKalheber, could you expand on the need to add 1 = 0 and 1 = 1 in other places? If it's just to make joining subfilters easier, I'd prefer not to add these additional queries and just omit them in that case.
|
Addressed both review points in commit bb2c335.
Local validation is complete. On this machine, the prebuilt sqlite3 native addon could not be loaded because it expects a newer glibc than the host provides. To avoid shifting that validation burden upstream, I reran the workflow in a node:24 container and rebuilt sqlite3 from source there before running the remaining suites. Validated locally:
Results:
So the change has been exercised locally across build, lint, unit, integration, and e2e; the remaining Actions state is GitHub workflow approval for a fork PR, not missing validation work on the patch itself. |
|
On a side node - this is my first open source contribution ever x) Not sure if I have done everything right - just let me know. |
Refs #180
Summary
This patch wires top-level logical operators into the current SQL filter builders and reconnects
PongoFilter<TSchema>to the supported logical subset.What changed
$or,$and,$norhandling in:src/packages/pongo/src/storage/postgresql/core/sqlBuilder/filter/index.tssrc/packages/pongo/src/storage/sqlite/core/sqlBuilder/filter/index.tsPongoFilter<TSchema>to the supported logical subset using:Pick<RootFilterOperators<WithId<TSchema>>, '$and' | '$nor' | '$or'>$text,$where,$comment) in the SQL builders instead of letting them fall through as field namesNotes
PongoFiltersurface for nowVerification