From 478a77b3e21d5fff3fbbc34f71dd336694aa2a47 Mon Sep 17 00:00:00 2001 From: Ankur Goyal Date: Tue, 17 Feb 2026 16:15:00 -0800 Subject: [PATCH] bump --- js/btql/ast.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/btql/ast.ts b/js/btql/ast.ts index 6bb40c52f..70174e199 100644 --- a/js/btql/ast.ts +++ b/js/btql/ast.ts @@ -93,6 +93,7 @@ export type IdentPiece = z.infer; export const identSchema = z.strictObject({ op: z.literal("ident"), name: z.array(identPieceSchema), + alias: z.string().nullish(), loc, }); export type Ident = z.infer; @@ -109,17 +110,24 @@ export interface Star { loc?: NullableLoc; } +export const shapeSchema = z.enum(["spans", "traces", "summary"]); +export type Shape = z.infer; + export interface Function { op: "function"; name: Ident; args: (Expr | AliasExpr)[]; loc?: NullableLoc; + shape?: Shape | null; + alias?: string | null; } export const functionSchema: z.ZodType = z.object({ op: z.literal("function"), name: identSchema, args: z.array(z.union([z.lazy(() => exprSchema), z.lazy(() => aliasExpr)])), loc, + shape: shapeSchema.nullish(), + alias: z.string().nullish(), }); export const comparisonOps = [ @@ -323,9 +331,6 @@ export const sortExpr = z.strictObject({ export type SortExpr = z.infer; -export const shapeSchema = z.enum(["spans", "traces", "summary"]); -export type Shape = z.infer; - export const fromFunctionSchema = functionSchema.and( z.object({ shape: shapeSchema.nullish(),