React Admin is a wonderful react framework and Postgrest is probably one of the fastest ways to create a robust backend with PostgreSQL database.
npm install ra-data-postgrestReact Admin is a wonderful react framework and Postgrest is probably
one of the fastest ways to create a robust backend with PostgreSQL database.
This is a data provider for supporting Postgrest backend with React Admin.
Install with (axios is a peer dependency):
```
npm i ra-data-postgrest axios
Usage:
`jsx harmony
const createDataProvider = require('ra-data-postgrest')
// or import createDataProvider from 'ra-data-postgrest';
const dataProvider = createDataProvider({
host: 'http://hostname',
port: 8080,
});
// Pass it to the
dataProvider={dataProvider}
>
`
And that's it! You are good to go.
This data provider supports all types of react-admin calls:
| Types of actions |
| ------------------ |
| GET_LIST |
| GET_ONE |
| CREATE |
| UPDATE |
| UPDATE_MANY |
| DELETE |
| DELETE_MANY |
| GET_MANY |
| GET_MANY_REFERENCE |
Postgrest supports many types of filters. This data provider supports them by accepts a source string with @:
| Filter | Example | Resulting query URL |
| ------ | ----------------------------------- | ---------------------------------------------- |
| eq | | ?name=eq.${filterValue} |
| gt | | ?age=gt.${filterValue} |
| like | | ?name=like.${filterValue} |
| ilike | | ?name=ilike.${filterValue} |
| in | | ?name=in.(${filterValues.join(,)})` |