Merged
Conversation
Owner
Author
|
@greptileai pls review this for me |
There was a problem hiding this comment.
PR Summary
Implements a new query/2 function that provides a flexible way to construct complex Ecto queries by accepting a query modification function, eliminating the need for numerous specific query functions.
- Added
query/2implementation inlib/swiss_schema.exthat wraps results in{:ok, result}tuples and handles errors - Test cases in
test/swiss_schema_test.exsverify function accepts custom query functions - Support for alternate Ecto repositories through options parameter
- Function accepts a query transformer of type
(Ecto.Query.t() -> Ecto.Query.t())for query customization - Solves issue #28 by avoiding the need for parameter-specific query handling functions
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
2 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
joeljuca
commented
Jun 6, 2025
Owner
Author
|
@greptileai hey – pls review this one again |
There was a problem hiding this comment.
PR Summary
Added query!/2 function as a non-error-tuple variant of query/2, providing a more direct way to execute Ecto queries with custom transformations.
- Added bang variant
query!/2inlib/swiss_schema.exthat returns results directly or raises on error - Expanded test coverage in
test/swiss_schema_test.exsto include error cases and exception handling - Consistent error handling for both Ecto.Query and Repo.all errors
2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #28