Support glob patterns in srcDir#132
Open
DustinJSilk wants to merge 1 commit into
Open
Conversation
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.
Motivation / Use Case
Currently, we're building a domain-driven architecture and want to colocate our queries closely with their callers to improve maintainability. However, because
srcDircaptures everything within the specified directory, we run into issues with mixed file types.For example, we want to compile our query files (
src/domain_1/queries/*.sqlandsrc/domain_2/queries/*.sql), but we actively want to exclude other SQL files living in the same domains, such assrc/domain_1/migration.sql.Proposed Solution
This PR updates
srcDirto support glob patterns (e.g., srcDir:src/**/queries).Why not other approaches?
server/queries/directory (e.g.,server/queries/domain_1/mirroringserver/domain_1/). However, colocation keeps domain logic bounded and is vastly preferable for our project structure.ignoreFilesoption. I believe allowing globs directly insrcDiris a cleaner, more flexible solution that keeps the configuration surface area small while solving the same problem.Would love to hear your thoughts on this approach!