Skip to content
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

Add <columns/> to <syntheticObjects/> to generate synthetic columns #13434

Closed
4 tasks done
lukaseder opened this issue Apr 8, 2022 · 0 comments
Closed
4 tasks done

Add <columns/> to <syntheticObjects/> to generate synthetic columns #13434

lukaseder opened this issue Apr 8, 2022 · 0 comments

Comments

@lukaseder
Copy link
Member

lukaseder commented Apr 8, 2022

In order to be able to generate VIRTUAL client side computed columns (#9879), we must be able to add synthetic columns to the code generation output, i.e. column definitions that are not available otherwise in generated code.

The specification will be:

<configuration xmlns="http://www.jooq.org/xsd/jooq-codegen-3.16.5.xsd">
  <generator>
    <database>
      <syntheticObjects>
        <columns>
          <column>

            <!-- Optional regular expression matching all tables that have this column. -->
            <tables>SCHEMA\.TABLE</tables>

            <!-- The column specification -->
            <name>COLUMN</name>
            <type>VARCHAR(10)</type>

            <!-- Possibly also some configuration options from forcedType, for convenience -->
          </column>
        </columns>
      </syntheticObjects>
    </database>
  </generator>
</configuration>

When the synthetic column is not also matched as a client side computed column, then jOOQ will just use it like any ordinary column. The use-case would then be that a column isn't being reported by the schema / dictionary views (e.g. it's hidden), but the user knows it's there.

Tasks

  • Add code generation configuration for <tables>, <name>, <type> (mandatory config)
  • Add code generation configuration for extended attributes
    • Comment
  • Implement code generation

Other, more sophisticated flags may be added in the future: #13436

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

1 participant