Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,55 @@ declare namespace CbServer {
changes: Partial<T>,
uniquelyIndexedColumn: string
): Promise<Array<CollectionSchema<T>>>;
createContinuousAggregate(
query: string,
options: ContinuousAggregateOptions,
): Promise<void>;
fetchAggregateRaw(
aggregateName: string,
query: string,
): Promise<Array<Record<string, unknown>>>;
dropContinuousAggregate(aggregateName: string): Promise<void>;
}

/**
* Must be of one of the following forms:
* - "1 second", "1 hour", "1 day", "1 month", "1 year"
* - "X seconds", "X hours", "X days", "X months", "X years" where X > 1
*/
type TimescaleInterval =
| "1 second"
| "1 hour"
| "1 day"
| "1 month"
| "1 year"
| `${number} seconds`
| `${number} hours`
| `${number} days`
| `${number} months`
| `${number} years`;

interface ContinuousAggregateOptions {
/**
* The name of the continuous aggregate
*/
view_name: string;
/**
* The offset from the current date to begin aggregating data (Ex. "1 month")
*/
start_offset: TimescaleInterval;
/**
* The offset from the current date to stop aggregating data (Ex. "12 hours")
*/
end_offset: TimescaleInterval;
/**
* The interval at which to recompute the continuous aggregate (Ex. "1 hour")
*/
schedule_interval: TimescaleInterval;
/**
* If set to true, the aggregate will be created without initially calculating the aggregate value
*/
with_no_data: boolean;
}

interface CustomSyncAsync {
Expand Down
Loading