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
Add queryContext to schema and query builders #2314
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
d283df8
Merge pull request #1 from tgriesser/master
joelmukuthu 33bd3a1
feat(query-builder): add hookContext for wrapIdentifier
joelmukuthu 7e68241
refactor: use isUndefined
joelmukuthu 20f57b8
test(transaction): test passing of hookContext
joelmukuthu b67009b
feat(runnner): pass context to postProcessResponse
joelmukuthu 117701c
test(runner): test postProcessResponse for raw responses
joelmukuthu 08ba2c8
test(raw): test passing of hookContext
joelmukuthu 486e637
feat: add hookContext to Raw and SchemaBuilder
joelmukuthu 5823c7e
test(transaction): fix test for hookContext
joelmukuthu 4e65b1a
chore: fix lint error
joelmukuthu d2266e4
fix: check for hookContext before calling it
joelmukuthu 2ce2ce3
test(transaction): fix hookContext test
joelmukuthu e22ff8a
Merge branch 'master' into feat/hook-context
joelmukuthu fdc2dfe
chore: remove whitespace
joelmukuthu d6b5c0e
test(hookContext): test cloning of context object
joelmukuthu cdb91b8
refactor: hookContext -> queryContext
a1b3658
minor: use more descriptive variable name
8ebd8e2
fix: remove unnecessary checks for query builder
3b4f837
fix(Raw): pass query builder to formatter
be317bc
fix(SchemaCompiler): pass schema builder to formatter
07a7a34
refactor: add addQueryContext helper
f22a2b1
feat: add queryContext to TableBuilder and ColumnBuilder
cdad1bb
fix(TableCompiler): pass table builder to formatter
1feb6f5
fix(ColumnCompiler): pass column builder to formatter
48bbbd3
fix(pushQuery): fix passing builder to formatter
joelmukuthu feb10e0
test(Schema|Table|ColumnCompiler): test passing queryContext
joelmukuthu 36ce3c1
fix(SchemaCompiler): pass queryContext to TableCompiler
joelmukuthu b8ef521
fix(TableCompiler): pass queryContext to ColumnCompiler
joelmukuthu 08f5467
test: add queryContext tests for all schema dialects
joelmukuthu 9b28ae0
test(TableCompiler): test overwriting queryContext from SchemaCompiler
joelmukuthu 09be564
test(Raw): test passing queryContext to wrapIdentifier
joelmukuthu 11b31d8
tests: run all the tests
joelmukuthu File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't all these be
Thats more understandable for anyone reading the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had it like that at first but then I noticed that the convention was passing all the arguments, for example on line 53 there:https://github.com/tgriesser/knex/blob/59f6cba17839435e3c10d9e1011d5b78e4a970f0/src/dialects/oracledb/index.js#L53
Or is that because those are the generic compiler and transaction classes?
I agree though that it's more readable..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it has just been personal preference of the one who originally implemented oracledb dialect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. but then it's also the same on the mssql dialect. I don't mean to prod I'm just a sucker for conventions :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both dialects are pretty new ones and might have been used as a reference for each other. But sure you are right, since that syntax is used everywhere in those dialects, there is no reason why it couldn't be used also in this PR. So no need to change that.