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 support for nested records, such as Record2<R1, R2> #2360

Closed
lukaseder opened this issue Mar 29, 2013 · 3 comments
Closed

Add support for nested records, such as Record2<R1, R2> #2360

lukaseder opened this issue Mar 29, 2013 · 3 comments

Comments

@lukaseder
Copy link
Member

This could be useful for users trying to restore the table product created from JOIN expressions in the currently more generic Result<?> type. In other words, it should be possible to write:

Result<Record2<CountryRecord, CityRecord>> result = 
create.select()
      .from(COUNTRY)
      .leftOuterJoin(CITY).on(...)
      .fetch();

The concrete API implications would have to be well thought through. Probably, this should only work when explicitly selecting various row value expressions, e.g.

Result<Record2<CountryRecord, CityRecord>> result = 
create.select(row(COUNTRY), row(CITY))
      .from(COUNTRY)
      .leftOuterJoin(CITY).on(...)
      .fetch();

Note, this is natively supported in PostgreSQL, as can be seen in this blog post here:
http://blog.jooq.org/2014/04/15/how-to-do-this-with-sql-of-course/

  select
    d.*,
    row(sektor, row, scene1, scene2) block
  from d

or simply:

  select d
  from d
@lukaseder
Copy link
Member Author

Potential duplicate of #3886

@lukaseder
Copy link
Member Author

The embeddable type feature (#2530) proves to be a lot more difficult to implement than first expected. We'll postpone the feature, and features built on top of it, to 3.13.

@lukaseder lukaseder added this to To do in 3.14 Embeddable Types via automation Aug 20, 2020
@lukaseder
Copy link
Member Author

This does seem to be a duplicate of #3886, where a Row[N] can be wrapped as a Field<Record[N]> using DSL::rowField

3.14 Embeddable Types automation moved this from To do to Done Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant