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

Feature/composite queries backend #416

Merged
merged 10 commits into from
Sep 25, 2024
Merged

Conversation

Keanumrc
Copy link
Contributor

@Keanumrc Keanumrc commented Sep 24, 2024

  • Added api/query-management/get-subqueries endpoint to get valid saved queries that can be used as subqueries

Endpoint details:

Request:

PUT to .../api/query-management/get-subqueries

Auth

The currently signed-in user's JWT should be sent through as a bearer token

Body contents:

  • db_id: The ID of a database server to fetch saved queries for
  • database_name: The name of the database on the server to fetch queries for

Response:

  • an object containing 'query_data' which is an array of saved_queries each with:

    • query_id: the saved query's UUID
    • queryTitle: the title of the saved query
    • parameters: the QueryParams object of the query
  • Added IN as a comparison operator in the intermediate JSON

  • Added QueryParams as a possible type of primitive condition value in the intermediate JSON

  • Adjusted both MySqlJsonConverter and PostgresJsonConverter to deal with QueryParams in conditions recursively

  • Adjusted QueryManagement to strip PageParams and SortParams from queries before they are saved so as to allow them to be used as subqueries

  • Adjusted MySqlQueryHandler and PostgresQueryHandler to throw subquery-specific errors for the frontend to handle

  • Added additional error-checking and toast error notifications to TableResponse on the frontend so as to display the aforementioned errors from the backend, so users can adjust their subqueries

  • Fixed the issue where the Cypress binary was missing causing the Cypress CI tests to fail

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 32.00000% with 51 lines in your changes missing coverage. Please review.

Project coverage is 75.88%. Comparing base (1073c73) to head (b8b084f).
Report is 11 commits behind head on dev.

Files with missing lines Patch % Lines
...app/src/components/TableResponse/TableResponse.tsx 13.33% 13 Missing ⚠️
...es-query-handler/postgres-query-handler.service.ts 7.69% 12 Missing ⚠️
...d/src/query-management/query-management.service.ts 0.00% 10 Missing ⚠️
...-sql-query-handler/my-sql-query-handler.service.ts 11.11% 8 Missing ⚠️
...builder-backend/src/interfaces/intermediateJSON.ts 0.00% 2 Missing ⚠️
...sql-json-converter/mysql-json-converter.service.ts 60.00% 2 Missing ⚠️
...-json-converter/postgres-json-converter.service.ts 60.00% 2 Missing ⚠️
...backend/src/query-management/dto/save-query.dto.ts 80.00% 1 Missing ⚠️
...rc/query-management/query-management.controller.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #416      +/-   ##
==========================================
- Coverage   76.25%   75.88%   -0.38%     
==========================================
  Files         112      113       +1     
  Lines        8397     8458      +61     
  Branches      845      742     -103     
==========================================
+ Hits         6403     6418      +15     
- Misses       1961     2037      +76     
+ Partials       33        3      -30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Keanumrc Keanumrc requested a review from u22738917 September 24, 2024 19:02
@u22738917 u22738917 merged commit 14f2fc4 into dev Sep 25, 2024
8 of 10 checks passed
@Keanumrc Keanumrc deleted the feature/composite-queries-backend branch September 26, 2024 16:04
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.

2 participants