The readme file has this example for adding a continuous aggregate policy:
add_continuous_aggregate_policy('events_per_minute',
start_offset: '3 minute',
end_offset: '1 minute',
schedule_interval: '1 minute')
But I think that this is actually the raw SQL that is needed, not the ruby code?
In ruby:
- The method is called
create_continuous_aggregate_policy
- You need to add extra quotes to the durations.
"'1 minute'" and "INTERVAL '1 minute'" seem to work.
On the second point, it looks like it might be a good idea to have the library apply parse_interval to the durations (noting that the offsets can also be nil)?