Skip to content

Commit 49df40c

Browse files
authored
TRQL and the Query page (#2843)
TRQL (pronounced Treacle like the delicious British dark sweet syrup) is the TRiggerQueryLanguage. It allows users to safely write queries on their data. The queries are safely turned into ClickHouse queries which are tenant-safe and not SQL injectable. https://github.com/user-attachments/assets/bbfca473-b3fc-4150-8fe6-79e8840a2d29 This started out as a translation of HogQL by PostHog from Python to TypeScript. Features - Tenant safe queries. - Many underlying ClickHouse features including functions and aggregations. - Virtual columns, which are exposed to users as real columns but are actually expressions. - Transformations of data types and where clauses. - Simple JSON path querying. - Limits on execution time. - Reporting of query statistics. ## Query page There’s a new Query page (currently behind a feature flag) where you can write TRQL queries and execute them against your environment, project or organization. Features - Executing TRQL queries - Syntax highlighting and errors - Autocomplete - AI generation/editing of queries - Help and examples - Table with auto-inferred data types from the table schema - Table cell renderers for our special types like Run ids, environments, machines, tasks, queues, etc. - Copy/export as CSV/JSON - Line and bar graphs with grouping and stacking - History of queries
1 parent cf0aa9b commit 49df40c

File tree

100 files changed

+43031
-584
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+43031
-584
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { cn } from "~/utils/cn";
2+
import { Badge } from "./primitives/Badge";
3+
import { SimpleTooltip } from "./primitives/Tooltip";
4+
5+
export function AlphaBadge({
6+
inline = false,
7+
className,
8+
}: {
9+
inline?: boolean;
10+
className?: string;
11+
}) {
12+
return (
13+
<SimpleTooltip
14+
button={
15+
<Badge variant="extra-small" className={cn(inline ? "inline-grid" : "", className)}>
16+
Alpha
17+
</Badge>
18+
}
19+
content="This feature is in Alpha."
20+
disableHoverableContent
21+
/>
22+
);
23+
}
24+
25+
export function AlphaTitle({ children }: { children: React.ReactNode }) {
26+
return (
27+
<>
28+
<span>{children}</span>
29+
<AlphaBadge />
30+
</>
31+
);
32+
}

0 commit comments

Comments
 (0)