This monorepo is managed with Turborepo and contains tools for SQL lineage extraction, UI components, linting, and TypeScript configuration. It is organized into apps and packages, all written in TypeScript.
| App | Description |
|---|---|
@sql-lineage/demo |
Vite-based demo app for testing and showcasing SQL lineage features |
| Package | Description |
|---|---|
@sql-lineage/core |
TypeScript library for extracting column and table lineage from Trino SQL queries (ANTLR4-based) — see package README |
@sql-lineage/eslint-config |
Shared ESLint configuration (includes Next.js and Prettier configs) |
@sql-lineage/typescript-config |
Shared TypeScript configuration files |
Supported dialect: Trino SQL, parsed via the official Trino ANTLR4 grammar from Trino's source code.
@sql-lineage/core statically analyses a Trino SQL statement and answers two questions:
- Which physical tables does this query read from? (
getUpstreamTables) — returns a sorted, de-duplicated list of real table names, excluding CTEs and derived tables. - Which columns from each table are actually used? (
getColumnLineage) — tracks every column reference across the full query (SELECT, WHERE, JOIN, GROUP BY, HAVING, ORDER BY, window functions) and maps each one back to its source table.
See the full API and logic documentation for details.
Clone the repo and install dependencies:
git clone <repo-url>
cd sql-lineage
npm install
To build all apps and packages:
npx turbo build
To build a specific package/app:
npx turbo build --filter=@sql-lineage/core
npx turbo build --filter=demo
To start development mode for all apps/packages:
npx turbo dev
To develop a specific app:
npx turbo dev --filter=demo
To run tests for the lineage package:
npm -w @sql-lineage/core run test
Turborepo supports Remote Caching via Vercel. To enable, authenticate and link your repo:
npx turbo login
npx turbo link
For package-specific details, see individual README files in each package/app.