1

I'm using React-Admin + ra-data-postgrest + PostgREST + PgSQL to view very large table. Queries to this table MUST be restricted to predefined maximum time range.

I was able to implement time range filter using two DateTimeInputs and PostgREST operators @lte and @gte (source for DateTimeInputs was tstmp@lte and tstmp@gte respectively), but the UX is not very good.

Now I'm trying to improve this solution to use only one DateTimeInput (label Timestamp) and one SelectInput (label Interval) with predefined time intervals: 10s,15s,30s,60s,1min,3min,5min,10min,15min...

But I'm not able to transform the predefined time interval into valid tstmp@gte query value. I can access DateTimeInput timestamp value using useListContext(), I can then translate time interval value into timestamp value for tstmp@gte operator, but I have no idea how to get this calculated value into PostgREST dataProvider query.

Any idea how to do this?

  • I'm using RA + ra-data-postgrest trying to implement log viewer. As the table is VERY long, my goal is to have one input for timestamp and one input for timerange with predefined time intervals (10s,30s,1min...). But the select input is bound to column due to source prop so it gets propagated to call to postgrest and so nothing is returned. What I would like is to have select input that is not bound to any particular column, but its value (and change of value) is propagated to i.e. some calculated "hidden" input with value of current timestamp + interval and the second boundary. – Stanislav Pavlíček Sep 30 '20 at 10:34

0 Answers0