a3d3b17df4
For now we’re going to always add FINAL to TRQL queries for data correctness. In the future we will implement an automated optimization where we use `SELECT argMax(column, _version)` and `WHERE _is_deleted = 0`. But this is a more complex change and needs more investigation of downsides.
TSQL (TriggerSQL)
TriggerSQL is a DSL that is safely converted into ClickHouse SQL queries with protection against SQL injection and it's tenant-safe (users can only query their own data).
Attribution
This package is derived from PostHog's HogQL (MIT License). See NOTICE.md for the full copyright notice.
ANTLR Grammar
The ANTLR grammar is heavily inspired by PostHog's HogQL.
These are found in ./src/grammar and are the .g4 files.
Generating the source code
pnpm run grammar:build