Skip to content

Conversation

@irshadaj
Copy link
Contributor

@irshadaj irshadaj commented Sep 15, 2023

Description

This MR adds the ability for users to CRUD custom cypher queries that persist through server restarts (but not through cleared DBs). Access to these queries will be limited to self for now.

How Has This Been Tested?

Added unit tests for model, handler

Manual testing:

Set up a custom query in the database as follows
pgadmin

Then tried different combinations of params and verified that each one returns the expected response:

sort error sorted invalid filter column invalid predicate success

Types of changes

  • Chore (a change that does not modify the application functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Documentation updates are needed, and have been made accordingly.
  • I have added and/or updated tests to cover my changes.
  • All new and existing tests passed.
  • My changes include a database migration.

@irshadaj irshadaj self-assigned this Sep 15, 2023
@irshadaj irshadaj marked this pull request as draft September 15, 2023 20:22
@irshadaj irshadaj marked this pull request as ready for review September 20, 2023 19:21
@irshadaj irshadaj changed the title Saved custom cypher queries Saved custom cypher queries (GET) Sep 20, 2023
@irshadaj irshadaj changed the title Saved custom cypher queries (GET) Saved user cypher queries (GET) Sep 20, 2023
@elikmiller
Copy link
Contributor

Looks like there is an issue when returning the count field in the response.

Screenshot from 2023-09-21 09-54-37

Screenshot from 2023-09-21 09-55-02

I've highlighted the rows that are associated with the authenticated user. I would expect the count returned to be 3 rather than the given 6

@irshadaj
Copy link
Contributor Author

irshadaj commented Sep 21, 2023

Fixed count bug @elikmiller :

Screenshot 2023-09-21 at 3 05 14 PM Screenshot 2023-09-21 at 3 04 57 PM

@irshadaj
Copy link
Contributor Author

Re-tested after rename:

Screenshot 2023-09-21 at 4 18 14 PM

@superlinkx
Copy link
Contributor

Other than the concern that the permission used doesn't quite fit the use case and the TODO being ambiguous, this all tests well. Validated the schema and usage against the ticket and everything checks out otherwise.

@irshadaj irshadaj merged commit 4ce55ad into main Sep 26, 2023
@irshadaj irshadaj deleted the user_saved_queries branch September 26, 2023 06:44
@github-actions github-actions bot locked and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants