-
Notifications
You must be signed in to change notification settings - Fork 10
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(kotlin): provide operators through extension functions #12
feat(kotlin): provide operators through extension functions #12
Conversation
8c7bcfd
to
0c5be26
Compare
Hi @davinkevin! Sorry, my email provider decided to direct all of the Github mails to the spam folder, so I missed this one! Unfortunately I don't have time to look at it right now, but I'll make some time free tomorrow to have a look. |
No problem, I usually work on open source during weekends and during time given by my company for this kind of project 😉 |
Looks good! I tried it out a little bit in a playground project and it's definitely a nice addition. I'm already very happy with this contribution! I have a couple of remarks & questions of my own:
To answer your questions.
To be honest, the functionality of the functions is already properly tested in the The most value is in tests proving that the extension functions work correctly (on a code/compilation level) with the jOOQ APIs and don't do anything funky (also with respect to the nullability aspect I described above). So probably two Kotlin-based test classes (for Json/Jsonb) in the Let me know if this is enough information to proceed, or if you need some more help with that. Perhaps setting up the test data could yet be a bit tricky, depending on your experiences.
I'm having a little trouble understanding this one. Do you mean that you would like to introduce a "classless" The remark about the Companion class is something I don't really get, so it would be nice if you could elaborate that one. In general I like the suggestion about separate packages I think. Apart from that, I can also imagine extension functions on
I do wonder a bit about the value of a "classless" alternative to |
0c5be26
to
063f56a
Compare
Good catch, I totally forget to change this part of the API. After investigation, |
063f56a
to
5d1ba95
Compare
I've added tests in the integration project to check the equality between |
5d1ba95
to
4bdb938
Compare
Thank for the answer. I've introduced two packages, |
And finally, during testing, I found that two extension functions defined on Right now, I've add an underscore to the method name:
I really don't think this is a solution, but I don't know what you want to do with those functions name. Do you have a better idea on this ? /cc @lukaseder if you want to comment on this 😉. |
To use a more fluent syntax, we provide some extension functions in the kotlin context. All the code is just a bridge with real java implementation. Closes t9t#11
4bdb938
to
6e3b9ab
Compare
On what in particular? |
In the message I |
Well, how about |
Thanks for the answer/advice @lukaseder. @t9t I let you choose 😉. I've removed draft attribute from the PR. If you need me to modify something, let me know 👍. |
Thanks for the extra work! I think For the sake of speed, I wanted to push some small tweaks (including the above rename) to your branch before merging it, but it looks like I don't have access to your branch. I think there's a checkbox when opening/editing a pull request, to allow maintainers of the target repo to push commits to your branch.
I did a little digging, and I think in jOOQ version 3.12, an SQL
The way I understand it is that if the field value itself is SQL Then again I'm not entirely sure what effect that has on the nullability of the I'm sorry I should have looked into this more before making my previous comment! So now I'm thinking about what the practical approach is to continue with this. I think it's perfectly backwards compatible to first accept and merge it as it is (with |
Ah, sorry! Looks like I added the fork by HTTPS rather than SSH, which gave me some authentication issues when pushing. :) I've now pushed my changes to the branch, just some small clean-ups like removing the "Created by" comments and the function rename discussed earlier. Also added a small test which just functions to see some jOOQ+Kotlin interactions, mainly for myself to see what it looks like. You can see the commits here: https://github.com/t9t/jooq-postgresql-json/pull/12/commits I'll merge the change now and make a release. Thank you so much for providing this addition and your patience in dealing with the comments and feedback. If you don't object, I'd like to add a "Contributors" section to the readme and place your name there, as attribution. :) |
@davinkevin This is now released in version 1.3.0. :) Let me know if it works for you, and if you encounter any issues using it or find any omissions, please feel free to create another issue (or even pull request)! |
All seems to be ok on my side 👍. Thank you for the release, and there is no problem to add me as a contributor ❤️. Thank you and have a merry Christmas and an happy new year 🎉. |
To use a more fluent syntax, we provide some extension functions in the kotlin context. All the code is just a bridge with real java implementation.
Closes #11
FYI:
@see
to the related methodQuestions:
com.github.t9t.jooq.json.jsonb
to separate extenions/operators. Something with enclosing class could do the job withCompanion
but I don't think this is a good way to do it.field
methods due to name conflict in the "same package" (described in the previous bullet point)