Giter Site home page Giter Site logo

Comments (4)

t9t avatar t9t commented on May 22, 2024 1

I added the following in version 0.4.0:

  • json(b)_array_length
  • json(b)_extract_path
  • json(b)_extract_path_text
  • json(b)_typeof
  • json(b)_strip_nulls
  • jsonb_pretty

from jooq-postgresql-json.

mkurz avatar mkurz commented on May 22, 2024

Any chance you can add json_populate_recordset? Thanks!

from jooq-postgresql-json.

tmdomingues avatar tmdomingues commented on May 22, 2024

And json_array_elements. Much appreciated :)

from jooq-postgresql-json.

t9t avatar t9t commented on May 22, 2024

@tmdomingues I recall that when I was looking into json_array_elements last year, my main problem was expressing the result of the function in the jOOQ API (ie. what Field type to use).

Though I can take a look at jOOQ's own DSL.unnest() to see if I can borrow that API's signature and do something similar.

@mkurz It's a similar problem as the above with json_populate_recordset, but even a level deeper (because a JSON structure is being represented by rows with columns in the result).

If you either have any suggestions how the signature of these functions would look, or an example of how you could imagine using these in your code, I'm very eager to learn about it!

Then, if I have a better view on this, I think it would be easier to figure out how to implement these.

(By the way, you're also free to contribute a pull request if you have a good idea on what this would look like ;-)

Edit: so yes, DSL.unnest() returns a Field<Table> so it can't be used in SELECT clause in jOOQ as we're used to when querying PostgreSQL directly (SELECT unnest(..) FROM table). See also: https://stackoverflow.com/questions/36572388/using-unnest-as-a-field-rather-than-a-table-in-jooq
So I fear that if I implement these functions returning Field<Table>, there will be a similar problem.

Edit2: example queries & datasets help a lot too with trying to see how to implement such functions. :)

from jooq-postgresql-json.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.