-
Notifications
You must be signed in to change notification settings - Fork 697
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
feat: EXPOSED-255 Generate database migration script that can be used with any migration tool #1968
Merged
+397
−36
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
944d3f1
feat: EXPOSED-255 Generate database migration script that can be used…
joc-a 59ebeda
-modify KDoc for generateMigrationScript function
joc-a ffe891c
-modify KDoc for checkExcessiveIndices and make it public again
joc-a 141f821
-rearrange logic in checkExcessiveIndices
joc-a accf6ef
add note about breaking changes
joc-a acdd5c8
-modify KDoc for generateMigrationScript
joc-a cdca926
modify note about breaking changes to include new return type
joc-a File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
Oops, something went wrong.
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.
I would drop
withLogs
flag and rely on the log levelThere 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.
For computations, we can make our own inline function with
message: () -> String
argument or check if the logging library has one.@bog-walk, what do you think?
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 agree that I would drop
withLogs
, at least for the new generate function.We could check for the enabled level, but, for example, the results in logTimeSpent() are meant for the INFO level, which I believe a lot of users set as the default. So relying on a guard like
exposedLogger.isInfoEnabled
, or the implicit level check ininfo()
, might evaluate totrue
for many and result in users getting logs they don't want. Maybe if we were logging everything to DEBUG it would be easier.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.
@e5l What do you mean by "computations"?
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.
If you put an expression in a string template, it will be computed regardless of the log level:
logger.info("foo: ${heavyFunctionCall()}")
Otherwise, we could have an extension function with block:
logger.info { "foo: ${heavyFunctionCall()}" }
In this case, the string template is computed only when we call lambda (and we can condition it to the log level)
I think it's not critical for this PR, feel free to implement it later or ignore
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'm going to leave this as is right now just to keep this PR small, but I made a note of it for the next PR.
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.
@e5l @joc-a If the end goal is to avoid these computations, we could also switch to parameterized logging, which is supported by slf4j. This would mean using the existing function variants that take a second argument:
exposedLogger.info("foo: {}", heavyFunctionCall())
According to the docs, if I'm understanding correctly: