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

ORDER on views #38

Open
jstcki opened this issue Mar 17, 2021 · 3 comments
Open

ORDER on views #38

jstcki opened this issue Mar 17, 2021 · 3 comments

Comments

@jstcki
Copy link
Contributor

jstcki commented Mar 17, 2021

I saw that there is a way to add LIMIT etc. to a view like this:

  view.ptr.addOut(ns.view.projection, projection => {
    const order = projection.blankNode()
      .addOut(ns.view.dimension, view.dimensions[0].ptr)
      .addOut(ns.view.direction, ns.view.Ascending)

    projection.addList(ns.view.orderBy, order)
    projection.addOut(ns.view.limit, pageSize)
    projection.addOut(ns.view.offset, offset)
  })

Conveniently found this here 😁 https://github.com/zazuko/cube-creator/blob/a32a90ff93b2c6c1c5ab8fd110a9032a8d179670/apis/core/lib/domain/observations/lib/index.ts#L44-L52

Could those be added as methods to a view, similar to view.addFilter()?

@bergos
Copy link

bergos commented May 10, 2021

Support for offset and limit was added in #51

@l00mi l00mi changed the title LIMIT, ORDER, OFFSET on views ORDER on views Jul 2, 2021
@l00mi
Copy link
Contributor

l00mi commented Jul 2, 2021

@herrstucki do you need ORDER right now, or can we push this for later?

@jstcki
Copy link
Contributor Author

jstcki commented Jul 2, 2021

Not needed for our use case right now but I‘d say that offset/limit are not very useful without it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants