-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Redesign the code generation API #3883
Comments
Will Kotlin support be part of the redesign? If that is the case then it would be very helpful to have Kotlin code generated that is Kotlinic (idiomatic Kotlin/the Kotlin way), and follows the official Kotlin Coding Conventions. FYI there is a library for generating Kotlin code called Kotlin Poet which is maintained by Square Inc. |
@napperley It says right there: "1. Target languages and forms / Java and Scala (current support) / Ceylon, Kotlin, Clojure"
We'll definitely not use an API based approach to generating code. If we change anything at all to the way code is generated, we might replace the home-grown templating language by a more versatile one, see "2. Templating language" |
Could the templating language be in the form of a DSL? If that is the case then using a language that has built-in support for developing DSL's (eg Kotlin) would be an option to take into consideration. |
I don't see the value of Kotlin's (or Groovy's for that matter) DSL-esque notation, nor how this is related to templating. The only reason why Kotlin might be a candidate are its multi-line string and string interpolation capabilities. Anyway, thanks for sharing your enthusiasm for Kotlin. If this task is implemented, certainly, we'll keep in mind potential improvements in that area. |
Very interested in improvements in the code generator like:
If I want to write my own generator, I've looked at |
@davinkevin Thank you for your suggestions. While an improved code generator should definitely make it easier for usersto introduce In SQL, every type is per se nullable. Some columns do have a
There are no examples because if there were, we'd have to start supporting
While some tweaks are definitely possible right now, they are tweaks and not well designed improvements (due to the nature of |
Despite the number of upvotes on this issue, it's unlikely this will be implemented soon, even in a major release:
Given the very very poor cost / benefit ratio, I'm going to reject this issue now. |
The code generation "API" has grown organically over the past releases of jOOQ 2.x and 3.x. Users desiring to override some behaviour rely heavily on its internals.
This may seem acceptable as we're talking about "only" code generation, but it is still hard to maintain user-defined behaviour in a stable way across jOOQ minor releases. The risk of breaking things between minor releases is substantial.
We should definitely re-write the entire API in a much more object-oriented and extensible fashion in jOOQ 4.0.
Feedback from the user group (https://groups.google.com/forum/#!topic/jooq-user/aZ0CJwUfdkM):
1. Target languages and forms
2. Templating language
Alternatives are
3. Style
4. Generator strategies
5. Disambiguation / compiler "optimisations"
6. Custom code
See also:
The text was updated successfully, but these errors were encountered: