Comments (10)
@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.
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.
@IanMayo,
I just added bulk endpoints. It's available in v0.0.8.
from soul.
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.
@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.
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.
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:
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.
@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 _extend
ed 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.
@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.
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)
- Syntax Error on starting soul HOT 2
- Soul error on single quote HOT 4
- Authentication Tasks HOT 25
- Authentication Feature Todo lists HOT 2
- Serve static files over express server HOT 2
- Request for Code Formatting Standardization in Project: Configuring a Formatter for Consistent Code Style HOT 2
- Bug: bad links on web page HOT 3
- Add a logout API HOT 1
- Protect "transactions" endpoint HOT 4
- Add an API to list one's permissions
- Accessing `_users` table with auth off
- Allow Passing Optional Fields for the `_users` Table
- Fix Soul crashing when a user tries to login without having a role
- Default Values in CLI Schema Prevent Extraction of Config Variables from .`env` File in CLI Mode
- Wrong name provided for rate limiting parameters in sample `.env` file
- Add a CLI command to pass a path for `.env` file
- Modify `Auth` documentation
- Select distinct values HOT 1
- Example of auth requests HOT 4
- Add Documentation for Hosting Static Content
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soul.