-
Notifications
You must be signed in to change notification settings - Fork 348
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
Refactor generated to returning keyword in order to return the correct type #444
Conversation
@gustavoamigo Looking good from here! |
def delete: Delete[T, Long] | ||
} | ||
|
||
implicit class InsertUnassignedAction[T](i: T => UnassignedAction[T, _] with Insert[T, _]) { |
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.
Can we avoid the implicit class here?
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'll try
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.
no lucky trying to remove the implicit class. I tried to create a trait that extends T => UnassignedAction[T] with Insert[T]
, but it breaks macros. It seems to be easier to just use implicit class.
@getquill/maintainers the BTW, there are a few things I need to do like docs and tests, but this branch is ready for testing. |
@getquill/maintainers This PR is ready for review (if it builds). As I said, I removed |
@@ -821,8 +820,8 @@ The `forUpdate` quotation can be reused for multiple queries. | |||
The same approach can be used for `RETURNING ID`: |
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 think we could remove this example or replace it by another one now that returning id
is supported by the DSL.
@getquill/maintainers all right, I think this PR is ready for merging. |
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.3 to 4.1.5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4.1.3...v4.1.5) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Fixes #427
Problem
Right now, the generated parameter in schema is limited to
Long
. If the primary key is not a type that can be casted safely to Long, like UUID, it limits its use.Solution
Create new keyword
returning
which will allow other types to be returned. Example:Notes
Additional notes.
Checklist
README.md
if applicable[WIP]
to the pull request title if it's work in progresssbt scalariformFormat test:scalariformFormat
to make sure that the source files are formatted@getquill/maintainers