Giter VIP home page Giter VIP logo

Comments (10)

IanMayo avatar IanMayo commented on August 24, 2024 2

@IanMayo, Btw I just released v0.0.9 which adds bulk mode support in retrieve, update and delete endpoints and there's no extra endpoints for it. And the endpoints are like this now:

  • /tables/singers/rows/1: To retrieve (or update and delete) a single row
  • /tables/singers/rows/1,2,3: To retrieve (or update and delete) multiple rows

Hey - hold on to your hats everyone. @thevahidal is "moving fast and breaking things". It's great to be part of the journey 🤸 🤸 🤸

from soul.

thevahidal avatar thevahidal commented on August 24, 2024

Hi @IanMayo,
Thanks for checking out Soul.
From what I saw we need to add bulk actions (update and delete) to Soul to be compatible with react-admin.
Bulk endpoints are in my mind and I can prioritize them if you're willing to work on the react-admin API provider.

from soul.

thevahidal avatar thevahidal commented on August 24, 2024

@IanMayo,
I just added bulk endpoints. It's available in v0.0.8.

from soul.

IanMayo avatar IanMayo commented on August 24, 2024

Now that's an impressive turnaround @thevahidal

It looks like soul still needs getMany and getManyReference.

I'm pretty sure react-admin uses these to get the data involved in one-to-many relationships. Imagine the user wants to view a page of 10 music tracks which contain a foreign key for the album, but the app must display the album title. There will need to be a REST query to get the albums data. It would be a waste to retrieve the full list of albums if only 3 are required, better to just call http://my.api.url/albums?filter={"ids":[123,456,789]}

Here is how StackOverflow documents there support for this API behaviour: https://api.stackexchange.com/docs/answers-by-ids

from soul.

thevahidal avatar thevahidal commented on August 24, 2024

@IanMayo,
I will add bulk retrieve too.
For the related fields, Soul already support extending foreign keys with _extend query parameter, available for list and retrieve endpoints.

from soul.

thevahidal avatar thevahidal commented on August 24, 2024

I need to update the endpoints though, I think /bulk is not that good, I'll go with /1,2,3 (where 1, 2, 3 are the ids).

from soul.

IanMayo avatar IanMayo commented on August 24, 2024

Hello @thevahidal - I haven't seen _extend in a REST API before. I can understand why you've done it.

But, in your example, there is an inevitable duplication of the Iron Maiden data:
image

In the soul API there isn't a way of specifying which fields to get back in _extend - so I presume the ArtistId_data must contain the full contents of the Artist record.

Please recognise this as constructive encouragement @thevahidal - it's clear you're moving quickly, and I'm trying to help out ;-)

from soul.

thevahidal avatar thevahidal commented on August 24, 2024

@IanMayo,
We have another query param _schema which let's user only get the fields he intended for example ?_schema=AlbumId,Title which right now doesn't work on _extended fields but my goal is to make it work for these too, e.g. _schema=AlbumId,Title,ArtistId{Name}.

About the extending, I couldn't find a better way to do it. Please let me know if you know a more intuitive way to do it.

Also, I totally appreciate your help! Thanks for helping to make Soul a better tool.

from soul.

thevahidal avatar thevahidal commented on August 24, 2024

@IanMayo,
Btw I just released v0.0.9 which adds bulk mode support in retrieve, update and delete endpoints and there's no extra endpoints for it.
And the endpoints are like this now:

  • /tables/singers/rows/1: To retrieve (or update and delete) a single row
  • /tables/singers/rows/1,2,3: To retrieve (or update and delete) multiple rows

from soul.

IanMayo avatar IanMayo commented on August 24, 2024

Please let me know if you know a more intuitive way to do it.

I know it's two calls, but I think the 1,2,3 could be a tidy way of doing it. As the client app is collating the Tracks data, it get the tracks/_filters=RockGod:true. Then it loops through the rows and collates the Albums it needs data about then calls albums/1,3,4?_schema=AlbumId, Title (or something like that :-). If there is only one albumId (albums/4) then the call may even have been cached - one of the aims of REST.

from soul.

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.