Skip to content

BucketFields

BucketFields<S, B, M> = object & { [R in B[number] as R["name"]]: R["name"] extends keyof S ? S[R["name"]] extends Field<infer V> ? Field<V> : never : never } & { [K in keyof M & string as M[K] extends readonly (infer A)[] ? “sum” extends A ? `${K}_sum` : never : never]: Field<string | null> } & { [K in keyof M & string as `${K}_count`]: Field<string> } & { [K in keyof M & string as M[K] extends readonly (infer A)[] ? “max” extends A ? `${K}_max` : never : never]: K extends keyof S ? S[K] extends Field<infer V> ? Field<V | null> : never : never }

Defined in: packages/schema/src/buckets/buckets.ts:23

The fields of a time rollup: its key id, bucket, the by fields, the count events, and the measures’ <name>_sum, <name>_max and <name>_count.

bucket: Field<string>

The start of the bucket’s hour or day.

events: Field<string>

How many records of the source fell in the bucket, a bigint.

id: Field<string>

The record’s key, a bigint.

S

B extends readonly Ref[]

M