0.1.2 • Published 9 months ago

@deix/rossini-postgrest v0.1.2

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
9 months ago

Rossini Postgrest UI

This repository contains react components to display and edit tables using postgrest.

React components usage

The main component is DBTable, which can be used by passing postgrestURL and editable props:

<DBTable
    postgrestURL='http://localhost:8000/api/db'
    dbTable='table_name'
    editable
/>

Props

  • postgrestURL (string): base url where postgrest endpoints are reachable
  • dbTable (string): name of the table
  • filterQuery { key: string: string }: any additional query params to be passed to postgrest
  • editable boolean: will allow editing the table
  • singleSelectColumns {key: string: string[]}: a map where the keys are table columns and the values are a list of selectable options
  • newRowTemplate: an object containing the default values for a new row

Any additional prop will be passed to the underlying DataGrid.

Usage as a docker image

docker run -d \
    -e POSTGREST_URL=http://localhost:8000/ \
    -e ENABLE_EDITING=true \
    -p 3000:3000 \
    quay.io/deix/rossini-postgrest