Code Monkey home page Code Monkey logo

Comments (6)

tripodsan avatar tripodsan commented on July 1, 2024 1

maybe we should change the data format of the returned table, like many others do. just returning the plain JSON array is IMO insufficient.

adding more information about the result set would also help creating pagination etc...

minimal example:

/bla.xls?limit=100&offset=50

{
  total: 5670,
  limit: 100,
  offset: 50,
  data: [ .... ]
}

example with force truncation

/bla.xls?limit=3000

{
  total: 5670,
  limit: 2354,
  offset: 0,
  data: [ .... ]
}

this would also allow for a more efficient format for tables. eg:
/bla.xls?limit=3000&type=matrix

{
  total: 5670,
  limit: 2354,
  offset: 0,
  type: 'matrix',
  columns: [ 'a', 'b', 'c', .... ]
  rows: [[0, 1, 2], [3, 4, 5], ...]
}

from helix-data-embed.

MarquiseRosier avatar MarquiseRosier commented on July 1, 2024

Guess querybuilder should help here too? @trieloff

from helix-data-embed.

trieloff avatar trieloff commented on July 1, 2024

Not really. I wouldnโ€™t apply a default truncation, as we donโ€™t have a way of indicating that the result set has been truncated.

One possible solution would be to estimate how many elements would be ok and then send a redirect to the same URL with new QB limits applied. The client can then follow the redirect and accept the truncation.

from helix-data-embed.

tripodsan avatar tripodsan commented on July 1, 2024

@davidnuescheler WDYT about adding the extra data property in the json response ?

from helix-data-embed.

tripodsan avatar tripodsan commented on July 1, 2024

or maybe similar than:

https://www.contentful.com/developers/docs/references/content-delivery-api/#/introduction/collection-resources-and-pagination

{
  "skip": 0,
  "limit": 100,
  "total": 1256,
  "items": [ /* 100 individual resources */ ]
}

from helix-data-embed.

trieloff avatar trieloff commented on July 1, 2024

๐ŸŽ‰ This issue has been resolved in version 2.0.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

from helix-data-embed.

Related Issues (20)

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.