-
Notifications
You must be signed in to change notification settings - Fork 696
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-494 Inline DSL statement and query functions #2272
Conversation
fun <T : Table> T.deleteReturning( | ||
returning: List<Expression<*>> = columns | ||
): ReturningStatement { | ||
val delete = DeleteStatement(this, where?.let { SqlExpressionBuilder.it() }, false, null) | ||
val delete = DeleteStatement(this, null, false, null) | ||
return ReturningStatement(this, returning, delete) | ||
} |
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 created some new overloads to avoid issues with nullable parameters + inline
.
I would have liked to be able to call one from the other instead of duplicating logic, but I couldn't get that to work given the nature of SqlExpressionBuilder.() -> Op<Boolean>
.
@e5l Please let me know if any of these don't make sense to split just for inline.
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.
look ok
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.
lgtm
fun <T : Table> T.deleteReturning( | ||
returning: List<Expression<*>> = columns | ||
): ReturningStatement { | ||
val delete = DeleteStatement(this, where?.let { SqlExpressionBuilder.it() }, false, null) | ||
val delete = DeleteStatement(this, null, false, null) | ||
return ReturningStatement(this, returning, delete) | ||
} |
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.
look ok
Make as many eligible statement and query functions inline where possible. Functions with nullable functional type paramaters have been marked noinline, but this may change upon review.
- Add crossinline keyword to body parameters to prevent non-local returns - Duplicate functions with null where parameters to allow inline
- Introduce back original extension functions (with nullable parameters) as deprecated versions. - Update .api dump
d5f1d2c
to
6e78edf
Compare
Description
Summary of the change:
Add
inline
modifier to query functions that are passed lambda parameters.Detailed description:
inline
modifier to query functions, where possible, withcrossinline
modifier on body/block parameters to prevent non-local returns.noinline
on nullablewhere
lambda parameters, some functions have been duplicated as overloads instead.Type of Change
Please mark the relevant options with an "X":
Affected databases:
Checklist
Related Issues
EXPOSED-494