Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query Builder Endpoint #52

Merged
merged 43 commits into from
Mar 14, 2025
Merged

Query Builder Endpoint #52

merged 43 commits into from
Mar 14, 2025

Conversation

zdrawku
Copy link
Contributor

@zdrawku zdrawku commented Mar 4, 2025

Thanks to @jcoitino

Operations / Data Type Matrix:

Operation Name Boolean Date DateTime Time Number String Implemented
null X X X X X X
notNull X X X X X X
in X X X X X X
inQuery X X X X X X
notInQuery X X X X X X
empty X X X X X X
notEmpty X X X X X X
all X
true X
false X
equals X X X X
doesNotEqual X X X X
before X X X
after X X X
today X X
yesterday X X
thisMonth X X
lastMonth X X
nextMonth X X
thisYear X X
lastYear X X
nextYear X X
at X
not_at X
at_before X
at_after X
greaterThan X
lessThan X
greaterThanOrEqualTo X
lessThanOrEqualTo X
contains X
doesNotContain X
startsWith X
endsWith X

@zdrawku zdrawku requested a review from pmoleri March 4, 2025 13:01
zdrawku and others added 4 commits March 4, 2025 15:04
…m user input

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@jcoitino
Copy link
Contributor

jcoitino commented Mar 12, 2025

I just implemented some missing date operators, but some of them dosent works and I have no idea how to let them work
The issue come from the fact there is no way to convert strings to date or datetime at LINQ to EF, and LINQ ops to compare are disallowed over strings. For this reason "before" and "after" ops for date and time are not working

BTW:

this DB has no TIME fields (and AppBuilder has not support for TIME fields either), so no matter operators for this type are implemented there is no way to test it

this DB has no date or date times values we could test with these operators (so implemented but not tested also)

  • today
  • yesterday
  • thisMonth
  • astMonth
  • nextMonth
  • thisYear
  • lastYear
  • nextYear

Take in mind this code added is just to be used by customers as a guide on how to implement query builder endpoints, nothing else

@pmoleri pmoleri merged commit 2f8fd85 into main Mar 14, 2025
3 checks passed
pmoleri pushed a commit that referenced this pull request Mar 14, 2025
**Operations / Data Type Matrix:**

| Operation Name      | Boolean | Date | DateTime | Time | Number | String | Implemented |
|---------------------|---------|------|----------|------|--------|--------|-------------|
| null                | X       | X    | X        | X    | X      | X      | ✔           |
| notNull             | X       | X    | X        | X    | X      | X      | ✔           |
| in                  | X       | X    | X        | X    | X      | X      | ✔           |
| inQuery             | X       | X    | X        | X    | X      | X      | ✔           |
| notInQuery          | X       | X    | X        | X    | X      | X      | ✔           |
| empty               | X       | X    | X        | X    | X      | X      | ✔           |
| notEmpty            | X       | X    | X        | X    | X      | X      | ✔           |
| all                 | X       |      |          |      |        |        | ✔           |
| true                | X       |      |          |      |        |        | ✔           |
| false               | X       |      |          |      |        |        | ✔           |
| equals              |         | X    | X        |      | X      | X      | ✔           |
| doesNotEqual        |         | X    | X        |      | X      | X      | ✔           |
| before              |         | X    | X        | X    |        |        | ✔           |
| after               |         | X    | X        | X    |        |        | ✔           |
| today               |         | X    | X        |      |        |        | ✔           |
| yesterday           |         | X    | X        |      |        |        | ✔           |
| thisMonth           |         | X    | X        |      |        |        | ✔           |
| lastMonth           |         | X    | X        |      |        |        | ✔           |
| nextMonth           |         | X    | X        |      |        |        | ✔           |
| thisYear            |         | X    | X        |      |        |        | ✔           |
| lastYear            |         | X    | X        |      |        |        | ✔           |
| nextYear            |         | X    | X        |      |        |        | ✔           |
| at                  |         |      |          | X    |        |        | ✔           |
| not_at              |         |      |          | X    |        |        | ✔           |
| at_before           |         |      |          | X    |        |        | ✔           |
| at_after            |         |      |          | X    |        |        | ✔           |
| greaterThan         |         |      |          |      | X      |        | ✔           |
| lessThan            |         |      |          |      | X      |        | ✔           |
| greaterThanOrEqualTo|         |      |          |      | X      |        | ✔           |
| lessThanOrEqualTo   |         |      |          |      | X      |        | ✔           |
| contains            |         |      |          |      |        | X      | ✔           |
| doesNotContain      |         |      |          |      |        | X      | ✔           |
| startsWith          |         |      |          |      |        | X      | ✔           |
| endsWith            |         |      |          |      |        | X      | ✔           |

---------

Co-authored-by: Javier Coitino <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants