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

mutations via native queries #7

Merged
merged 21 commits into from
Mar 20, 2024
Merged

Conversation

hallettj
Copy link
Collaborator

Implements a mutation endpoint to run procedures. I added an example native query to fixtures, insertArtist, to demonstrate.

I'll follow up with another PR that implements arguments to native queries where I'll replace the hard-coded inputs.

I'm having a problem querying the Artist collection which I think is unrelated, but I'm going to check that out and likely submit a bug fix PR. I confirmed that insertArtist does update the database correctly, and I wanted to get this PR out.

Ticket: https://hasurahq.atlassian.net/browse/MDB-86

let native_query = config
.native_queries
.iter()
.find(|native_query| native_query.name == name);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment on PR #5. We will want a more performant way to look up native queries than linear search. This is within a map now so potentially O(m * n) where m is the number of operations and n is the number of native queries.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I filed https://hasurahq.atlassian.net/browse/MDB-91 to follow up

Base automatically changed from jesse/native-queries-in-query-handler to main March 20, 2024 16:36
@hallettj hallettj merged commit 43841fc into main Mar 20, 2024
2 checks passed
@hallettj hallettj deleted the jesse/mutations-via-native-queries branch March 20, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants