Comments (4)
In supabase you can expose multiple schemas. Under the hood supabase is using Postgrest for exposing its api, and Postgrest allows targeting other/multiple schemas using the Accept-Profile
and Content-Profile
headers.
These 2 headers are not implemented by ra-data-postgrest yet.
I would propose to implement this using React-admin's meta
-parameter, in a way that a dataProvider request would look like this.
const { data, isLoading, error } = useGetOne(
'books',
{
id: 1,
meta: { schema: 'data' }
},
);
When ra-data-postgrest would find a schema in meta, it would then add the appropriate header (depending on the http method) to make Postgrest query the table/view/function from that schema.
Thoughts?
from ra-data-postgrest.
Thank you!!!
I'm not that familiar with postgrest or react-admin internals, so am probably the wrong person to give feedback.
My generic perspective is that the separation between 'books' and meta.schema.data is strange, and I would expect either a 1. factory method since postgrest apparently exposes only one schema at a time, or 2. simpler notation like 'data.books', since that's where the table is always going to be.
Or what about something like this?
const dataProvider = postgrestRestProvider('....', switchSchema('data'));
or object style
const dataProvider = postgrestRestProvider({ url, schema });
from ra-data-postgrest.
Hey @braco, we are currently working on several improvements and subsequently will add new features. Thus, we currently have kind of a feature-freeze. As of now, I like your suggestion of adding the schema as a parameter.
from ra-data-postgrest.
@braco , I just released v2.0.0-aplha.2 which includes custom schema functionality. Feel free to test it and whether you encounter any issues, I would be glad to hear of it ;) In that case, feel free to reopen this issue or create a new one.
from ra-data-postgrest.
Related Issues (20)
- Use ra-data-postgrest as an auth provider HOT 1
- Multiple OR operators HOT 6
- Diff updates HOT 2
- support specifying nullsfirst or nullslast in sorting config. HOT 1
- not working with V4
- React Admin v4 does not work with current ra-data-postgrest version HOT 3
- Versioning HOT 6
- Enforce code formatting HOT 3
- Who's in for adding unit tests? HOT 10
- needs screenshots in readme HOT 4
- The create method should return the data returned by Postgrest and not the posted data HOT 2
- Default behavior is trying to PATCH/update primary key? HOT 9
- No API key found in request HOT 3
- Allow column filtering HOT 9
- Any plans to implement queryOptions? HOT 4
- Are embedded resources supported? HOT 6
- URL malformed when passing a set to "contains" ( cs / @> )
- updateMany returns Bad Request Error HOT 5
- how to implement full text filter? HOT 2
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 ra-data-postgrest.